Skip to content

Commit 889f388

Browse files
authored
Merge pull request #70 from JuliaPackaging/gb/eager_mode12
Fix type instabilities in the init_header
2 parents b5f2a74 + 45cc049 commit 889f388

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/wrapper_generators.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ macro generate_wrapper_header(src_name)
1010
@static if isdir(joinpath(dirname($(pkg_dir)), "override"))
1111
return joinpath(dirname($(pkg_dir)), "override")
1212
elseif @isdefined(augment_platform!) && VERSION >= v"1.6"
13-
$(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform)))
13+
$(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, __module__.host_platform))
1414
else
1515
# We explicitly use `macrocall` here so that we can manually pass the `__source__`
1616
# argument, to avoid `@artifact_str` trying to lookup `Artifacts.toml` here.
@@ -30,17 +30,22 @@ macro generate_init_header(dependencies...)
3030
eager_mode = Expr[]
3131
if !isempty(dependencies)
3232
for dep in dependencies
33-
push!(deps_path_add, quote
34-
isdefined($(dep), :PATH_list) && append!(PATH_list, $(dep).PATH_list)
35-
isdefined($(dep), :LIBPATH_list) && append!(LIBPATH_list, $(dep).LIBPATH_list)
36-
end)
37-
push!(eager_mode, :(isdefined($(dep), :eager_mode) && $(dep).eager_mode()))
33+
depmod = getfield(__module__, dep)
34+
if isdefined(depmod, :PATH_list)
35+
push!(deps_path_add, :(append!(PATH_list, $(dep).PATH_list)))
36+
end
37+
if isdefined(depmod, :LIBPATH_list)
38+
push!(deps_path_add, :(append!(LIBPATH_list, $(dep).LIBPATH_list)))
39+
end
40+
if isdefined(depmod, :eager_mode)
41+
push!(eager_mode, :($(dep).eager_mode()))
42+
end
3843
end
3944
end
4045

4146
return excat(
4247
# This either calls `@artifact_str()`, or returns a constant string if we're overridden.
43-
:(global artifact_dir = find_artifact_dir()),
48+
:(global artifact_dir = find_artifact_dir()::String),
4449

4550
# Add `eager_mode` invocations on all our dependencies
4651
eager_mode...,

0 commit comments

Comments
 (0)