Skip to content

Commit

Permalink
Require Julia v1.7 (#129)
Browse files Browse the repository at this point in the history
* [CI] Add a job running with Julia nightly

* Adapt some Pkg function calls for nightly

* More `VesionSpec` fixes

* Upgrade `collect_jlls()` to handle Manifest format v2.0

* Properly download stdlibs on later versions of Julia

We use some new tricks to properly identify and download the correct
version of a stdlib JLL, dodging resolution where we need to.

* Patch for Julia v1.6

* Run tests with Julia v1.7 as well

* Work around Pkg bug, make it work in v1.7

* Require Julia v1.7

* Cleanup Pkg internals nightmare, add `get_addable_spec()`

This cleans up our `Pkg` usage a bit, reducing the likelihood that
changes in the future will break us, and allows us to use `Pkg.add()` to
get stdlibs.

* Add test for `get_addable_spec`

Co-authored-by: Elliot Saba <[email protected]>
  • Loading branch information
giordano and staticfloat authored Jan 15, 2022
1 parent 9db5309 commit 74fd093
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 92 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ jobs:
# Add a job that uses the privileged builder with squashfs shards
- runner: privileged
squashfs: true
julia-version: "1.6"
julia-version: "1.7"

- runner: privileged
squashfs: true
julia-version: "nightly"

# Add a job that uses the unprivileged builder with unpacked shards
- runner: unprivileged
squashfs: false
julia-version: "1.6"
julia-version: "1.7"

# Add a job that uses the docker builder with unpacked shards
- runner: docker
squashfs: false
julia-version: "1.6"
julia-version: "1.7"

steps:
- run: sudo rm -rf /opt/*
Expand Down Expand Up @@ -65,7 +69,7 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: "1.6"
version: "1.7"
- name: Cache artifacts
uses: actions/cache@v2
env:
Expand Down
8 changes: 6 additions & 2 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[LibGit2_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"

[[LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
Expand Down Expand Up @@ -89,7 +93,7 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.0.15"

[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs"]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
Expand All @@ -101,7 +105,7 @@ deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
deps = ["SHA", "Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
Expand Down
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <[email protected]>"]
version = "1.3.0"
version = "1.4.0"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
LibGit2_jll = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
OutputCollectors = "6c11c7d4-943b-4e2b-80de-f2cfc2930a8c"
Expand All @@ -30,7 +31,7 @@ OutputCollectors = "0.1"
Scratch = "1.0"
SimpleBufferStream = "1"
Tar = "1.7"
julia = "~1.6"
julia = "1.7"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
18 changes: 9 additions & 9 deletions src/Dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function getpkg(d::Dependency)
pkg = d.pkg
if d.build_version !== nothing
pkg = deepcopy(pkg)
pkg.version = Pkg.Types.VersionSpec(d.build_version)
pkg.version = PKG_VERSIONS.VersionSpec(d.build_version)
end
return pkg
end
Expand All @@ -183,7 +183,7 @@ filter_platforms(deps::AbstractVector{<:AbstractDependency}, p::AbstractPlatform
# Wrapper around `Pkg.Types.registry_resolve!` which keeps the type of the
# dependencies. TODO: improve this
function registry_resolve!(ctx, dependencies::Vector{<:AbstractDependency})
resolved_dependencies = Pkg.Types.registry_resolve!(ctx, getpkg.(dependencies))
resolved_dependencies = Pkg.Types.registry_resolve!(ctx.registries, getpkg.(dependencies))
for idx in eachindex(dependencies)
dependencies[idx] = typeof(dependencies[idx])(resolved_dependencies[idx]; platforms=dependencies[idx].platforms)
end
Expand All @@ -192,11 +192,11 @@ end

# We only want to update the registry once per run
registry_updated = false
function update_registry(ctx = Pkg.Types.Context(), outs = stdout)
function update_registry(outs = stdout)
global registry_updated
if !registry_updated
Pkg.Registry.update(ctx,
[Pkg.Types.RegistrySpec(uuid = "23338594-aafe-5451-b93e-139f81909106")];
Pkg.Registry.update(
[Pkg.RegistrySpec(uuid = "23338594-aafe-5451-b93e-139f81909106")];
io=outs,
)
registry_updated = true
Expand All @@ -218,7 +218,7 @@ function resolve_jlls(dependencies::Vector; ctx = Pkg.Types.Context(), outs=stdo
end

# Resolve, returning the newly-resolved dependencies
update_registry(ctx, outs)
update_registry(outs)
dependencies = registry_resolve!(ctx, dependencies)

# But first, check to see if anything failed to resolve, and warn about it:
Expand All @@ -242,7 +242,7 @@ major(v::Pkg.Types.VersionBound) = v.t[1]
minor(v::Pkg.Types.VersionBound) = v.t[2]
patch(v::Pkg.Types.VersionBound) = v.t[3]
__version(v::VersionNumber) = v
__version(v::Pkg.Types.VersionSpec) = v.ranges[1].lower
__version(v::PKG_VERSIONS.VersionSpec) = v.ranges[1].lower
version(d::AbstractDependency) = __version(getpkg(d).version)
version(d::Dependency) = __version(d.pkg.version)

Expand All @@ -269,8 +269,8 @@ function dependencify(d::Dict)
if d["type"] in ("dependency", "builddependency", "hostdependency")
uuid = isnothing(d["uuid"]) ? d["uuid"] : UUID(d["uuid"])
compat = d["compat"]
version = VersionNumber(d["version-major"], d["version-minor"], d["version-patch"])
version = version == v"0" ? nothing : version
version = PKG_VERSIONS.VersionSpec(VersionNumber(d["version-major"], d["version-minor"], d["version-patch"]))
version = version == PKG_VERSIONS.VersionSpec(v"0") ? PKG_VERSIONS.VersionSpec() : version
spec = PackageSpec(; name = d["name"], uuid = uuid, version = version)
platforms = parse_platform.(d["platforms"])
if d["type"] == "dependency"
Expand Down
Loading

2 comments on commit 74fd093

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/52470

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.0 -m "<description of version>" 74fd093d3ab33f9410a64cd42b28662654a014fe
git push origin v1.4.0

Please sign in to comment.