From 3e4c44697635a574419ac09d9ce3c21af3a75fd5 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Fri, 11 Apr 2025 18:15:42 -0400 Subject: [PATCH 1/3] Auditor: Avoid setting macOS rpaths for /workspace --- src/auditor/dynamic_linkage.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auditor/dynamic_linkage.jl b/src/auditor/dynamic_linkage.jl index f30e26c2..5b16c8fd 100644 --- a/src/auditor/dynamic_linkage.jl +++ b/src/auditor/dynamic_linkage.jl @@ -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 From 47d7022389ff88e5ba392025db0ab7c390008f9e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 12 Apr 2025 11:24:48 -0400 Subject: [PATCH 2/3] Remove "broken=Sys.isapple" from rpath test --- test/auditing.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/auditing.jl b/test/auditing.jl index 7a3a248e..056b2a48 100644 --- a/test/auditing.jl +++ b/test/auditing.jl @@ -693,7 +693,7 @@ 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) + @test length(libfoo_rpaths) == 1 end end From fb08780c00611a673622cb6266e41554704ee340 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 12 Apr 2025 11:58:51 -0400 Subject: [PATCH 3/3] Debug test failure --- test/auditing.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/auditing.jl b/test/auditing.jl index 056b2a48..d324f01a 100644 --- a/test/auditing.jl +++ b/test/auditing.jl @@ -693,6 +693,10 @@ 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. + #TODO + if !(length(libfoo_rpaths) == 1) + @show libfoo_rpaths + end @test length(libfoo_rpaths) == 1 end end