-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support augment_platform in JLLWrappers #35
Conversation
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.
For tests, I say let's add some once we have a package that uses this functionality, and then just add it to the test suite, like we did for OpenLibm_jll and Vulkan_Headers_jll.
9c65de5
to
1792e41
Compare
3e0c12f
to
a4fc3a3
Compare
@staticfloat The problem is that Pkg just picks "a" matching artifact irrespective of the tags (https://github.com/JuliaLang/julia/blob/dcaf356ff64fd3dc854d7732d1f60174b60c2795/stdlib/Artifacts/src/Artifacts.jl#L392)
Compare:
So CI fails since we don't instantiate the mpich variant. Of course Pkg has no idea about our platform tag. |
That's the whole reason we have the Pkg hooks, so that we can tell Pkg how to add platform tags to its internal operations, like it will within Can we scatter some debugging stuff to see precisely what platforms are being passed in? Try printing things out to |
This comment has been minimized.
This comment has been minimized.
0340ede
to
796e560
Compare
bda1997
to
a5c1e0e
Compare
The Drone CI failure is weird. I get the Alpine one since I didn't build LAMMPS for it, but aarch64 should be fine. |
Unless it's libgfortran3 😛 I don't think that's the case, but maybe double check by printing the host platform? |
deaf8d5
to
72f6a5f
Compare
I accidentally deleted one of the wrapper files xD. Exactly the one tested there. |
b940f92
to
6584bb0
Compare
On Julia 1.6.3 Without On GTK3_jll |
The majority of the allocations is stemming from eab77c9 causing us to fall into the non-static branch in https://github.com/JuliaLang/julia/blob/7be0dcdacdac28da56b9d607b1bc5f7b23ecb0e9/stdlib/Artifacts/src/Artifacts.jl#L674 |
After optimization with @giordano we are at:
|
That's pretty good; but I am still a little uncomfortable with us adding in extra dynamism to something that (usually) shouldn't have it. I had a big argument with Jameson about this, but erroring out when an artifact is not found (when the artifact is purportedly already installed) is a feature, not a bug. Part of it is to protect against the very situations that you bring up, e.g. running on a cluster and having 100 different nodes all try to install to the same depot at once. For this reason, there was a module-level separation of functionality established; Perhaps we can have our cake and eat it too; the As long as we use |
That is an excellent idea. This would mitigate it fully for 1.7, only problem is that despite what the docs in PR says the support for I agree that the dynamism is a major wart. I am less dogmatic about it since we already allow people to do many silly things. |
547b476
to
13c9ee5
Compare
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.
This looks good to me, especially on the performance side. I did some more testing loading GTK3_jll
, and its performance didn't change noticeably compared to master
. Memory usage slightly increased (less than 1%, as already shown by #35 (comment)), but that should be fine.
I guess you need to address Elliot's concerns though 🙂
e879525
to
276b072
Compare
d8b0cb0
to
dcabac8
Compare
# Use LazyArtifacts in this case. | ||
# Fixed in https://github.com/JuliaLang/Pkg.jl/pull/2920 | ||
|
||
push!(Base.LOAD_PATH, "@stdlib") |
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.
This should be okay right? Otherwise we can't load TOML
in all circumstances.
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.
Hmmm, in what circumstances does this not work? I didn't need to do this for https://github.com/JuliaLang/Pkg.jl/blob/master/test/test_packages/AugmentedPlatform/.pkg/select_artifacts.jl
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 thought TOML
was in Base
? https://github.com/JuliaLang/julia/blob/b9432a8067a5bff7c1286c8e64b0572d5bd7a22c/base/toml_parser.jl#L3
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.
That's only a parser; if you want to write TOML output (like we do here) you need to load the stdlib.
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.
Funnily enough the testsuite here.
If I comment this out (on 1.7.1):
Resolving package versions...
ERROR: LoadError: ArgumentError: Package TOML not found in current path:
- Run `import Pkg; Pkg.add("TOML")` to install the TOML package.
Stacktrace:
[1] require(into::Module, mod::Symbol)
@ Base ./loading.jl:967
[2] include(fname::String)
@ Base.MainInclude ./client.jl:451
[3] top-level scope
@ none:5
in expression starting at /home/vchuravy/src/JLLWrappers/test/LAMMPS_jll/.pkg/select_artifacts.jl:8
Stacktrace:
[1] pipeline_error
@ ./process.jl:531 [inlined]
[2] read(cmd::Cmd)
@ Base ./process.jl:418
[3] collect_artifacts(pkg_root::String; platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations /usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:587
[4] download_artifacts(env::Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::Base.TTY)
@ Pkg.Operations /usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:614
[5] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
Adding a println(stderr, Base.LOAD_PATH)
shows that the LOAD_PATH at that time is:
["@", "/tmp/jl_NEdS9m"]
which is also the same at the time of the Pkg.develop(PackageSpec(path=joinpath(@__DIR__, "LAMMPS_jll")))
call.
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.
An alternative to pushing @StdLib to the LOAD_PATH is to add TOML to the LAMMPS_jll dependencies and then
push!(Base.LOAD_PATH, dirname(@DIR)).
Yep, that's what Kristoffer and I were talking about, and what I was referring to when I said It's not too onerous to require all these packages to declare a dependency on TOML though. I think I could get behind that.
But while working on JuliaLang/Pkg.jl#2920 we run into issues were loading Preferences would fail in a fresh depot.
You shouldn't need to load Preferences
; you should be able to just use Base.get_preferences()
.
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.
Right, hypothetical world where we move TOML out of the stdlib we might encounter a similar problem.
Are we in agreement then, that we should add TOML as a dependency, and then push!(Base.LOAD_PATH, dirname(@__DIR__))
?
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.
Why does JuliaLang/Pkg.jl@9e770ea not suffice for loading TOML if it is listed as a dependency?
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.
Because we are setting --project=$(Base.active_project())
. Which is not the same as --project=LAMMPS_jll
.
We want to inherit preferences from the current user environment, but that does not need to have TOML declared.
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.
Right, right of course. Okay yeah. I'm happy with that push!(Base.LOAD_PATH, dirname(@__DIR__))
.
111189e
to
14c118c
Compare
@staticfloat any ideas for tests?