Skip to content

Commit 20ad37e

Browse files
committed
[Runner] Have always host first in CSL paths for LD_LIBRARY_PATH
Having `target` first would make C++ programs for `i686-linux-musl` work, but then we can't run C++ programs for the host. We really need to fix the musl loader.
1 parent 2bb3852 commit 20ad37e

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/Runner.jl

+1-5
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,8 @@ function ld_library_path(target::AbstractPlatform,
6969
# If requested, start with our CSL libraries for target/host, but only for architectures
7070
# that can natively run within this environment
7171
if csl_paths
72-
# Ok, this is incredibly finicky. If the target has the same architecture as the
73-
# host, we should have the host first then the target, otherwise we need to have
74-
# target first.
75-
platforms = arch(target) == arch(host) ? (host, target) : (target, host)
7672
append!(paths,
77-
unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in platforms if Sys.islinux(p) && proc_family(p) == "intel"),
73+
unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in (host, target) if Sys.islinux(p) && proc_family(p) == "intel"),
7874
)
7975
end
8076

test/runners.jl

+18-8
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,15 @@ end
170170
./test
171171
"""
172172
cmd = `/bin/bash -c "$(test_script)"`
173-
@test run(ur, cmd, iobuff; tee_stream=devnull)
174-
seekstart(iobuff)
175-
# Test that we get the output we expect
176-
@test endswith(readchomp(iobuff), "Hello World!")
173+
if arch(platform) == "i686" && libc(platform) == "musl"
174+
# We can't run this program for this platform
175+
@test_broken run(ur, cmd, iobuff; tee_stream=devnull)
176+
else
177+
@test run(ur, cmd, iobuff; tee_stream=devnull)
178+
seekstart(iobuff)
179+
# Test that we get the output we expect
180+
@test endswith(readchomp(iobuff), "Hello World!")
181+
end
177182
cleanup_dependencies(prefix, artifact_paths, concrete_platform)
178183
end
179184
end
@@ -219,10 +224,15 @@ end
219224
./test
220225
"""
221226
cmd = `/bin/bash -c "$(test_script)"`
222-
@test run(ur, cmd, iobuff; tee_stream=devnull)
223-
seekstart(iobuff)
224-
# Test that we get the output we expect
225-
@test endswith(readchomp(iobuff), "Hello World!")
227+
if arch(platform) == "i686" && libc(platform) == "musl"
228+
# We can't run C++ programs for this platform
229+
@test_broken run(ur, cmd, iobuff; tee_stream=devnull)
230+
else
231+
@test run(ur, cmd, iobuff; tee_stream=devnull)
232+
seekstart(iobuff)
233+
# Test that we get the output we expect
234+
@test endswith(readchomp(iobuff), "Hello World!")
235+
end
226236
cleanup_dependencies(prefix, artifact_paths, concrete_platform)
227237
end
228238
end

0 commit comments

Comments
 (0)