diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef03ed99..d7eaea17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: version: ${{ matrix.julia-version }} arch: x64 - uses: julia-actions/julia-buildpkg@latest + - name: Clean up + run: sudo rm -rf /opt - name: System info run: julia --project=. --color=yes -e "using BinaryBuilderBase; BinaryBuilderBase.versioninfo()" - uses: julia-actions/julia-runtest@latest diff --git a/Project.toml b/Project.toml index 93614e06..3df354c8 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.0" +version = "0.6.1" [deps] CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" diff --git a/src/Runner.jl b/src/Runner.jl index 9bb38b46..ccecd4cd 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -457,7 +457,6 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr # Rust stuff function rust_flags!(p::AbstractPlatform, flags::Vector{String} = String[]) - push!(flags, "--target=$(map_rust_target(p))") if Sys.islinux(p) push!(flags, "-Clinker=$(aatriplet(p))-gcc") @@ -474,7 +473,20 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr end return flags end - rustc(io::IO, p::AbstractPlatform) = wrapper(io, "/opt/$(host_target)/bin/rustc"; flags=rust_flags!(p), allow_ccache=false) + function rustc(io::IO, p::AbstractPlatform) + extra_cmds = """ + if [[ " \${ARGS[@]} " == *'--target'* ]]; then + if ! [[ " \${ARGS[@]} " =~ --target(=| )$(map_rust_target(p)) ]]; then + echo "Attempting to invoke targeted 'rustc' wrapper with a different target! (Expected $(map_rust_target(p)))" >&2 + echo "args: \${ARGS[@]}" >&2 + exit 1 + fi + else + PRE_FLAGS+=( '--target=$(map_rust_target(p))' ) + fi + """ + wrapper(io, "/opt/$(host_target)/bin/rustc"; flags=rust_flags!(p), allow_ccache=false, extra_cmds=extra_cmds) + end rustup(io::IO, p::AbstractPlatform) = wrapper(io, "/opt/$(host_target)/bin/rustup"; allow_ccache=false) cargo(io::IO, p::AbstractPlatform) = wrapper(io, "/opt/$(host_target)/bin/cargo"; allow_ccache=false) diff --git a/test/runners.jl b/test/runners.jl index 22687abf..9eff61c2 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -189,3 +189,18 @@ end end end end + +@testset "Shards" begin + # Run the testsuite as sanity check + @testset "testsuite" begin + mktempdir() do dir + ur = preferred_runner()(dir; platform=Platform("x86_64", "linux"; libc="glibc"), preferred_gcc_version=v"5", compilers=[:c, :rust, :go]) + iobuff = IOBuffer() + test_script = raw""" + set -e + make -j${nproc} -sC /usr/share/testsuite install + """ + @test run(ur, `/bin/bash -c "$(test_script)"`, iobuff; tee_stream=devnull) + end + end +end