-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Too many old Julia versions, 1.5 is not packaged, and all versions fail in tests #91930
Comments
Also, now I noticed |
I agree. And the 1.5 release candidates are out, so this will become the latest version in the near future. Last time I looked, the package built the same deps for all versions, including 0.7. In versions 1.0 and later, there are actually fewer dependencies (e.g. arpack and fftw have been dropped), so the package should be cleaned up to not include these unnecessary libraries in the build. I also think the default version should be the latest version (i.e., unless somebody explicitly installs julia-1-lts, they should get the latest). |
OK I'm glad I have your support. I'll let this issue stay open for a while and hopefully I'll be able to take care of this a month or so from now. |
cc @7c6f434c |
Back when Julia tests were not so messed up, I think there was often 1 previous version. I guess with 1.3 needing overriding to no tests, it is fine to just have julia-1-lts and Julia 1.4 as julia once Julia 1.4 gets built fine with some tests. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-can-we-build-a-julia-derivation-with-tests-disabled/8052/2 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-can-we-build-a-julia-derivation-with-tests-disabled/8052/3 |
Haven't had a lot of time to work on julia in nixpkgs, so just posting this as a FYI. We used multiple versions of julia at work, but we use a custom derivation, similar to this: https://gist.github.com/rbvermaa/08f916a63ba4f3f6123f97478309dfa0 We also do not run the tests, but in general it has been working great. Previously we also used the binary builds patched with patchelf, as there were some differences in the structure of the results of the vanilla binary build provided by julia and what we got when building from source. We gave up on using 'system' libraries, and build the |
@rbvermaa I tried to use that It fails with:
Naturally I didn't further attempt to add curl or wget to the inputs, as that would fail in a sandbox as well. I've opened an issue upstream: JuliaLang/julia#36604 complaining that that |
@doronbehar I ran with sandbox enabled, and the expression I linked with works for me. So I think it is fine to just add curl to the deps, as with the full tarball, it isn't actually used. |
There is another approach to avoid running tests: using precompiled binary. I tried downloading the 1.4.2 binary from https://julialang.org/downloads/ and then afterward ran |
We did the same for a while using code similar to this:
Unfortunately, we actually sometimes need to patch Julia, so we switched to the julia expressions from source, that I posted earlier. |
Thanks @rbvermaa that expression works well thanks to |
OK so after a long build, I got a working Julia derivation with these references:
And this closure size:
Which I must say it is satisfying. The question is, is this how we'd want it to be built? Using all of their dependencies and practically non of ours? Some of their dependencies are required to be patched, according to their docs and they also specify that using the OS' libraries is not officially supported? Anyway I'd happy to get help on deciding this. |
@doronbehar does this lead to Julia tests passing? I think for every dependency they patch, it is OK to just use their patched version. I guess it could be nice to use a separate build unpatched (but using the exact same version sounds like a likely restriction), but whatever dependency does not work right away can be switched to bundled. |
I think it did, I've set Currently the expression at my branch produces this log but there's no PR yet as I think there are many makeFlags that should probably be set as well. If anyone feels confident to open a PR with this feel free to ping me for a review.
I agree with the idea, but what's bothering me is that it's not absolutely clear what versions are patched and which are not - the docs vs what's actually found in their patches directory is not totally inline. Also, it seems that some of the patches are old, and were suggested upstream (to the libraries) but they weren't merged there for some reason. I'm still investigating, See JuliaLang/julia#31215 (comment) My current target is to decide what libraries to use our version vs their version, with the preference to use our version, in order to hopefully reduce closure size due to sharing shared libraries. The idea is to decide this by checking whether the libraries have included the patch Julia suggests, and then whether the library's maintainer has released a new version that includes Julia's maintainers' patch, and whether we ship that new version. |
> @doronbehar does this lead to Julia tests passing?
I think it did, I've set `doCheck = true;` and the build passed but I haven't inspected the log much, but here it is:
https://gist.github.com/f11b21fb53984d481d5d5480ec0dc179
I think this log is cut short before the interesting part…
|
I've uploaded it here: |
Hmmm. Reading the log does not convince me the tests were run… Pity. |
Since 1.5 was just released, the title should probably be updated to be 1.5. |
Downside with the patching approach, is users lose the ability to compile against MKL, which has HUGE performance increase (last benchmark I saw showed that MKL was ~4x faster at matrix multiplication!!). Would need to also package JuliaPro to get MKL. Of course, anything working > nothing working, although would be a shame to lose compilation options. |
Says https://github.com/JuliaLang/julia/blob/master/doc/build/build.md:
|
Thanks garrison, I saw that, but I have a feeling it won't play nicely with Nix...although if we go patching route, perhaps could do that during buildPhase |
I see. You are talking about "authors" of Nixpkgs' expressions? I'm still a bit perplexed, as I earlier said, and correct me if I'm wrong:
I agree (maybe a bit related). Generally I think, every dep's version related issue should be handled by someone like you, who's familiar with python packages you use. I'd at least (open PRs) to fix the issues I encounter :).
I see. I guess the situation is more complex than I thought, but I don't think I'd be able to form a strong opinion until I'll get a Julia interpreter from an expression I'm satisfied with.
Thanks for the link :). |
Unfortunately, this pattern is done constantly (including in my own contributions!). The problem is that, except an extremely rare cases like tensorflow, nixpkgs does not allow multiple versions of same python package to co-exist. Every time we update a package, we remove the previous version from nixpkgs. Confounding this issue, we often disable tests because sometimes the effort is just too high when developers bake in assumptions that aren’t compatible with the Nix ethos (for some reason this seems to happen more with tests then source code...). The most frequent cause of failure is the code needs to download something to run the test. (I’ve tried to lobby in the past that the test phase should be permitted to have Internet access as long as it doesn’t modify /nix/store, but I digress). In any case, the end result is that using a python package on Nix typically means you aren’t using the exact dependencies that upstream declared, and you’re more likely to have a package that despite having changes in dependencies has never had the test run. Thus, amazingly, I’ve had more luck with Julia packages working on NixOS than Python when all other binaries are present in environment. |
@tbenst I don't think there's a strong policy in our Python ecosystem against multiple versions of packages - if this is what upstream recommends. Anyway, the whole topic is out of scope for this issue. Feel free to open a new issue and cc me and |
Yes, sorry getting a little off topic here. I mainly mention it to suggest that our efforts in Julia that start from scratch Can learn from these issues. I’m not too familiar with the new binary builder, but BinDeps.jl was quite nice in that it would first search for libraries before attempting to install. See this issue for some context: JuliaPackaging/BinDeps.jl#115. Note that a core Julia dev gave a pretty great endorsement on Nix (albeit back in 2014): JuliaPackaging/BinDeps.jl#115 (comment). I think it might be most productive to do this development outside of nixpkgs, and do it in Julia to hook in with nixpkgs as needed. That way users could seamlessly use Pkg in Julia. I’d love to |
Short summary of the Discourse thread: for LLVM and libuv it is essential to use the patches/forks. For other packages it is probably unnecessary to use the exact version specified by upstream. |
TIL Guix manages to package Julia 1.4.1: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/julia.scm?id=master What's interesting, is that they I think we should try to copy this approach. |
FWIW I did that in Fedora originally, but I stopped. Since LLVM makes breaking releases very quickly, you'll probably want to move to a new version that Julia doesn't support quite soon. |
Maybe I don't understand, but why should I move to an LLVM version that julia doesn't support? Also, aren't the |
I don't really know how NixOS works, hence the "FWIW". If you used versioned LLVM packages and keep older major versions then it's probably OK. |
Just offering a user perspective: Julia provides a package manager that provides mostly reproducible (in a practical/scientific reproducibility sense rather than a bit-identical sense) environments easily from manifests. Increasingly, these environments are isolated from the host OS by binary packages for dependencies being served by Julia. I don't want Nix to manage dependencies that Julia/Pkg.jl can handle for me: Julia already handles those excellently and conveniently. I just want Nix to handle the (usually few) system dependencies. What I would like as a NixOS user is for Nix to provide me with a working Julia 1.5 derivation that provides: julia, a FHS wrapper or something providing compatible versions of the few things that Julia's binary packages need (just libc, libstdc++, libgfortran; I think. see BinaryBuilder.jl docs). When I say "compatible", I mean that these libraries should work with the BinaryBuilder.jl binaries and with the julia binary provided by Nix. Not all Julia packages are BinaryBuilder-ised yet, so I'd also want an easy way to specify that I want compatible versions of other packages installed (e.g. Qt, cairo, etc). For packages that need python, I don't know if I'd like Julia or Nix to handle installing and managing that. The simplest approach would be to tell Julia to do it (there is pretty good support in Julia for distributing isolated environments of python + packages + dependencies; better than in I don't know how doable any of that is in Nix, just describing what a good outcome would look like to me. |
@cmcaine I think this is quite doable. I would propose that we add a new package, |
@tbenst I think that is a good proposal and I think it will work with BinaryBuilder packages (e.g. SDL2_jll). In any case, some approach that works with BinaryBuilder packages should be found because those are a critical part of the Julia environment now :) Some important packages (e.g. GR) still want to build and install their own software dynamically, and that doesn't work well in Nix, but most of those can plausibly move to the BinaryBuilder system (PR for GR here), so I think letting those be broken would be tolerable (and a big improvement over the status quo of Julia on nix). Perhaps we can get something working quickly by just patchelf'ing the official Julia builds for now? (I don't understand how all of this stuff works!) |
Is there anything presently blocking just getting julia 1.5 into nixpkgs? I don't care about BinaryBuilder.jl/the Pkg.jl ecosystem working with nixpkgs, just a good ol' fashioned julia install. |
If you just want Julia and don't mind about binary packages breaking you
can just download Julia from the official site and patchelf it.
…On Sun, 4 Oct 2020, 09:32 Tyler Benster, ***@***.***> wrote:
@samuela <https://github.com/samuela> yes, see #98043
<#98043>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#91930 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNZA6MPOUOVG3V5VJJOSFDSJAXJRANCNFSM4ONJG3IA>
.
|
On the julia discourse there was also the idea floated to patch |
Guix has a Julia package and it works quite well. Perhaps some ideas can be borrowed from there: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/julia.scm It'd be really useful to get Julia working on Nix. It's the only big outstanding thing that doesn't work and prevents me from migrating some servers in my organization. |
I tried to copy their expressions in #98043 and it doesn't work yet, but there's also another seemingly working attempt by @cstich at #101933 . |
I guess some people like me still use julia_13 via test-disabling overrides, so a bit of time after 1.5 reaches channels for smooth transition could make sense? |
Maybe backport 1.5 to 20.09? |
OK so I disabled the tests for julia_13 in #104166 and made |
Julia 1.5 is out, see: https://docs.julialang.org/en/v1/NEWS/ and we don't have it packaged. More over, see how
all-packages.nix
defines our other Julias:nixpkgs/pkgs/top-level/all-packages.nix
Lines 8935 to 8956 in fdfa609
Several issues:
julia
is pointing to a TLS version which is old IMO. Certainly there are breaking changes seen in their NEWS pages, but since Nixpkgs is a somewhat rolling release distro, are we going to keep these older versions and default to them for ever? I've once tried to reach for the community to hear if there's a strict policy regarding such scenarios, but I think the answer is noAnyway, I'd like to propose a change that will keep only the LTS version and the latest - currently 1.4, and perhaps make the attribute
julia
, point to the latest.Any thoughts from maintainers or users?
cc @raskin @rob @garrison
The text was updated successfully, but these errors were encountered: