Skip to content

Commit 6d97a07

Browse files
committed
Converge JLL APIs a bit more
The initial draft of Fake JLLs missed some important points in JLL API compatibility; let's close the gap somewhat, where we can. This PR adds the following exports: * `get_artifact_dir()`: returns the Julia prefix * `dev_jll()`: Throws an error * `best_wrapper`: always set to `nothing` * `get_*_path()`: returns the path of the identified library product It also converts all fake JLL modules to `baremodule`s, and sets the appropriate compiler options to minimize compilation.
1 parent ebf54b4 commit 6d97a07

File tree

20 files changed

+215
-61
lines changed

20 files changed

+215
-61
lines changed

stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl
44

5-
module CompilerSupportLibraries_jll
6-
7-
using Libdl, Base.BinaryPlatforms
5+
baremodule CompilerSupportLibraries_jll
6+
using Base, Libdl, Base.BinaryPlatforms
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
88

99
const PATH_list = String[]
1010
const LIBPATH_list = String[]
@@ -60,6 +60,15 @@ function __init__()
6060
global libgomp_path = dlpath(libgomp_handle)
6161
end
6262

63+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
64+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
65+
# there isn't one. It instead returns the overall Julia prefix.
6366
is_available() = true
67+
find_artifact_dir() = artifact_dir
68+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
69+
best_wrapper = nothing
70+
get_libgfortran_path() = libgfortran_path
71+
get_libstdcxx_path() = libstdcxx_path
72+
get_libgomp_path() = libgomp_path
6473

6574
end # module CompilerSupportLibraries_jll

stdlib/GMP_jll/src/GMP_jll.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/GMP_jll.jl
4-
module GMP_jll
5-
6-
using Libdl
4+
baremodule GMP_jll
5+
using Base, Libdl
6+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
77

88
const PATH_list = String[]
99
const LIBPATH_list = String[]
@@ -39,6 +39,14 @@ function __init__()
3939
global libgmpxx_path = dlpath(libgmpxx_handle)
4040
end
4141

42+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
43+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
44+
# there isn't one. It instead returns the overall Julia prefix.
4245
is_available() = true
46+
find_artifact_dir() = artifact_dir
47+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
48+
best_wrapper = nothing
49+
get_libgmp_path() = libgmp_path
50+
get_libgmpxx_path() = libgmpxx_path
4351

4452
end # module GMP_jll

stdlib/LibCURL_jll/src/LibCURL_jll.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibCURL_jll.jl
44

5-
module LibCURL_jll
6-
7-
using Libdl
8-
using nghttp2_jll
5+
baremodule LibCURL_jll
6+
using Base, Libdl, nghttp2_jll
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
98

109
const PATH_list = String[]
1110
const LIBPATH_list = String[]
@@ -34,6 +33,13 @@ function __init__()
3433
global libcurl_path = dlpath(libcurl_handle)
3534
end
3635

36+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
37+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
38+
# there isn't one. It instead returns the overall Julia prefix.
3739
is_available() = true
40+
find_artifact_dir() = artifact_dir
41+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
42+
best_wrapper = nothing
43+
get_libcurl_path() = libcurl_path
3844

3945
end # module LibCURL_jll

stdlib/LibGit2_jll/src/LibGit2_jll.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibGit2_jll.jl
44

5-
module LibGit2_jll
6-
7-
using Libdl
8-
using MbedTLS_jll, LibSSH2_jll
5+
baremodule LibGit2_jll
6+
using Base, Libdl, nghttp2_jll, MbedTLS_jll, LibSSH2_jll
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
98

109
const PATH_list = String[]
1110
const LIBPATH_list = String[]
@@ -34,6 +33,13 @@ function __init__()
3433
global libgit2_path = dlpath(libgit2_handle)
3534
end
3635

36+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
37+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
38+
# there isn't one. It instead returns the overall Julia prefix.
3739
is_available() = true
40+
find_artifact_dir() = artifact_dir
41+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
42+
best_wrapper = nothing
43+
get_libgit2_path() = libgit2_path
3844

3945
end # module LibGit2_jll

stdlib/LibOSXUnwind_jll/src/LibOSXUnwind_jll.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibOSXUnwind_jll.jl
44

5-
module LibOSXUnwind_jll
6-
7-
using Libdl
5+
baremodule LibOSXUnwind_jll
6+
using Base, Libdl
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
88

99
const PATH_list = String[]
1010
const LIBPATH_list = String[]
@@ -30,6 +30,13 @@ function __init__()
3030
end
3131
end
3232

33+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
34+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
35+
# there isn't one. It instead returns the overall Julia prefix.
3336
is_available() = @static Sys.isapple() ? true : false
37+
find_artifact_dir() = artifact_dir
38+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
39+
best_wrapper = nothing
40+
get_libosxunwind_path() = libosxunwind_path
3441

3542
end # module LibOSXUnwind_jll

stdlib/LibSSH2_jll/src/LibSSH2_jll.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibSSH2_jll.jl
44

5-
module LibSSH2_jll
6-
7-
using Libdl
8-
using MbedTLS_jll
5+
baremodule LibSSH2_jll
6+
using Base, Libdl, MbedTLS_jll
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
98

109
const PATH_list = String[]
1110
const LIBPATH_list = String[]
@@ -34,6 +33,14 @@ function __init__()
3433
global libssh2_path = dlpath(libssh2_handle)
3534
end
3635

36+
37+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
38+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
39+
# there isn't one. It instead returns the overall Julia prefix.
3740
is_available() = true
41+
find_artifact_dir() = artifact_dir
42+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
43+
best_wrapper = nothing
44+
get_libssh2_path() = libssh2_path
3845

3946
end # module LibSSH2_jll

stdlib/LibUV_jll/src/LibUV_jll.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibUV_jll.jl
44

5-
module LibUV_jll
6-
7-
using Libdl
5+
baremodule LibUV_jll
6+
using Base, Libdl
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
88

99
const PATH_list = String[]
1010
const LIBPATH_list = String[]
@@ -33,6 +33,13 @@ function __init__()
3333
global libuv_path = dlpath(libuv_handle)
3434
end
3535

36+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
37+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
38+
# there isn't one. It instead returns the overall Julia prefix.
3639
is_available() = true
40+
find_artifact_dir() = artifact_dir
41+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
42+
best_wrapper = nothing
43+
get_libuv_path() = libuv_path
3744

3845
end # module LibUV_jll

stdlib/LibUnwind_jll/src/LibUnwind_jll.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/LibUnwind_jll.jl
44

5-
module LibUnwind_jll
6-
7-
using Libdl
5+
baremodule LibUnwind_jll
6+
using Base, Libdl
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
88

99
const PATH_list = String[]
1010
const LIBPATH_list = String[]
@@ -30,6 +30,13 @@ function __init__()
3030
end
3131
end
3232

33+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
34+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
35+
# there isn't one. It instead returns the overall Julia prefix.
3336
is_available() = @static (Sys.islinux() || Sys.isfreebsd()) ? true : false
37+
find_artifact_dir() = artifact_dir
38+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
39+
best_wrapper = nothing
40+
get_libunwind_path() = libunwind_path
3441

3542
end # module LibUnwind_jll

stdlib/MPFR_jll/src/MPFR_jll.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/MPFR_jll.jl
4-
module MPFR_jll
5-
using GMP_jll
6-
7-
using Libdl
4+
baremodule MPFR_jll
5+
using Base, Libdl, GMP_jll
6+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
87

98
const PATH_list = String[]
109
const LIBPATH_list = String[]
@@ -33,6 +32,13 @@ function __init__()
3332
global libmpfr_path = dlpath(libmpfr_handle)
3433
end
3534

35+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
36+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
37+
# there isn't one. It instead returns the overall Julia prefix.
3638
is_available() = true
39+
find_artifact_dir() = artifact_dir
40+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
41+
best_wrapper = nothing
42+
get_libmpfr_path() = libmpfr_path
3743

3844
end # module MPFR_jll

stdlib/MbedTLS_jll/src/MbedTLS_jll.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/MbedTLS_jll.jl
44

5-
module MbedTLS_jll
6-
7-
using Libdl
5+
baremodule MbedTLS_jll
6+
using Base, Libdl
7+
Base.Experimental.@compiler_options compile=min optimize=0 infer=false
88

99
const PATH_list = String[]
1010
const LIBPATH_list = String[]
@@ -47,6 +47,15 @@ function __init__()
4747
global libmbedx509_path = dlpath(libmbedx509_handle)
4848
end
4949

50+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
51+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
52+
# there isn't one. It instead returns the overall Julia prefix.
5053
is_available() = true
54+
find_artifact_dir() = artifact_dir
55+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
56+
best_wrapper = nothing
57+
get_libmbedcrypto_path() =libmbedcrypto_path
58+
get_libmbedtls_path() = libmbedtls_path
59+
get_libmbedx509_path() = libmbedx509_path
5160

5261
end # module MbedTLS_jll

0 commit comments

Comments
 (0)