From 028146ec8dd3cbfc1b1f9bbb14aafd312e2dfb67 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 14 Sep 2022 11:09:26 +0200 Subject: [PATCH 1/2] pass explicit path to Artifact file into the artifact string macro --- src/wrapper_generators.jl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/wrapper_generators.jl b/src/wrapper_generators.jl index 3be7f20..20c4d45 100644 --- a/src/wrapper_generators.jl +++ b/src/wrapper_generators.jl @@ -10,17 +10,24 @@ macro generate_wrapper_header(src_name) @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))) + @static if VERSION >= v"1.9.0-DEV.XXXX" + $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform), joinpath(pkg_dir, "..", "Artifacts.toml"))) + else + $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform))) + end 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)) + @static if VERSION >= v"1.9.0-DEV.XXXX" + return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, nothing, joinpath(pkg_dir, "..", "Artifacts.toml"))) + else + return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name)) + end end end end) end - macro generate_init_header(dependencies...) deps_path_add = Expr[] if !isempty(dependencies) From 542e69089d7f10856653c93441951f12b58588b5 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Mon, 10 Oct 2022 11:48:39 +0200 Subject: [PATCH 2/2] update version check now that upstream PR is merged --- src/wrapper_generators.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrapper_generators.jl b/src/wrapper_generators.jl index 20c4d45..1c9d4aa 100644 --- a/src/wrapper_generators.jl +++ b/src/wrapper_generators.jl @@ -10,7 +10,7 @@ macro generate_wrapper_header(src_name) @static if isdir(joinpath(dirname($(pkg_dir)), "override")) return joinpath(dirname($(pkg_dir)), "override") elseif @isdefined(augment_platform!) && VERSION >= v"1.6" - @static if VERSION >= v"1.9.0-DEV.XXXX" + @static if VERSION >= v"1.9.0-DEV.1497" $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform), joinpath(pkg_dir, "..", "Artifacts.toml"))) else $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform))) @@ -18,7 +18,7 @@ macro generate_wrapper_header(src_name) 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. - @static if VERSION >= v"1.9.0-DEV.XXXX" + @static if VERSION >= v"1.9.0-DEV.1497" return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, nothing, joinpath(pkg_dir, "..", "Artifacts.toml"))) else return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name))