-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[WIP] Use JLLs to provide standard library binaries #35193
Conversation
This PR is still in a rough state, but I'm working on eliminating unnecessary changes, coalescing commits, etc... I'm at the point where I need to test it on CI though, so bear with me in the short term. :) |
f6add51
to
9b50f2c
Compare
I ran into something of a roadblock recently; the "rewrite DLL import names as relative" approach doesn't work, because the names must all be implicitly relative to the executable. This wrecks any other executable being able to use them, so it's a bit of a showstopper for us. This means that really, the only way to get this to work is to rely on more traditional means of the main I started with creating a I briefly looked into creating a "wrapper" An even simpler solution is create a launcher Looking at |
To clarify, this issue with relative loading is Windows-only or everywhere? |
Also, statically linking |
Update; using static libgcc and a delay-loaded DLL for |
f6bf659
to
02b36be
Compare
104afe3
to
29feef7
Compare
Just some random things I noticed while trying out this branch, putting them here for posterity:
|
13a2c93
to
d8c4cfc
Compare
This PR is now getting pretty close to ready to go. To address Kristoffer's comments:
|
With the I can't reproduce the |
Alright, with my latest push of updated checksums, this is officially ready to be reviewed! Huzzah! I would like to ask for a couple different people's help on this;
Of course this might not work completely, but I figure you guys may have some comments about this. :). One downside is that we now do a
|
Unfortunately no, #34627 is still present on this branch. It also seems this breaks the non-BB build as well; with
|
71a7fe2
to
f5360b9
Compare
I'm also concerned about this, because we also know from past experience that this design causes performance problems. We know it because we've done significant work in the past to delete these types of Now that you've got a roadmap going here, can you make this into many smaller PRs? 18 commits is just too much for one PR, some of which independently may bring in significant risk and may need careful thought for any unintended interactions (such as adding |
f8dd10e
to
cb84f0c
Compare
I started the build prior to the most recent commit here, but the build completed successfully. I'm running tests and so far so good but this system is a bit slow, so it'll be a while. |
In order to bundle JLL packages (and their respective binary artifacts) alongside Julia distributions, we alter the build process to first download JLL packages, then parse the `Artifacts.toml` file and generate Makefile targets to download and unpack those artifacts into the stdlib depot. This makes heavy use of the Makefile caching infrastructure, as the TOML parsing must happen after the TOML files have been downloaded.
… backends We rework LinearAlgebra a bit here, allowing runtime switching of BLAS/LAPACK backends through the `set_blas_lapack_lib(blas, lapack)` function. Note that you cannot load an ILP64 BLAS into a non-ILP64 Julia, and vice-versa; such constants are defined at compile-time.
This cleanup eliminates many of the old code paths involved in loading the correct compiler support libraries (such as `libgcc_s`) by working it into the JLL stdlib framework. Additionally, it eliminates many FreeBSD-specific code paths, as all platforms now collect the CSLs before build.
dfed4ae
to
f8ff854
Compare
Are there aspects of this PR remaining beyond what we recently merged? |
Yes; what has been merged into 1.6 is a large chunk of the work, but there's more that needs to be merged, such as installing the binaries not into |
Any updates on this PR? |
I assume this is out-of-date |
This migrates almost all binary dependencies that ship with Julia to be accessible through JLL packages, with their binary dependencies stored in artifacts. This provides a uniform, Pkg-aware method of interfacing with the binaries that Julia ships with, however it comes with its own set of challenges, requiring a very high-surface area pull request:
JLL packages (the Julia source code that that provides the client interface for the binary artifacts) are now downloaded as part of Makefile targets within
deps/
, and installed intousr/share/julia/stdlib
. This requires some mildly intricate Makefile shenanigans, as we first determine which JLL packages to download, then parse the bundledArtifacts.toml
files in order to determine which artifacts to download and extract. Doing so with high performance was a small challenge, but while the Makefile parsing is slower now than it was before, it's not painful so I'm satisfied that my performance work is sufficient.Binaries can either be downloaded from Yggdrasil output, or can be built locally. In the latter case, we must still provide the same binary interface to the binaries, despite their separate provenance. To handle this, we generate bare-bones JLL packages for these homebrewed binaries. To a client Julia package, the
libLLVM_jll
that it would import in order to makeccall()
's intolibLLVM.so
will look more or less identical whether thelibLLVM
was compiled locally or not; the tree hashes won't match, but that's fine (And actually a nice indicator in case something goes horribly wrong).JLL packages themselves depend on things in
Base
andPkg
that may not be loaded by the time we need to use the JLL. To fix this, the JLL packages shipped in the standard library get "rewritten", eliminating as much dependence onPkg
andBase
as possible. The main difference in functionality being that the system triplet (e.g.x86_64-linux-gnu-libgfortran4-cxx11
) gets baked into the JLL packages, meaning that the triplet cannot change without Julia being rebuilt. This is a fine limitation for now.Because
__init__()
methods don't get called by default during bootstrap, there are a number of manual__init__()
calls scattered around the PR, such that libraries are opened and available for inspection during the init process.Libdl
is too useful to leave for the stdlib, so it gets moved toBase
.