Skip to content

Auditor: Avoid setting macOS rpaths for /workspace #1376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/auditor/dynamic_linkage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,12 @@ function update_linkage(prefix::Prefix, platform::AbstractPlatform, path::Abstra
end
return rp
end
add_rpath = rp -> `$install_name_tool -add_rpath $(rp) $(rel_path)`
add_rpath = rp -> begin
# Remove paths starting with `/workspace`: they will not work outisde of the
# build environment and only create noise when debugging.
startswith(rp, "/workspace") && return
`$install_name_tool -add_rpath $(rp) $(rel_path)`
end
relink = (op, np) -> `$install_name_tool -change $(op) $(np) $(rel_path)`
elseif Sys.islinux(platform) || Sys.isbsd(platform)
normalize_rpath = rp -> begin
Expand Down
6 changes: 5 additions & 1 deletion test/auditing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,11 @@ end
libfoo_rpaths = Auditor._rpaths(joinpath(testdir, "lib", "libfoo.$(platform_dlext(platform))"))
@test (Sys.isapple(platform) ? "@loader_path" : "\$ORIGIN") * "/qux" in libfoo_rpaths
# Currently we don't filter out absolute rpaths for macOS libraries, no good.
@test length(libfoo_rpaths) == 1 broken=Sys.isapple(platform)
#TODO
if !(length(libfoo_rpaths) == 1)
@show libfoo_rpaths
end
@test length(libfoo_rpaths) == 1
end
end

Expand Down
Loading