Here is a list of things we should try to do:
- Propose and define model app layout (Makefile, GET, ...) under osv-apps
- Typically each app has GET shell script, Makefile and module.py:
- GET typically downloads ad puts source files into upstream directory (sometimes using latest script)
- Makefile typically does what needs to be done (sometime compiles) and puts source files into install subdirectory (sometimes usr.manifest is generated, sometime usr.manifest is pre-defined).
- module.py is called to execute extra logic - sometimes to generate usr.manifest, define cmdline and possibly multiple flavors
- This is somewhat documented in the README.md of osv-apps project but is not clear enough and the apps are all over the place following this loose convention and I am myself guilty of not following it (see python2x/3x apps that do too much in GET). I doubt it is worth fixing existing apps but I think we could improve the documentation in this area and and possibly point to a good model app.
- I know our build system (scripts/build and related python scripts) is complicated enough. But it would be super nice to allow passing parameters from scripts/build to app Makefile. The best use case for that is building java9 (10,11,12 as well) JREs using jlink where it would be nice to pass a list of JRE modules to incorporate - see https://github.com/cloudius-systems/osv-apps/blob/master/openjdk9-zulu-java-base/Makefile#L26; I think there are many other apps that would benefit
- Eliminate external - https://github.com/cloudius-systems/osv/issues/743
- It would be nice to detail what to do to each subdirectory (I am not positive we want to eliminate all - see x64/acpica)
- Convert to CMakefile
- I am not sure how difficult it would be, but one benefit of it would be the ability to load a project in IDEs like CLion that are able to work with CMakefile,
- Some apps (like python2x/python3x) pull most of the binaries from host instead of re-compiling from scratch. It would be nice to have a shared app/tool to build apps from host like that.
Feel free to add any other things you would like to be improved in the build system.Waldek
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
n Sun, Mar 31, 2019 at 5:58 PM Waldek Kozaczuk <jwkoz...@gmail.com> wrote:Here is a list of things we should try to do:I think there are two very different issues involved here, that don't really need the same solution:The OSv kernel's makefile, and the "apps" build system.
- Propose and define model app layout (Makefile, GET, ...) under osv-apps
- Typically each app has GET shell script, Makefile and module.py:
- GET typically downloads ad puts source files into upstream directory (sometimes using latest script)
- Makefile typically does what needs to be done (sometime compiles) and puts source files into install subdirectory (sometimes usr.manifest is generated, sometime usr.manifest is pre-defined).
- module.py is called to execute extra logic - sometimes to generate usr.manifest, define cmdline and possibly multiple flavors
- This is somewhat documented in the README.md of osv-apps project but is not clear enough and the apps are all over the place following this loose convention and I am myself guilty of not following it (see python2x/3x apps that do too much in GET). I doubt it is worth fixing existing apps but I think we could improve the documentation in this area and and possibly point to a good model app.
I agree. Also, note that both the "GET" and "makefile" there are rather arbitrary conventions -
all we need from the Makefile is to have the "make" and "make clean" target. That's it. Because peoplewere too lazy to write a proper makefile around this requirement, "make" just calls "GET" which is ashell script that just does everything.We could easily have any other convention to build and clean a package.
I think the more difficult part is understand what the heck is module.py and what is usr.manifest, etc.
I think you're right that just documenting the conventions we used will go a long way in helping people to use this system, even if we don't change anything.
- I know our build system (scripts/build and related python scripts) is complicated enough. But it would be super nice to allow passing parameters from scripts/build to app Makefile. The best use case for that is building java9 (10,11,12 as well) JREs using jlink where it would be nice to pass a list of JRE modules to incorporate - see https://github.com/cloudius-systems/osv-apps/blob/master/openjdk9-zulu-java-base/Makefile#L26; I think there are many other apps that would benefit
Possibly. Indeed if properly documented, it shouldn't matter that it's even more complicated.
- Eliminate external - https://github.com/cloudius-systems/osv/issues/743
- It would be nice to detail what to do to each subdirectory (I am not positive we want to eliminate all - see x64/acpica)
I agree. We should do that. "external" is an idea that really outlived its usefulness, I think.Indeed we don't need to remove everything at once, we can do it piece by piece (and stop using pieces before actually removing them).
- Convert to CMakefile
- I am not sure how difficult it would be, but one benefit of it would be the ability to load a project in IDEs like CLion that are able to work with CMakefile,
I would hate for this to happen. I really think OSv's makefile is well tuned and works well.Switching to cmake just to make an editor happy would be very sad.I don't know anything about clion, but is it possible to tell it OSv's include paths, etc., *without* switching the Makefile language?E.g., could we have "make clion" which automatically generates a file CMakeLists.txt which somehow includes the right incantations to tell CLIon what are OSv's include path and predefined macros needed to have the source files properly formatted?
The file doesn't need to contain real instructions on how to compile anything, I hope...
- Some apps (like python2x/python3x) pull most of the binaries from host instead of re-compiling from scratch. It would be nice to have a shared app/tool to build apps from host like that.
I agree. It would really be nice to have scripts or python code for module.py or something, of how to copy a bunch of files from the host and possibly the shared libraries they need, etc., and then just use this same script from various apps instead of repeating the same code (with variations nobody understands) in a dozen apps.
Feel free to add any other things you would like to be improved in the build system.Waldek
In the next couple of weeks I will be trying to work on some of those issues. I think that eliminating external and fixing "openssl 1.0" issue are probably most pressing ones. I feel like we have gotten to the point where are some of these issues start hindering the development of the project.
Does anybody have suggestion in what sequence we should be proceeding? For example even though archaic openssl causes headache, is it actually necessary to build kernel or run unit tests?
Should it be actually required in setup.py?Also recently I commited manifest_from_host.sh (https://github.com/cloudius-systems/osv/blob/master/scripts/manifest_from_host.sh) script that I think can be helpful in this exercise to eliminate build from scratch in some of the modules by pulling artifacts from the host.
On Mon, May 20, 2019 at 6:48 PM Waldek Kozaczuk <jwkoz...@gmail.com> wrote:In the next couple of weeks I will be trying to work on some of those issues. I think that eliminating external and fixing "openssl 1.0" issue are probably most pressing ones. I feel like we have gotten to the point where are some of these issues start hindering the development of the project.The openssl 1.0 issue is definitely annoying for me, but to be honest, it only hurts the default module, using Lua. If you never use that, you don't even notice it.
The "external" thing is also a nusence, but we already got rid of most of it in the past, we just need to get rid of more, and actually remove some of the "external" options from the Makefile and whole directories from the "external" repository.
Doing this properly for aarch64 cross-compilation will be more of a challenge. I suggested some options in the issue (namely, fetch some libraries as needed from Fedora or similar place - not from OSv's "external" repository).
Does anybody have suggestion in what sequence we should be proceeding? For example even though archaic openssl causes headache, is it actually necessary to build kernel or run unit tests?No, it is not. It is only needed for the default "scripts/build" without parameters, which builds Lua which needs it.But it looks bad that our default "scripts/build" doesn't work. We could also fix it by changing the default ;-) But the lua shell is a sensible default.
Should it be actually required in setup.py?Also recently I commited manifest_from_host.sh (https://github.com/cloudius-systems/osv/blob/master/scripts/manifest_from_host.sh) script that I think can be helpful in this exercise to eliminate build from scratch in some of the modules by pulling artifacts from the host.Indeed.We can even start by having in apps/ two versions for some of the packages - one (the existing one) which compiles from source, and another one which just picks up the files already installed on the build machine.There's also a third option, similar to what we did in openjdk8-fedora: fetch pre-compiled packages from some common Linux distributions (e.g., Fedora or Ubuntu) and use the files from it for the image. Regardless of what is installed on the build machine. It would be nice to work on common scripts (like you started to manifest_from_host.sh) so new apps can be added to apps/ easily e.g., by just calling a script and a list of Fedora or Ubuntu packages, and the script does everything (fetching those packages, etc.). I opened https://github.com/cloudius-systems/osv/issues/1041