-
Notifications
You must be signed in to change notification settings - Fork 617
[OCaml] Add (cross-)compiler shards #11146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0_RootFS/OCaml/build_tarballs.jl
Outdated
compiler_target = try | ||
parse(Platform, ARGS[end]) | ||
catch | ||
error("This is not a typical build_tarballs.jl! Must provide exactly one platform as the last argument!") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to go the GCC route and use the compiler target as the "target" for the build
(even though the toolchain we use during the build is the host toolchain for the most part, we do need both)
2a8a536
to
f9e5b2f
Compare
I noticed during this process that I also need to declare a runtime dependency on I don't know whether that's necessary for these shards, since that dependency should be handled pretty much automatically (unless someone specifically excludes the |
f9e5b2f
to
cb8db63
Compare
I think I have most of the bones in-place here @giordano should I start generating + uploading these shards, or is there something else to do first? |
Uhm, no, I think building and publishing the shards should be good now. |
Hm, I'm surprised CI doesn't work here. Does it maybe not use the manifest from the PR, but instead the one from master? |
There's a merge conflict in the Manifest, unfortunately the buildkite plugin ignores conflicts and moves on, instead of erroring out (been there already...). |
While working on this, I realized we not only need a host-native OCaml compiler during generating of target compiler shards (to bootstrap OCaml), but often also during JLL generation in order to bootstrap projects that rely on executing OCaml binaries during their build process. So I'm currently distributing that as part of @giordano I was wondering if it would be feasible to have OCaml recipes rely on both a host-native and cross-compiler shard, with the former "activated" by default (wrappers being generated for and env vars pointing to). I guess we do something similar already to provide both EDIT: Actually, the Rootfs logic in BinaryBuilderBase looks pretty straightforward. I'll try to add the logic there. |
If I understood correctly what you're suggesting, that's pretty much it, yes.
🚀 |
Should compiler shards be built for |
That's a good question. In https://github.com/JuliaPackaging/BinaryBuilderBase.jl/blob/c25f6edc4be8c610d830468fe1154dfd6281d582/Artifacts.toml I see both shards with the OS version (for the C toolchains) and without (for the Rust toolchain). |
The problem is that even when building the shard for
EDIT: ah, I still had a |
Okay, this finally seems to be working. I uploaded compiler shards for all supported platforms, and verified that I can build Heptagon using them. |
0_RootFS/OCaml@5.3/bundled/patches/0006-Guard-_WIN32_WINNT-definition.patch
Show resolved
Hide resolved
Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
I'm sure there's plenty that needs fixing here, but the main build is working at least. I also had to move to a pre-release of v5.4.0 since OCaml's cross-compiler support was only recently shored up in Dec 2024 (great timing for us!)
companion PR's: JuliaPackaging/BinaryBuilderBase.jl#425 and JuliaPackaging/BinaryBuilder.jl#1382