From 86114d6c61f4f7bcfbc27a7e9a5e5541028438fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 11 Jul 2021 21:43:53 +0100 Subject: [PATCH 1/8] [Runner] Fix CSL paths --- src/Runner.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner.jl b/src/Runner.jl index 861256b1..d683b831 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -903,7 +903,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; # We need to push i686 directories before x86_64 ones ("i686", "x86_64") else - ("x86", "i686_64") + ("x86_64", "i686") end return join(["/usr/lib/csl-$(libc)-$(arch)" for libc in libcs, arch in archs], ":") From 3dd4151f555d24290fa22f1ae7caefaf3e093733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 29 Jun 2021 23:45:40 +0100 Subject: [PATCH 2/8] [Runner] Move `csl_paths(host_platform)` at the beginning of `LD_LIBRARY_PATH` This should make it easier to run applications we build with our toolchain. --- Project.toml | 2 +- src/Runner.jl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 587a6bbf..85c50a9a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinaryBuilderBase" uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e" authors = ["Elliot Saba "] -version = "0.6.12" +version = "0.6.13" [deps] CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" diff --git a/src/Runner.jl b/src/Runner.jl index d683b831..74f89097 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -927,12 +927,12 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; ), ":"), "LD_LIBRARY_PATH" => join(( - # Start with a default path - "/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib", + # Start with our CSL libraries for all architectures that can natively run within this environment + csl_paths(host_platform), + # Then add default system paths + "/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib", # Add our loader directories "/lib64:/lib", - # Add our CSL libraries for all architectures that can natively run within this environment - csl_paths(host_platform), # Libdir of the host platform, to run programs in `HostBuildDependency` "$(host_libdir)", # Add our target/host-specific library directories for compiler support libraries From 0a997953839c94b24da49807d123c5a338eb870f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 13 Jul 2021 10:42:48 +0000 Subject: [PATCH 3/8] [Rootfs] Update to fix CSL libraries --- Artifacts.toml | 20 ++++++++++---------- src/Rootfs.jl | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 73b5c6a4..ba6db8e9 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -2814,27 +2814,27 @@ os = "linux" sha256 = "d9bab2d2b19966509a070a92f6f982389d3ab418577a3a17dfbb0f03065216a6" url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2021.1.28/PlatformSupport-x86_64-w64-mingw32.v2021.1.28.x86_64-linux-musl.unpacked.tar.gz" -[["Rootfs.v2021.7.12.x86_64-linux-musl.squashfs"]] +[["Rootfs.v2021.7.13.x86_64-linux-musl.squashfs"]] arch = "x86_64" -git-tree-sha1 = "ff5285a07b28ff11026e779e042bf80283c30129" +git-tree-sha1 = "5795ee9f2eca2284bfb80611ac2accfc89998e0b" lazy = true libc = "musl" os = "linux" - [["Rootfs.v2021.7.12.x86_64-linux-musl.squashfs".download]] - sha256 = "a1216c62617a80607bf21aff5e5ae40bb46e8602f6189c87ed8d151d1b59f87f" - url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2021.7.12/Rootfs.v2021.7.12.x86_64-linux-musl.squashfs.tar.gz" + [["Rootfs.v2021.7.13.x86_64-linux-musl.squashfs".download]] + sha256 = "1bb755ffdf003fa1a1457cfbc3ad44e770038181e5a1138a54b0d60de507f692" + url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2021.7.13/Rootfs.v2021.7.13.x86_64-linux-musl.squashfs.tar.gz" -[["Rootfs.v2021.7.12.x86_64-linux-musl.unpacked"]] +[["Rootfs.v2021.7.13.x86_64-linux-musl.unpacked"]] arch = "x86_64" -git-tree-sha1 = "d40d6852338378ec860f6f78b93786bca64e21ca" +git-tree-sha1 = "56df63e8265adb2316d6599632113da025545434" lazy = true libc = "musl" os = "linux" - [["Rootfs.v2021.7.12.x86_64-linux-musl.unpacked".download]] - sha256 = "fd628ee10bdfbd093e5ba245eb72a6a07759d5c175529e5d72c3867594db2870" - url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2021.7.12/Rootfs.v2021.7.12.x86_64-linux-musl.unpacked.tar.gz" + [["Rootfs.v2021.7.13.x86_64-linux-musl.unpacked".download]] + sha256 = "aa5aef6b4c68b28c135da87d3d0169e142a84b89d556748f3f37d30355b9ca17" + url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2021.7.13/Rootfs.v2021.7.13.x86_64-linux-musl.unpacked.tar.gz" [["RustBase.v1.43.0.x86_64-linux-musl.squashfs"]] arch = "x86_64" diff --git a/src/Rootfs.jl b/src/Rootfs.jl index ebdd486c..2eb96fd2 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -508,7 +508,7 @@ consists of four shards, but that may not always be the case. """ function choose_shards(p::AbstractPlatform; compilers::Vector{Symbol} = [:c], - rootfs_build::VersionNumber=v"2021.7.12", + rootfs_build::VersionNumber=v"2021.7.13", ps_build::VersionNumber=v"2021.01.28", GCC_builds::Vector{GCCBuild}=available_gcc_builds, LLVM_builds::Vector{LLVMBuild}=available_llvm_builds, From bc7c7ca68112619c01ee454b1b8c43ef8b2db4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 13 Jul 2021 21:57:07 +0100 Subject: [PATCH 4/8] [Runner] Override `LD_LIBRARY_PATH` inside the compiler wrappers --- src/Runner.jl | 4 ++++ test/runners.jl | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/Runner.jl b/src/Runner.jl index 74f89097..ae88e310 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -395,6 +395,8 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr hash_args = true, allow_ccache, no_soft_float=arch(p) in ("armv6l", "armv7l"), + # Override `LD_LIBRARY_PATH` to avoid external settings mess it up. + env=Dict("LD_LIBRARY_PATH"=>""), ) end @@ -406,6 +408,8 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr compile_only_flags=clang_compile_flags!(p), link_only_flags=clang_link_flags!(p), no_soft_float=arch(p) in ("armv6l", "armv7l"), + # Override `LD_LIBRARY_PATH` to avoid external settings mess it up. + env=Dict("LD_LIBRARY_PATH"=>""), ) end diff --git a/test/runners.jl b/test/runners.jl index 6d59401b..cc5609f4 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -130,6 +130,58 @@ end end end + @testset "C and link to quadmath - $(platform)" for platform in platforms + mktempdir() do dir + # Use a recent GCC with libgfortran5 + options = (preferred_gcc_version=v"9", compilers=[:c]) + shards = choose_shards(platform; options...) + concrete_platform = get_concrete_platform(platform, shards) + prefix = setup_workspace( + dir, + [], + concrete_platform, + default_host_platform; + ) + # Install `MPICH_jll` in the `${prefix}` to make sure we can link to + # libquadmath without problems, see + # https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/157#issuecomment-879263820 + artifact_paths = + setup_dependencies(prefix, + [PackageSpec(; name="MPICH_jll", version="3.4.2")], + concrete_platform, verbose=false) + ur = preferred_runner()(prefix.path; + platform=concrete_platform, + shards = shards, + options...) + iobuff = IOBuffer() + test_c = """ + #include + int main() { + printf("Hello World!\\n"); + return 0; + } + """ + test_script = """ + set -e + echo '$(test_c)' > test.c + # Make sure we can compile successfully also when linking to libmpifort + cc -o test test.c -L\${libdir} -lmpifort -lquadmath + ./test + """ + cmd = `/bin/bash -c "$(test_script)"` + if arch(platform) == "i686" && libc(platform) == "musl" + # We can't run this program for this platform + @test_broken run(ur, cmd, iobuff; tee_stream=devnull) + else + @test run(ur, cmd, iobuff; tee_stream=devnull) + seekstart(iobuff) + # Test that we get the output we expect + @test endswith(readchomp(iobuff), "Hello World!") + end + cleanup_dependencies(prefix, artifact_paths, concrete_platform) + end + end + @testset "C++ - $(platform)" for platform in platforms mktempdir() do dir # Use an old GCC with libgfortran3 @@ -167,7 +219,7 @@ end echo '$(test_cpp)' > test.cpp # Make sure we can compile successfully also when `\${libdir}` is in the # linker search path - g++ -o test test.cpp -L\${libdir} + c++ -o test test.cpp -L\${libdir} ./test """ cmd = `/bin/bash -c "$(test_script)"` From 2c14fecdc032ff65565cf03ab15662d69f264cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 13 Jul 2021 23:55:33 +0100 Subject: [PATCH 5/8] [Runner] Generate CSL paths only for target and host platforms Having all Intel Linux platforms in the CSL paths was a mess hard to deal with. The simplest thing to do is to generate the paths only for target and host, and sort them correctly: if they have same architecture, have the host first, if the have different architectures, have the target first. --- src/Runner.jl | 28 ++++++++++------------------ test/runners.jl | 26 ++++++++------------------ 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/src/Runner.jl b/src/Runner.jl index ae88e310..dba23952 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -895,22 +895,14 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; end end - function csl_paths(p::AbstractPlatform) - libcs = if Sys.islinux(p) && proc_family(p) == "intel" && libc(p) == "musl" - # We need to push musl directories before glibc ones - ("musl", "glibc") - else - ("glibc", "musl") - end - - archs = if Sys.islinux(p) && proc_family(p) == "intel" && arch(p) == "i686" - # We need to push i686 directories before x86_64 ones - ("i686", "x86_64") - else - ("x86_64", "i686") - end - - return join(["/usr/lib/csl-$(libc)-$(arch)" for libc in libcs, arch in archs], ":") + # Generate CSL paths for target and host platforms, but only if these are platforms for + # which we can run executables, i.e. Intel penguins. + function csl_paths(target::AbstractPlatform, host::AbstractPlatform) + # Ok, this is incredibly finicky: if the target has the same architecture as the + # host, we should have the host first then the target, otherwise we need to have + # target first. + platforms = arch(target) == arch(host) ? (host, target) : (target, host) + return join(unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in platforms if Sys.islinux(p) && proc_family(p) == "intel"), ":") end merge!(mapping, Dict( @@ -931,8 +923,8 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; ), ":"), "LD_LIBRARY_PATH" => join(( - # Start with our CSL libraries for all architectures that can natively run within this environment - csl_paths(host_platform), + # Start with our CSL libraries for target/host, but only for architectures that can natively run within this environment + csl_paths(platform, host_platform), # Then add default system paths "/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib", # Add our loader directories diff --git a/test/runners.jl b/test/runners.jl index cc5609f4..fbf5be1d 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -169,15 +169,10 @@ end ./test """ cmd = `/bin/bash -c "$(test_script)"` - if arch(platform) == "i686" && libc(platform) == "musl" - # We can't run this program for this platform - @test_broken run(ur, cmd, iobuff; tee_stream=devnull) - else - @test run(ur, cmd, iobuff; tee_stream=devnull) - seekstart(iobuff) - # Test that we get the output we expect - @test endswith(readchomp(iobuff), "Hello World!") - end + @test run(ur, cmd, iobuff; tee_stream=devnull) + seekstart(iobuff) + # Test that we get the output we expect + @test endswith(readchomp(iobuff), "Hello World!") cleanup_dependencies(prefix, artifact_paths, concrete_platform) end end @@ -223,15 +218,10 @@ end ./test """ cmd = `/bin/bash -c "$(test_script)"` - if arch(platform) == "i686" && libc(platform) == "musl" - # We can't run C++ programs for this platform - @test_broken run(ur, cmd, iobuff; tee_stream=devnull) - else - @test run(ur, cmd, iobuff; tee_stream=devnull) - seekstart(iobuff) - # Test that we get the output we expect - @test endswith(readchomp(iobuff), "Hello World!") - end + @test run(ur, cmd, iobuff; tee_stream=devnull) + seekstart(iobuff) + # Test that we get the output we expect + @test endswith(readchomp(iobuff), "Hello World!") cleanup_dependencies(prefix, artifact_paths, concrete_platform) end end From 2260c0b5bb447fe3f7bf74cbc482c9ef0e81a069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 14 Jul 2021 00:25:47 +0100 Subject: [PATCH 6/8] Simplify reading of some buffers in tests --- test/runners.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runners.jl b/test/runners.jl index fbf5be1d..9a8bbb0d 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -65,7 +65,7 @@ end @test run(ur, `/bin/bash -c "echo test"`, iobuff) seek(iobuff, 0) # Test that we get the output we expect (e.g. the second line is `test`) - @test split(String(read(iobuff)), "\n")[2] == "test" + @test readlines(iobuff)[2] == "test" end end @@ -259,7 +259,7 @@ end iobuff = IOBuffer() @test !run(ur, cmd, iobuff; tee_stream=devnull) seekstart(iobuff) - @test split(String(read(iobuff)), "\n")[2] == "Cannot force an architecture" + @test readlines(iobuff)[2] == "Cannot force an architecture" ur = preferred_runner()(dir; platform=platform, lock_microarchitecture=false) iobuff = IOBuffer() @@ -277,7 +277,7 @@ end iobuff = IOBuffer() @test !run(ur, cmd, iobuff; tee_stream=devnull) seekstart(iobuff) - lines = split(String(read(iobuff)), "\n") + lines = readlines(iobuff) @test lines[2] == "You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations" @test lines[3] == "Please repent." From 2bb3852b4cb5f0b5b0ef17fd98bac9ac95f97e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 14 Jul 2021 01:20:46 +0100 Subject: [PATCH 7/8] [Runner] Add helper function to set `LD_LIBRARY_PATH` --- src/Runner.jl | 102 ++++++++++++++++++++++++++++++------------------ test/runners.jl | 5 ++- 2 files changed, 67 insertions(+), 40 deletions(-) diff --git a/src/Runner.jl b/src/Runner.jl index dba23952..fa1d3aca 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -47,6 +47,67 @@ end # XXX: we want AnyPlatform to look like `x86_64-linux-musl` in the build environment. aatriplet(p::AnyPlatform) = aatriplet(default_host_platform) +function ld_library_path(target::AbstractPlatform, + host::AbstractPlatform, + prefix::String="", + host_libdir::String=""; + csl_paths::Bool=true) + # Helper for generating the library include path for a target. MacOS, as usual, + # puts things in slightly different place. + function target_lib_dir(p::AbstractPlatform) + t = aatriplet(p) + if Sys.isapple(p) + return "/opt/$(t)/$(t)/lib:/opt/$(t)/lib" + else + return "/opt/$(t)/$(t)/lib64:/opt/$(t)/$(t)/lib" + end + end + + # Let's start + paths = String[] + + # If requested, start with our CSL libraries for target/host, but only for architectures + # that can natively run within this environment + if csl_paths + # Ok, this is incredibly finicky. If the target has the same architecture as the + # host, we should have the host first then the target, otherwise we need to have + # target first. + platforms = arch(target) == arch(host) ? (host, target) : (target, host) + append!(paths, + unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in platforms if Sys.islinux(p) && proc_family(p) == "intel"), + ) + end + + push!(paths, + # Then add default system paths + "/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib", + # Add our loader directories + "/lib64:/lib", + ) + + if !isempty(host_libdir) + push!(paths, + # Libdir of the host platform, to run programs in `HostBuildDependency` + host_libdir, + ) + end + + push!(paths, + # Add our target/host-specific library directories for compiler support libraries + target_lib_dir(host), + target_lib_dir(target), + ) + + # Finally, add dependencies in the prefix + if !isempty(prefix) + push!(paths, + "$(prefix)/lib64:$(prefix)/lib", + ) + end + + return join(paths, ":") +end + """ generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::AbstractString, host_platform::AbstractPlatform = $(repr(default_host_platform)), @@ -396,7 +457,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr allow_ccache, no_soft_float=arch(p) in ("armv6l", "armv7l"), # Override `LD_LIBRARY_PATH` to avoid external settings mess it up. - env=Dict("LD_LIBRARY_PATH"=>""), + env=Dict("LD_LIBRARY_PATH"=>ld_library_path(platform, host_platform; csl_paths=false)), ) end @@ -409,7 +470,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr link_only_flags=clang_link_flags!(p), no_soft_float=arch(p) in ("armv6l", "armv7l"), # Override `LD_LIBRARY_PATH` to avoid external settings mess it up. - env=Dict("LD_LIBRARY_PATH"=>""), + env=Dict("LD_LIBRARY_PATH"=>ld_library_path(platform, host_platform; csl_paths=false)), ) end @@ -873,17 +934,6 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; return mapping end - # Helper for generating the library include path for a target. MacOS, as usual, - # puts things in slightly different place. - function target_lib_dir(p::AbstractPlatform) - t = aatriplet(p) - if Sys.isapple(p) - return "/opt/$(t)/$(t)/lib:/opt/$(t)/lib" - else - return "/opt/$(t)/$(t)/lib64:/opt/$(t)/$(t)/lib" - end - end - function GOARM(p::AbstractPlatform) # See https://github.com/golang/go/wiki/GoArm#supported-architectures if arch(p) == "armv6l" @@ -895,16 +945,6 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; end end - # Generate CSL paths for target and host platforms, but only if these are platforms for - # which we can run executables, i.e. Intel penguins. - function csl_paths(target::AbstractPlatform, host::AbstractPlatform) - # Ok, this is incredibly finicky: if the target has the same architecture as the - # host, we should have the host first then the target, otherwise we need to have - # target first. - platforms = arch(target) == arch(host) ? (host, target) : (target, host) - return join(unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in platforms if Sys.islinux(p) && proc_family(p) == "intel"), ":") - end - merge!(mapping, Dict( "PATH" => join(( # First things first, our compiler wrappers trump all @@ -922,21 +962,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; mapping["bindir"], ), ":"), - "LD_LIBRARY_PATH" => join(( - # Start with our CSL libraries for target/host, but only for architectures that can natively run within this environment - csl_paths(platform, host_platform), - # Then add default system paths - "/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib", - # Add our loader directories - "/lib64:/lib", - # Libdir of the host platform, to run programs in `HostBuildDependency` - "$(host_libdir)", - # Add our target/host-specific library directories for compiler support libraries - target_lib_dir(host_platform), - target_lib_dir(platform), - # Finally, dependencies - "$(prefix)/lib64:$(prefix)/lib", - ), ":"), + "LD_LIBRARY_PATH" => ld_library_path(platform, host_platform, prefix, host_libdir), # Default mappings for some tools "CC" => "cc", diff --git a/test/runners.jl b/test/runners.jl index 9a8bbb0d..f42682b5 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -96,11 +96,12 @@ end end # This tests only that compilers for all platforms can build a simple C program - @testset "Compilation - $(platform)" for platform in platforms + # TODO: for the time being we only test `cc`, eventually we want to run `gcc` and `clang` separately + @testset "Compilation - $(platform) - $(compiler)" for platform in platforms, compiler in ("cc",) mktempdir() do dir ur = preferred_runner()(dir; platform=platform) iobuff = IOBuffer() - @test run(ur, `/bin/bash -c "echo 'int main() {return 0;}' | cc -x c -"`, iobuff; tee_stream=devnull) + @test run(ur, `/bin/bash -c "echo 'int main() {return 0;}' | $(compiler) -x c -"`, iobuff; tee_stream=devnull) seekstart(iobuff) @test split(String(read(iobuff)), "\n")[2] == "" end From 20ad37e112b1b5bd6a60d0f186235b4a9c1b8fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 14 Jul 2021 01:42:59 +0100 Subject: [PATCH 8/8] [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. --- src/Runner.jl | 6 +----- test/runners.jl | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Runner.jl b/src/Runner.jl index fa1d3aca..df832d23 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -69,12 +69,8 @@ function ld_library_path(target::AbstractPlatform, # If requested, start with our CSL libraries for target/host, but only for architectures # that can natively run within this environment if csl_paths - # Ok, this is incredibly finicky. If the target has the same architecture as the - # host, we should have the host first then the target, otherwise we need to have - # target first. - platforms = arch(target) == arch(host) ? (host, target) : (target, host) append!(paths, - unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in platforms if Sys.islinux(p) && proc_family(p) == "intel"), + unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in (host, target) if Sys.islinux(p) && proc_family(p) == "intel"), ) end diff --git a/test/runners.jl b/test/runners.jl index f42682b5..d6da9749 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -170,10 +170,15 @@ end ./test """ cmd = `/bin/bash -c "$(test_script)"` - @test run(ur, cmd, iobuff; tee_stream=devnull) - seekstart(iobuff) - # Test that we get the output we expect - @test endswith(readchomp(iobuff), "Hello World!") + if arch(platform) == "i686" && libc(platform) == "musl" + # We can't run this program for this platform + @test_broken run(ur, cmd, iobuff; tee_stream=devnull) + else + @test run(ur, cmd, iobuff; tee_stream=devnull) + seekstart(iobuff) + # Test that we get the output we expect + @test endswith(readchomp(iobuff), "Hello World!") + end cleanup_dependencies(prefix, artifact_paths, concrete_platform) end end @@ -219,10 +224,15 @@ end ./test """ cmd = `/bin/bash -c "$(test_script)"` - @test run(ur, cmd, iobuff; tee_stream=devnull) - seekstart(iobuff) - # Test that we get the output we expect - @test endswith(readchomp(iobuff), "Hello World!") + if arch(platform) == "i686" && libc(platform) == "musl" + # We can't run C++ programs for this platform + @test_broken run(ur, cmd, iobuff; tee_stream=devnull) + else + @test run(ur, cmd, iobuff; tee_stream=devnull) + seekstart(iobuff) + # Test that we get the output we expect + @test endswith(readchomp(iobuff), "Hello World!") + end cleanup_dependencies(prefix, artifact_paths, concrete_platform) end end