Skip to content

Commit 74fd093

Browse files
Require Julia v1.7 (#129)
* [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]>
1 parent 9db5309 commit 74fd093

12 files changed

+289
-92
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ jobs:
2626
# Add a job that uses the privileged builder with squashfs shards
2727
- runner: privileged
2828
squashfs: true
29-
julia-version: "1.6"
29+
julia-version: "1.7"
30+
31+
- runner: privileged
32+
squashfs: true
33+
julia-version: "nightly"
3034

3135
# Add a job that uses the unprivileged builder with unpacked shards
3236
- runner: unprivileged
3337
squashfs: false
34-
julia-version: "1.6"
38+
julia-version: "1.7"
3539

3640
# Add a job that uses the docker builder with unpacked shards
3741
- runner: docker
3842
squashfs: false
39-
julia-version: "1.6"
43+
julia-version: "1.7"
4044

4145
steps:
4246
- run: sudo rm -rf /opt/*
@@ -65,7 +69,7 @@ jobs:
6569
- uses: actions/checkout@v2
6670
- uses: julia-actions/setup-julia@latest
6771
with:
68-
version: "1.6"
72+
version: "1.7"
6973
- name: Cache artifacts
7074
uses: actions/cache@v2
7175
env:

Manifest.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
5050
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
5151
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
5252

53+
[[LibGit2_jll]]
54+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
55+
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
56+
5357
[[LibSSH2_jll]]
5458
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
5559
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
@@ -89,7 +93,7 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
8993
version = "1.0.15"
9094

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

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

103107
[[Random]]
104-
deps = ["Serialization"]
108+
deps = ["SHA", "Serialization"]
105109
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
106110

107111
[[SHA]]

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name = "BinaryBuilderBase"
22
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
33
authors = ["Elliot Saba <[email protected]>"]
4-
version = "1.3.0"
4+
version = "1.4.0"
55

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

3536
[extras]
3637
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/Dependencies.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function getpkg(d::Dependency)
164164
pkg = d.pkg
165165
if d.build_version !== nothing
166166
pkg = deepcopy(pkg)
167-
pkg.version = Pkg.Types.VersionSpec(d.build_version)
167+
pkg.version = PKG_VERSIONS.VersionSpec(d.build_version)
168168
end
169169
return pkg
170170
end
@@ -183,7 +183,7 @@ filter_platforms(deps::AbstractVector{<:AbstractDependency}, p::AbstractPlatform
183183
# Wrapper around `Pkg.Types.registry_resolve!` which keeps the type of the
184184
# dependencies. TODO: improve this
185185
function registry_resolve!(ctx, dependencies::Vector{<:AbstractDependency})
186-
resolved_dependencies = Pkg.Types.registry_resolve!(ctx, getpkg.(dependencies))
186+
resolved_dependencies = Pkg.Types.registry_resolve!(ctx.registries, getpkg.(dependencies))
187187
for idx in eachindex(dependencies)
188188
dependencies[idx] = typeof(dependencies[idx])(resolved_dependencies[idx]; platforms=dependencies[idx].platforms)
189189
end
@@ -192,11 +192,11 @@ end
192192

193193
# We only want to update the registry once per run
194194
registry_updated = false
195-
function update_registry(ctx = Pkg.Types.Context(), outs = stdout)
195+
function update_registry(outs = stdout)
196196
global registry_updated
197197
if !registry_updated
198-
Pkg.Registry.update(ctx,
199-
[Pkg.Types.RegistrySpec(uuid = "23338594-aafe-5451-b93e-139f81909106")];
198+
Pkg.Registry.update(
199+
[Pkg.RegistrySpec(uuid = "23338594-aafe-5451-b93e-139f81909106")];
200200
io=outs,
201201
)
202202
registry_updated = true
@@ -218,7 +218,7 @@ function resolve_jlls(dependencies::Vector; ctx = Pkg.Types.Context(), outs=stdo
218218
end
219219

220220
# Resolve, returning the newly-resolved dependencies
221-
update_registry(ctx, outs)
221+
update_registry(outs)
222222
dependencies = registry_resolve!(ctx, dependencies)
223223

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

@@ -269,8 +269,8 @@ function dependencify(d::Dict)
269269
if d["type"] in ("dependency", "builddependency", "hostdependency")
270270
uuid = isnothing(d["uuid"]) ? d["uuid"] : UUID(d["uuid"])
271271
compat = d["compat"]
272-
version = VersionNumber(d["version-major"], d["version-minor"], d["version-patch"])
273-
version = version == v"0" ? nothing : version
272+
version = PKG_VERSIONS.VersionSpec(VersionNumber(d["version-major"], d["version-minor"], d["version-patch"]))
273+
version = version == PKG_VERSIONS.VersionSpec(v"0") ? PKG_VERSIONS.VersionSpec() : version
274274
spec = PackageSpec(; name = d["name"], uuid = uuid, version = version)
275275
platforms = parse_platform.(d["platforms"])
276276
if d["type"] == "dependency"

0 commit comments

Comments
 (0)