Skip to content

Commit 9cbe2be

Browse files
committed
Do not make JLL packages require Preferences
This will make the introduction of `Preferences` non-breaking: as it is now, packages need to have `Preferences` in their own environment.
1 parent 11ddbff commit 9cbe2be

File tree

8 files changed

+12
-6
lines changed

8 files changed

+12
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- "1.3"
1818
- "1.4"
1919
- "1.5"
20+
- "^1.6.0-0"
2021
- "nightly"
2122
os:
2223
- ubuntu-latest

Project.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
33
authors = ["Mosè Giordano", "Elliot Saba"]
44
version = "1.3.0"
55

6+
[deps]
7+
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
8+
69
[compat]
10+
Preferences = "1.2.1"
711
julia = "1.0.0"
812

913
[extras]
1014
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1115
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
12-
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1316

1417
[targets]
15-
test = ["Pkg", "Test", "Preferences"]
18+
test = ["Pkg", "Test"]

src/JLLWrappers.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@compi
44
@eval Base.Experimental.@compiler_options compile=min optimize=0 infer=false
55
end
66

7+
if VERSION >= v"1.6.0-DEV"
8+
using Preferences
9+
end
10+
711
# We need to glue expressions together a lot
812
function excat(exs::Union{Expr,Nothing}...)
913
ex = Expr(:block)

src/toplevel_generators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function generate_imports(src_name)
3535
else
3636
# Use fast stdlib-based Artifacts + Preferences
3737
return quote
38-
using Libdl, Artifacts, Preferences, Base.BinaryPlatforms
38+
using Libdl, Artifacts, JLLWrappers.Preferences, Base.BinaryPlatforms
3939
using Artifacts: load_artifacts_toml, unpack_platform
4040
using Base.BinaryPlatforms: triplet, select_platform
4141
end

test/HelloWorldC_jll/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
77
JLLWrappers = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
88
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
99
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
10-
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1110

1211
[compat]
1312
julia = "1.0"

test/OpenLibm_jll/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
77
JLLWrappers = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
88
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
99
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
10-
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1110

1211
[compat]
1312
julia = "1.0"

test/Vulkan_Headers_jll/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
77
JLLWrappers = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
88
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
99
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
10-
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1110

1211
[compat]
1312
julia = "1.0"

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using JLLWrappers
22
using Pkg
33
using Test
44

5+
# We use preferences only in Julia v1.6+
56
@static if VERSION >= v"1.6.0-DEV"
67
using Preferences
78
end

0 commit comments

Comments
 (0)