jli  Linuxx86_641.10.3v1.10.30b4590a5507d3f3046e5bafc007cacbbfc9b310b JLLWrappersK<;+i2<78/opt/julia/packages/JLLWrappers/pG9bm/src/JLLWrappers.jlAPreferences.jl!!Preferences@/opt/julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jlA?/opt/julia/packages/JLLWrappers/pG9bm/src/wrapper_generators.jlAK/opt/julia/packages/JLLWrappers/pG9bm/src/products/executable_generators.jlAE/opt/julia/packages/JLLWrappers/pG9bm/src/products/file_generators.jlAH/opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jlA4/opt/julia/packages/JLLWrappers/pG9bm/src/runtime.jlA CoremуJ5Basemу]J5MainmуJ5ArgToolsBń x(mуF K5 Artifactsmr-V3|mу K5Base64UlD*_mу> K5CRC32c\y.jmуj K5 FileWatchingXzsy`{,zmуh& K5LibdluVW59˗,mу-" K5LoggingT{VhUXM=mуrU" K5MmapP~:xg,Omу|' K5NetworkOptionsC0YW,mуʠ, K5SHAQ<$!<%mу1 K5 Serialization [)*k1mу-G K5Sockets1V$ bdސݗmуYBY K5UnicodeP>I>Nrmуeszo K5 LinearAlgebraSm7̏mуuux K5 OpenBLAS_jll[(Śb6EcQ FmуDux K5libblastrampoline_jllLSۆ }lxӠmу^} K5MarkdownZPn7z`smу/Ed~ K5Printfg^cX׸QDmу;h K5Random_ɢ?\Ymу? K5TarOi>աmу!t, K5DatesEY8pj2 mуX K5FuturebS;3{I xVMmуsD K5InteractiveUtilsWL ~@'ZmуVg K5LibGit2Z[&RPTv3EКRmу8J K5 LibGit2_jll YXg}]$mуD K5 MbedTLS_jllAX 3ȡ_mу- K5 LibSSH2_jlloTZk)߆= v"1.6.0-DEV" using Preferences end const global_typeassert_available = VERSION >= v"1.9.0-" # We need to glue expressions together a lot function excat(exs::Union{Expr,Nothing}...) ex = Expr(:block) for exn in exs exn === nothing && continue if Meta.isexpr(exn, :block) append!(ex.args, exn.args) else push!(ex.args, exn) end end return esc(ex) end include("toplevel_generators.jl") include("wrapper_generators.jl") include("runtime.jl") end # module @/opt/julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl% """ generate_imports(src_name) We import the appropriate `Artifacts` module based on Julia version; Julia 1.3+ contains an `Artifacts` module in `Pkg`, while Julia 1.6+ has it as a builtin standard library. """ function generate_imports(src_name) # We lie a bit in the registry that JLL packages are usable on Julia 1.0-1.2. # This is to allow packages that might want to support Julia 1.0 to get the # benefits of a JLL package on 1.3 (requiring them to declare a dependence on # the JLL package in their Project.toml) but engage in heroic hacks to do # something other than actually use a JLL package on 1.0-1.2. By allowing # this package to be installed (but not loaded) on 1.0-1.2, we enable users # to avoid splitting their package versions into pre-1.3 and post-1.3 branches # if they are willing to engage in the kinds of hoop-jumping they might need # to in order to install binaries in a JLL-compatible way on 1.0-1.2. One # example of this hoop-jumping being to express a dependency on this JLL # package, then import it within a `VERSION >= v"1.3"` conditional, and use # the deprecated `build.jl` mechanism to download the binaries through e.g. # `BinaryProvider.jl`. This should work well for the simplest packages, and # require greater and greater heroics for more and more complex packages. @static if VERSION < v"1.3.0-rc4" return quote error("Unable to use $($(src_name))_jll on Julia versions older than 1.3!") end elseif VERSION < v"1.6.0-DEV" # Use slow Pkg-based Artifacts return quote using Libdl, Pkg, Pkg.BinaryPlatforms, Pkg.Artifacts using Pkg.Artifacts: load_artifacts_toml, unpack_platform using Pkg.BinaryPlatforms: triplet, select_platform HostPlatform() = platform_key_abi() end else # Use fast stdlib-based Artifacts + Preferences return quote using Libdl, Artifacts, JLLWrappers.Preferences, Base.BinaryPlatforms using Artifacts: load_artifacts_toml, unpack_platform using Base.BinaryPlatforms: triplet, select_platform end end end """ generate_compiler_options(src_name) Because JLL packages do not contain code that benefits much from compiler optimizations, we disable them for a sizable boost in first load time. """ function generate_compiler_options(src_name) # Newer Julias have `@compiler_options` that can enable interpreted mode if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@compiler_options")) return quote Core.eval($(Symbol("$(src_name)_jll")), :(Base.Experimental.@compiler_options compile=min optimize=0 infer=false)) end end # Older Julias only have `@optlevel` if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@optlevel")) return quote @eval Base.Experimental.@optlevel 0 end end # If none of these are available, TOUGH BEANS. return nothing end """ generate_toplevel_definitions(src_name) This method generates the toplevel definitions common to all JLL packages, such as `is_available()`, the `PATH` and `LIBPATH` symbols, etc.... """ function generate_toplevel_definitions(src_name, __source__) return quote """ is_available() Return whether the artifact is available for the current platform. """ function is_available end const PATH = Ref{String}("") const LIBPATH = Ref{String}("") # We put these inter-JLL-package API values here so that they are always defined, even if there # is no underlying wrapper held within this JLL package. const PATH_list = String[] const LIBPATH_list = String[] # We sub off to JLLWrappers' dev_jll, but avoid backedges dev_jll() = Base.invokelatest(JLLWrappers.dev_jll, $(src_name)) end end """ generate_wrapper_load(src_name, pkg_uuid) Because each platform could have completely disjoint products, we embed the information for each in its own `.jl` file, named by triplet, and stored within the `src/wrappers` directory. This method generates the code to load `Artifacts.toml`, parse it for artifacts, find the one that matches the host platform, then load the matching wrapper. """ function generate_wrapper_load(src_name, pkg_uuid, __source__) jll_name = "$(src_name)_jll" pkg_dir = dirname(String(__source__.file)) function platform_parse_compat() @static if VERSION < v"1.6.0-DEV" return :(parse_wrapper_platform(x) = platform_key_abi(x)) else return :(parse_wrapper_platform(x) = parse(Platform, x)) end end return quote @static if $global_typeassert_available global best_wrapper::Union{Nothing,String} else global best_wrapper end # Load Artifacts.toml file and select best platform at compile-time, since this is # running at toplevel, and therefore will be run completely at compile-time. We use # a `let` block here to avoid storing unnecessary data in our `.ji` files if @isdefined(augment_platform!) const host_platform = augment_platform!(HostPlatform()) else const host_platform = nothing end best_wrapper = let artifacts_toml = joinpath($(pkg_dir), "..", "Artifacts.toml") valid_wrappers = Dict{Platform,String}() artifacts = load_artifacts_toml(artifacts_toml; pkg_uuid=$(pkg_uuid))[$(src_name)] # Helper function to parse triplets for us $(platform_parse_compat()) function make_wrapper_dict(dir, x) # (1) make the Dict type inferrable # (2) avoid creation of Generators so that we don't have to compile # package-specific Generator-closures d = Dict{Platform,String}() for f in x d[parse_wrapper_platform(basename(f)[1:end-3])] = joinpath(dir, "wrappers", f) end return d end # If it's a Dict, that means this is an AnyPlatform artifact, act accordingly: if isa(artifacts, Dict) joinpath($(pkg_dir), "wrappers", "any.jl") else # Otherwise, it's a Vector, and we must select the best platform # First, find all wrappers on-disk, parse their platforms, and match: wrapper_files = String[] for x in readdir(joinpath($(pkg_dir), "wrappers")) endswith(x, ".jl") && push!(wrapper_files, x) # avoid creation of Generators... end wrappers = make_wrapper_dict($(pkg_dir), wrapper_files) for e in artifacts platform = unpack_platform(e, $(jll_name), artifacts_toml) # Filter platforms based on what wrappers we've generated on-disk. # Because the wrapper file naming strategy relies upon BB's assumptions of triplet # parsing, it can be somewhat fragile. So we have loaded all the wrapper filenames # in, parsed them, and are now using `select_platform()` to match them, which is # much more robust. This step avoids a disconnect between what is recorded in the # `Artifacts.toml` file and what wrappers are available on-disk. wrapper_file = select_platform(wrappers, platform) if wrapper_file !== nothing valid_wrappers[platform] = wrapper_file end end # From the available options, choose the best wrapper script # The two argument `select_platform` is notably slower, so micro-optimize this by # only calling it when necessary. if host_platform !== nothing select_platform(valid_wrappers, host_platform) else select_platform(valid_wrappers) end end end # Load in the wrapper, if it's not `nothing`! if best_wrapper === nothing @debug(string("Unable to load ", $(src_name), "; unsupported platform ", host_platform === nothing ? triplet(HostPlatform()) : triplet(host_platform))) is_available() = false else Base.include($(Symbol("$(src_name)_jll")), best_wrapper) is_available() = true end end end macro generate_main_file_header(src_name) return excat( # Declare this module as interpreted generate_compiler_options(src_name), # import Artifacts module generate_imports(src_name), global_typeassert_available ? :(global artifact_dir::String) : :() ) end """ @generate_main_file(src_name, pkg_uuid) Generate the main JLL file to Import `Artifacts`, set compiler options, perform forward declarations for JLL-internal APIs, load the wrappers, etc... """ macro generate_main_file(src_name, pkg_uuid) return excat( # `is_available()` forward declaration, `PATH_list` and `LIBPATH_list` forward definitions, # `find_artifact_dir()` definition. generate_toplevel_definitions(src_name, __source__), # Select and load the best wrapper file generate_wrapper_load(src_name, pkg_uuid, __source__), ) end ?/opt/julia/packages/JLLWrappers/pG9bm/src/wrapper_generators.jl include("products/executable_generators.jl") include("products/file_generators.jl") include("products/library_generators.jl") macro generate_wrapper_header(src_name) pkg_dir = dirname(dirname(String(__source__.file))) return esc(quote function find_artifact_dir() # We determine at compile-time whether our JLL package has been dev'ed and overridden @static if isdir(joinpath(dirname($(pkg_dir)), "override")) return joinpath(dirname($(pkg_dir)), "override") elseif @isdefined(augment_platform!) && VERSION >= v"1.6" $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform))) else # We explicitly use `macrocall` here so that we can manually pass the `__source__` # argument, to avoid `@artifact_str` trying to lookup `Artifacts.toml` here. return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name)) end end if ccall(:jl_generating_output, Cint, ()) == 1 find_artifact_dir() # to precompile this into Pkgimage end end) end macro generate_init_header(dependencies...) deps_path_add = Expr[] if !isempty(dependencies) for dep in dependencies push!(deps_path_add, quote isdefined($(dep), :PATH_list) && append!(PATH_list, $(dep).PATH_list) isdefined($(dep), :LIBPATH_list) && append!(LIBPATH_list, $(dep).LIBPATH_list) end) end end return excat( # This either calls `@artifact_str()`, or returns a constant string if we're overridden. :(global artifact_dir = find_artifact_dir()), # Initialize PATH_list and LIBPATH_list deps_path_add..., ) end macro generate_init_footer() return esc(quote # Filter out duplicate and empty entries in our PATH and LIBPATH entries unique!(PATH_list) unique!(LIBPATH_list) PATH[] = join(PATH_list, $(pathsep)) LIBPATH[] = join(vcat(LIBPATH_list, Base.invokelatest(JLLWrappers.get_julia_libpaths))::Vector{String}, $(pathsep)) end) end """ emit_preference_path_load(pref_name, default_value) On Julia 1.6+, emits a `load_preference()` call for the given preference name, returning `nothing` if it is not loaded. On Julia v1.5-, always returns `nothing`. """ function emit_preference_path_load(pref_name) # Can't use `Preferences.jl` on older Julias, just always use the default value in that case @static if VERSION < v"1.6.0-DEV" return quote nothing end else return quote @load_preference($(pref_name), nothing) end end end K/opt/julia/packages/JLLWrappers/pG9bm/src/products/executable_generators.jlkfunction declare_old_executable_product(product_name) path_name = Symbol(string(product_name, "_path")) return quote # This is the old-style `withenv()`-based function """ $($product_name)(f::Function; adjust_PATH::Bool=true, adjust_LIBPATH::Bool=true) An `ExecutableProduct` wrapper that supports the execution of $($product_name). # Example ```julia $($product_name)() do exe run(`\$exe \$arguments`) end ``` !!! compat "Julia 1.3" """ function $(product_name)(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true) Base.depwarn(string($(product_name), "() is deprecated, use the non-do-block form"), $(string(product_name))) # We sub off to a shared function to avoid compiling the same thing over and over again return Base.invokelatest( JLLWrappers.withenv_executable_wrapper, f, $(Symbol("$(product_name)_path")), PATH[], LIBPATH[], adjust_PATH, adjust_LIBPATH, ) end @static if $global_typeassert_available $(path_name)::Union{String,Nothing} = "" else $(path_name) = "" end function $(Symbol(string("get_", product_name, "_path")))() return $(path_name)::String end end end function declare_new_executable_product(product_name) @static if VERSION < v"1.6.0-DEV" return nothing else path_name = Symbol(string(product_name, "_path")) return quote # This is the new-style `addenv()`-based function @doc """ $($product_name)(; adjust_PATH::Bool=true, adjust_LIBPATH::Bool=true) -> Cmd An `ExecutableProduct` wrapper that supports the execution of $($product_name). This wrapper is thread-safe and should be preferred on Julia 1.6+. # Example ```julia run(`\$($($product_name)()) \$arguments`) ``` !!! compat "Julia 1.6" """ function $(product_name)(; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true) env = Base.invokelatest( JLLWrappers.adjust_ENV!, copy(ENV), PATH[], LIBPATH[], adjust_PATH, adjust_LIBPATH, ) return Cmd(Cmd([$(path_name)]); env) end end end end macro declare_executable_product(product_name) path_name = string(product_name, "_path") return excat( # We will continue to support `withenv`-style for as long as we must declare_old_executable_product(product_name), # We will, however, urge users to move to the thread-safe `addenv`-style on Julia 1.6+ declare_new_executable_product(product_name), # Perform a compile-time load of a path preference override :($(Symbol(path_name)) = $(emit_preference_path_load(path_name))), ) end macro init_executable_product(product_name, product_path) path_name = Symbol(string(product_name, "_path")) return esc(quote global $(path_name) # Locate the executable on-disk, store into $(path_name) if $(path_name) === nothing $(path_name) = joinpath(artifact_dir, $(product_path)) end # Add this executable's directory onto the list of PATH's that we'll need to expose to dependents push!(PATH_list, dirname($(path_name))) end) end E/opt/julia/packages/JLLWrappers/pG9bm/src/products/file_generators.jlZmacro declare_file_product(product_name) get_path_name = Symbol(string("get_", product_name, "_path")) path_name = Symbol(string(product_name, "_path")) return esc(quote # These will be filled in by init_file_product(). @static if $global_typeassert_available $(product_name)::String = "" $(path_name)::Union{Nothing,String} = $(emit_preference_path_load(string(product_name, "_path"))) else $(product_name) = "" $(path_name) = $(emit_preference_path_load(string(product_name, "_path"))) end function $(get_path_name)() return $(path_name)::String end end) end macro init_file_product(product_name, product_path) path_name = Symbol(string(product_name, "_path")) return esc(quote global $(path_name) # FileProducts are very simple, and we maintain the `_path` suffix version for consistency if $(path_name) === nothing $(path_name) = joinpath(artifact_dir, $(product_path)) end global $(product_name) = $(path_name) end) end H/opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl% macro declare_library_product(product_name, product_soname) handle_name = Symbol(string(product_name, "_handle")) get_path_name = Symbol(string("get_", product_name, "_path")) path_name = Symbol(string(product_name, "_path")) @static if VERSION < v"1.6.0-DEV" lib_declaration = quote # On Julia 1.5-, this must be `const` and must be the SONAME const $(product_name) = $(product_soname) end else lib_declaration = quote # On Julia 1.6+, this doesn't have to be `const`! Thanks Jeff! @static if $global_typeassert_available $(product_name)::String = "" else $(product_name) = "" end end end return excat( quote # These will be filled in by init_library_product() @static if $global_typeassert_available $(handle_name)::Ptr{Cvoid} = C_NULL $(path_name)::Union{Nothing,String} = $(emit_preference_path_load(string(product_name, "_path"))) else $(handle_name) = C_NULL $(path_name) = $(emit_preference_path_load(string(product_name, "_path"))) end function $(get_path_name)() return $(path_name)::String end end, lib_declaration, ) end function init_new_library_product(product_name) @static if VERSION < v"1.6.0-DEV" return nothing else return quote # Initialize non-const variable export with the path to this product global $(product_name) = $(Symbol(string(product_name, "_path"))) end end end macro init_library_product(product_name, product_path, dlopen_flags) handle_name = Symbol(string(product_name, "_handle")) preference_name = string(product_name, "_path") path_name = Symbol(preference_name) return excat(quote global $(path_name) if $(path_name) === nothing $(path_name) = joinpath(artifact_dir, $(product_path)) end # Manually `dlopen()` this right now so that future invocations # of `ccall` with its path/SONAME will find this path immediately. # dlopen_flags === nothing means to not dlopen the library. if $(dlopen_flags) !== nothing global $(handle_name) = dlopen($(path_name), $(dlopen_flags)) push!(LIBPATH_list, dirname($(path_name))) end end, init_new_library_product(product_name), ) end 4/opt/julia/packages/JLLWrappers/pG9bm/src/runtime.jl # Things that are useful to know across platforms if Sys.iswindows() const LIBPATH_env = "PATH" const LIBPATH_default = "" const pathsep = ';' elseif Sys.isapple() const LIBPATH_env = "DYLD_FALLBACK_LIBRARY_PATH" const LIBPATH_default = "~/lib:/usr/local/lib:/lib:/usr/lib" const pathsep = ':' else const LIBPATH_env = "LD_LIBRARY_PATH" const LIBPATH_default = "" const pathsep = ':' end function adjust_ENV!(env::Dict, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool) if adjust_LIBPATH LIBPATH_base = get(env, LIBPATH_env, expanduser(LIBPATH_default)) if !isempty(LIBPATH_base) env[LIBPATH_env] = string(LIBPATH, pathsep, LIBPATH_base) else env[LIBPATH_env] = LIBPATH end end if adjust_PATH && (LIBPATH_env != "PATH" || !adjust_LIBPATH) if adjust_PATH if !isempty(get(env, "PATH", "")) env["PATH"] = string(PATH, pathsep, env["PATH"]) else env["PATH"] = PATH end end end return env end function withenv_executable_wrapper(f::Function, executable_path::String, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool) env = Dict{String,String}( "PATH" => get(ENV, "PATH", ""), LIBPATH_env => get(ENV, LIBPATH_env, ""), ) env = adjust_ENV!(env, PATH, LIBPATH, adjust_PATH, adjust_LIBPATH) withenv(env...) do f(executable_path) end end function dev_jll(src_name) # Grab `Pkg` module Pkg = first(filter(p-> p[1].name == "Pkg", Base.loaded_modules))[2] # First, `dev` out the package, but don't affect the current project mktempdir() do temp_env Pkg.activate(temp_env) do Pkg.develop("$(src_name)_jll") Pkg.instantiate() end end # Create the override directory by populating it with the artifact contents override_dir = joinpath(Pkg.devdir(), "$(src_name)_jll", "override") if !isdir(override_dir) artifacts_toml = joinpath(Pkg.devdir(), "$(src_name)_jll", "Artifacts.toml") art_hash = Pkg.Artifacts.artifact_hash(src_name, artifacts_toml) art_location = Pkg.Artifacts.artifact_path(art_hash) cp(art_location, override_dir) end # Force recompilation of that package, just in case it wasn't dev'ed before touch(joinpath(Pkg.devdir(), "$(src_name)_jll", "src", "$(src_name)_jll.jl")) @info("$(src_name)_jll dev'ed out to $(joinpath(Pkg.devdir(), "$(src_name)_jll")) with pre-populated override directory") end const JULIA_LIBDIRS = String[] """ get_julia_libpaths() Return the library paths that e.g. libjulia and such are stored in. """ function get_julia_libpaths() if isempty(JULIA_LIBDIRS) append!(JULIA_LIBDIRS, [joinpath(Sys.BINDIR::String, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR::String, Base.LIBDIR)]) # Windows needs to see the BINDIR as well @static if Sys.iswindows() push!(JULIA_LIBDIRS, Sys.BINDIR) end end return JULIA_LIBDIRS end 5݋