-
Notifications
You must be signed in to change notification settings - Fork 34
use julia_version
Pkg.add
kwarg rather than specifying it through ctx
#416
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
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
25ff309
use julia_version kwarg rather than ctx
IanButterworth 7c0f926
disable auto-precompilation on Pkg.add
IanButterworth a7e606a
add __version fix
IanButterworth 058f5cd
fix tests
IanButterworth add7d59
fix test_throws
IanButterworth 2511b60
Update dependencies.jl
IanButterworth 7a7c37e
narrow test to julia_version=nothing
IanButterworth f0887d4
handle different error types
IanButterworth 39245a7
unbroken fixed test
IanButterworth 3a5f7d2
directly test setup_dependencies
IanButterworth f26360b
dial in the tests
IanButterworth 066ecdb
run on nightly
IanButterworth fe7114a
fix code mistake
IanButterworth 10672f1
update for new Zstd_jll path in v1.13
IanButterworth d821b65
set version in get_addable_spec
IanButterworth 8a94248
revert with comment
IanButterworth 713696c
fix no version check
IanButterworth 176876d
add a load of debugs
IanButterworth 01a089f
add 1.12-nightly to CI
IanButterworth 70809ba
update version check given backport
IanButterworth 5b3e58f
fixes
IanButterworth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,8 +332,10 @@ function setup(source::SetupSource{ArchiveSource}, targetdir, verbose; tar_flags | |
libpath = vcat(XZ_jll.LIBPATH_list, libpath) | ||
end | ||
if Zstd_jll.is_available() | ||
path = vcat(dirname(Zstd_jll.zstd_path), path) | ||
libpath = vcat(XZ_jll.LIBPATH_list, libpath) | ||
# Zstd_jll became a stdlib in Julia v1.13.0 and the path variable changed name | ||
zpath = isdefined(Zstd_jll, :libzstd_path) ? Zstd_jll.libzstd_path : Zstd_jll.zstd_path | ||
path = vcat(dirname(zpath), path) | ||
libpath = vcat(Zstd_jll.LIBPATH_list, libpath) | ||
end | ||
unique!(filter!(!isempty, path)) | ||
unique!(filter!(!isempty, libpath)) | ||
|
@@ -608,22 +610,27 @@ function get_addable_spec(name::AbstractString, version::VersionNumber; | |
return Pkg.Types.PackageSpec( | ||
name=name, | ||
uuid=uuid, | ||
#version=version, | ||
# version=version, # cannot set this because build_tarballs will complain | ||
tree_hash=tree_hash_sha1, | ||
repo=Pkg.Types.GitRepo(rev=git_commit_sha, source=valid_url), | ||
rev=git_commit_sha, | ||
url=valid_url, | ||
IanButterworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
end | ||
|
||
# Helper function to install packages also in Julia v1.8 | ||
function Pkg_add(args...; kwargs...) | ||
@static if VERSION < v"1.8.0" | ||
Pkg.add(args...; kwargs...) | ||
else | ||
try | ||
Pkg.respect_sysimage_versions(false) | ||
# we don't want to precompile packages during installation | ||
# auto-precompilation also calls `Pkg.instantiate` which will warn about non-VERSION `julia_version` values | ||
withenv("JULIA_PKG_PRECOMPILE_AUTO" => "false") do | ||
@static if VERSION < v"1.8.0" | ||
Pkg.add(args...; kwargs...) | ||
finally | ||
Pkg.respect_sysimage_versions(true) | ||
else | ||
try | ||
Pkg.respect_sysimage_versions(false) | ||
Pkg.add(args...; kwargs...) | ||
finally | ||
Pkg.respect_sysimage_versions(true) | ||
end | ||
end | ||
end | ||
end | ||
|
@@ -662,7 +669,7 @@ function setup_dependencies(prefix::Prefix, | |
# We occasionally generate "illegal" package specs, where we provide both version and tree hash. | ||
# we trust the treehash over the version, so drop the version for any that exists here: | ||
function filter_redundant_version(p::PkgSpec) | ||
if p.version !== nothing && p.tree_hash !== nothing | ||
if p.version != PKG_VERSIONS.VersionSpec("*") && p.tree_hash !== nothing | ||
return Pkg.Types.PackageSpec(;name=p.name, tree_hash=p.tree_hash, repo=p.repo) | ||
end | ||
Comment on lines
-665
to
742
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was wrong, it's not
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a regression test mentioning BBB in Pkg JuliaLang/Pkg.jl#4332 |
||
return p | ||
|
@@ -682,18 +689,16 @@ function setup_dependencies(prefix::Prefix, | |
deps_project = joinpath(prefix, triplet(platform), ".project") | ||
Pkg.activate(deps_project) do | ||
# Update registry first, in case the jll packages we're looking for have just been registered/updated | ||
ctx = Pkg.Types.Context(;julia_version) | ||
outs = verbose ? stdout : devnull | ||
update_registry(outs) | ||
|
||
# Add all dependencies. Note: Pkg.add(ctx, deps) modifies in-place `deps` without | ||
# notice. We need to `deepcopy` the argument to prevent it from modying our | ||
# dependencies from under our feet: <https://github.com/JuliaLang/Pkg.jl/issues/3112>. | ||
Pkg_add(ctx, deepcopy(dependencies); platform=platform, io=outs) | ||
# Add all dependencies. | ||
Pkg_add(dependencies; platform=platform, io=outs, julia_version=julia_version) | ||
|
||
# Ony Julia v1.6, `Pkg.add()` doesn't mutate `dependencies`, so we can't use the `UUID` | ||
# that was found during resolution there. Instead, we'll make use of `ctx.env` to figure | ||
# out the UUIDs of all our packages. | ||
ctx = Pkg.Types.Context() | ||
dependency_uuids = Set([uuid for (uuid, pkg) in ctx.env.manifest if pkg.name ∈ dependencies_names]) | ||
|
||
# Some JLLs are also standard libraries that may be present in the manifest because | ||
|
@@ -731,7 +736,8 @@ function setup_dependencies(prefix::Prefix, | |
|
||
# Re-install stdlib dependencies, but this time with `julia_version = nothing` | ||
if !isempty(stdlib_pkgspecs) | ||
Pkg_add(ctx, stdlib_pkgspecs; io=outs, julia_version=nothing) | ||
# TODO: shouldn't this take platform? | ||
Pkg_add(stdlib_pkgspecs; io=outs, julia_version=nothing) | ||
end | ||
|
||
# Load their Artifacts.toml files | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sigh. But also, this doesn't look right: the library and the executable are in two different directories.
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 others following along: JuliaLang/julia#59198
Just need to wait for nightly to be 1a1270d977ba8aab7fcefe0d652f493bcc3dc44e
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.
Done