isle icon indicating copy to clipboard operation
isle copied to clipboard

build improvements

Open dtomvan opened this issue 8 months ago • 3 comments

This PR improves the build system in various ways, mostly related to the Docker build (on linux).

It improves build times by leveraging ninja's parallel builds. This of course could also be used when ninja is installed on a Windows machine, but I'm not sure how to document that properly.

Times are on an AMD Ryzen 5 2600 (12) @ 3.40 GHz.

Before this PR, with NMake:

real    3m1.153s
user    0m0.501s
sys     0m0.848s

After, with JOBS=12:

real    1m14.885s
user    0m0.603s
sys     0m0.737s

This PR also introduces the build.sh convenience script for Linux, which:

  • Copies the source to a temporary directory
  • Finds either podman or docker
  • Builds the OCI image
  • Mounts the temporary source under /isle
  • Sets the amount of parallel build jobs to nproc by default
  • Mounts /build as a tmpfs so it also gets wiped after the build
  • Outputs artifacts (and only the artifacts to ./result)

This makes it much simpler to build than having to manually set this up as documented in the README every time, especially if you want the build to be isolated.

Future improvement could be to document how to use ninja on Windows with this project or even write a PowerShell script for it.

dtomvan avatar May 12 '25 20:05 dtomvan

This newest commit reduces the image size (and image build times) by quite a bit: 4.23GB -> 3.16GB. Could be even better if alpine supported wine32, but they don't, at least not OOTB. Also figured out why the registry wasn't setting correctly, see https://serverfault.com/a/1090483

I went back to docker as default OCI engine, because it still just has the superior build process.

dtomvan avatar May 15 '25 16:05 dtomvan

To be fair, if I switch back to NMake, I can get an image size of 1.7GB as wine64 will then not be needed anymore. I think that's worth it, we might even find a way to get Ninja to compile for wine32, but we'd need to probably get a different MSVC... But that would give both the speed and the not-being-huge-ness...

dtomvan avatar May 15 '25 16:05 dtomvan

Another reduction, with USE_NIX_BUILD=1, I got the size to 1.15GB with ninja (due to WoW64 being needed), and without Ninja all the way to 741MB!!! I know I'm pushing Nix a little too hard here, but the actual code at hand is not that difficult, it's way more minimal and usable, and it works just fine.

dtomvan avatar May 16 '25 19:05 dtomvan

Thank you for this effort, but I think we won't add this to the repo for now.

foxtacles avatar Jun 12 '25 00:06 foxtacles

Hahah fair I went a little too far with it.

dtomvan avatar Jun 12 '25 10:06 dtomvan