-
-
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
Make stdlibs use the artifact system #33973
Comments
@staticfloat, you seem like the prime candidate for this 😁 |
So here's the thinking that Stefan and I have briefly discussed: We should firm up some of the implicit laziness that the stdlibs have relied upon with respect to binary dependencies, and simultaneously use this as an opportunity to take a step towards decoupling stdlibs from the Julia build system both at build time and at run time. Properties we want
Implementation strategyTo represent stdlib binary dependencies through JLL packages and Artifacts, Stefan and I think the best way is to start shipping a read-only depot with Julia that gets added on to the default list of depots, that contains all of our stdlibs, their JLL packages, and their Artifacts. This would clean out the majority of the libraries from
Possible different strategies
|
Thinking more about things like Julia needing to be able to find libLLVM at dynamic-link time, it will be sufficient on non-windows platforms to bake in RPATHs to look in We also need a plan for dealing with from-source builds. Assuming that we still want from-source Julia builds to work, we're going to have to engage bandying about some benign falsehoods; when we build Some pros/cons of what I've considered so far:
|
Digging into this over the past few days, I've come up with a few difficulties that may take some calm thinking to untangle properly: First off, there's a philosophical decision to be made; do we want the actual binaries themselves to live in an Personally, I would like to push as much as possible for stdlibs and even the basic requirements for Julia (like LLVM, MPFR, GMP) to use artifacts. This is doable with enough scaffolding construction such that Julia can find things, but we need to answer if the necessary scaffolding is worthwhile:
Let's remind ourselves as to why we're doing this; with this kind of a system, it makes system image building much more modular and easy to understand; the distance between binaries users install and the binaries that ship with Julia shrinks. The resolver can see that LLVM_jll already exists on the user's machine and is of a particular version; attempts to I don't have a concrete solution in mind yet, this is the third time I've written out this comment because I keep on experimenting with different things and finding new problems. The good news is that I have artifact downloading implemented in Make/Python, and putting JLL packages/artifacts into the |
I would be fine with them living as artifacts. Making the system image more modular will allow to build smaller system images for deployment - so that's the right direction, imo. |
I've made great strides in this on my branch. I've converted everything that it makes sense to, excepting LLVM. LLVM is a special case that I will address after this. First, the changelog: Changelog
Splitting up LLVM_jllIt seems to me that we have an issue; we want to provide libLLVM alongside Julia in a JLL such that when users ask for a handle to libLLVM in a Pkg-informed way (e.g. through I think we should split |
Sounds good to me. The CUDA compiler really only needs libllvm, however, with the addition of some additional API calls from this source file. Maybe those should also be provided by the LibLLVM_jll? It's not entire clear to me though how we would version this thing (e.g., with multiple builds of the aforementioned tool, one for each LLVM version, and I just want to install whichever one's compatible with the user provided LLVM while maintaining semver of the tool), but that's orthogonal to this refactor. |
Won't the symbols in the file you linked be a part of |
Sure, but since they are essentially an extension of ilbllvm's C API it might make sense to put them there? |
Ah, I see what you mean; these aren't used by the rest of Julia, they're only for the benefit of Since we need to still support users building LLVM from source, I think we should probably keep it as a part of Julia's source. |
Regarding LLVM_jll the right approach is probably to follow what Linux distros have been doing and break it up into LLVM_jll (with |
My branch now works on Linux, MacOS support is pending a new OpenBLAS JLL (as MacOS is more sensitive to things like dylib IDs than Linux is), and then finally Windows. The great triumph is that a default build (e.g. with nothing setting any
|
Can the system image eventually be served as an artifact - so that I can then have many different system images for different projects? |
I think the piece that needs to be solved is getting Julia to load a project-specific sysimage. Right now you need to pass |
Well then we could even do optimized system images by architecture! |
We already do that; we have images by architecture (e.g. x86_64, i686, etc...) and then within an image, we compile functions multiple times such that newer processors have versions of functions with expanded instruction sets. |
Wouldn't it require various tools to agree on where to look at the system image? For example, you may want to use the same sysimage in your editor and in stand-alone scripts. Maybe the UI/API in Pkg.jl or PackageCompiler.jl can include something that creates a simple text file (say) |
The VS Code Julia extension has been shipping with exactly something like that for more than a year: https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/. |
@davidanthoff See #35794 that adds it to Julia. |
I don't think this is a release blocker for 1.6 so removing milestone. @staticfloat please put it back if you see fit. |
It isn't going to make it for 1.6 but will be in 1.7. |
Did this make into 1.7, and have we done sufficient work to close this? |
Sadly no, it did not. There is still some significant work to be done, but some smaller pieces have made it in. |
It would be nice if the stdlibs started using the artifact system to declare what libraries they depend on and how to get them for the different platforms. That would make the stdlibs easier to move out from the julia repo and in cases where one doesn't want to bundle all stdlibs in a sysimage (e.g. in an "app") it would be clear what libraries can be excluded from bundling as well.
The text was updated successfully, but these errors were encountered: