From ebd9be147f375ea6291ff5ebe4b5224e0bd01198 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 21:21:59 +0000 Subject: [PATCH 01/31] Enable testing against MPFR on windows-gnu --- ci/run.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index 68d13c13..179de6f9 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -218,9 +218,8 @@ esac case "$target" in # MSVC cannot link MPFR *windows-msvc*) ;; - # FIXME: MinGW should be able to build MPFR, but setup in CI is nontrivial. - *windows-gnu*) ;; # Targets that aren't cross compiled in CI work fine + *windows-gnu*) mflags+=(--features libm-test/build-mpfr) ;; aarch64*apple*) mflags+=(--features libm-test/build-mpfr) ;; aarch64*linux*) mflags+=(--features libm-test/build-mpfr) ;; i586*) mflags+=(--features libm-test/build-mpfr --features gmp-mpfr-sys/force-cross) ;; From 0e7a62d2cc2c180e79bc3a2752ebd1b9b5e561bd Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 21:23:25 +0000 Subject: [PATCH 02/31] Poke libm ci --- libm/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libm/Cargo.toml b/libm/Cargo.toml index f80715ff..521c745a 100644 --- a/libm/Cargo.toml +++ b/libm/Cargo.toml @@ -47,3 +47,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [ # compiler-builtins sets this feature, but we use it in `libm` 'cfg(feature, values("compiler-builtins"))', ] } + +# TODO drop this line, it's just to poke CI that runs on libm changes From b1fdf6bdc65b4012a18190deafba112c3a110804 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 21:25:21 +0000 Subject: [PATCH 03/31] Disable most CI targets for testing --- .github/workflows/main.yaml | 344 ++++++++++++++++++------------------ 1 file changed, 172 insertions(+), 172 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d13dd6b0..a3aa8ad3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -44,54 +44,54 @@ jobs: fail-fast: false matrix: include: - - target: aarch64-apple-darwin - os: macos-15 - - target: aarch64-unknown-linux-gnu - os: ubuntu-24.04-arm - - target: aarch64-pc-windows-msvc - os: windows-2025 - test_verbatim: 1 - build_only: 1 - - target: arm-unknown-linux-gnueabi - os: ubuntu-24.04 - - target: arm-unknown-linux-gnueabihf - os: ubuntu-24.04 - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-24.04 - - target: i586-unknown-linux-gnu - os: ubuntu-24.04 - - target: i686-unknown-linux-gnu - os: ubuntu-24.04 - - target: loongarch64-unknown-linux-gnu - os: ubuntu-24.04 - - target: powerpc-unknown-linux-gnu - os: ubuntu-24.04 - - target: powerpc64-unknown-linux-gnu - os: ubuntu-24.04 - - target: powerpc64le-unknown-linux-gnu - os: ubuntu-24.04 - - target: riscv64gc-unknown-linux-gnu - os: ubuntu-24.04 - - target: thumbv6m-none-eabi - os: ubuntu-24.04 - - target: thumbv7em-none-eabi - os: ubuntu-24.04 - - target: thumbv7em-none-eabihf - os: ubuntu-24.04 - - target: thumbv7m-none-eabi - os: ubuntu-24.04 - - target: wasm32-unknown-unknown - os: ubuntu-24.04 - - target: x86_64-unknown-linux-gnu - os: ubuntu-24.04 - - target: x86_64-apple-darwin - os: macos-13 - - target: i686-pc-windows-msvc - os: windows-2025 - test_verbatim: 1 - - target: x86_64-pc-windows-msvc - os: windows-2025 - test_verbatim: 1 + # - target: aarch64-apple-darwin + # os: macos-15 + # - target: aarch64-unknown-linux-gnu + # os: ubuntu-24.04-arm + # - target: aarch64-pc-windows-msvc + # os: windows-2025 + # test_verbatim: 1 + # build_only: 1 + # - target: arm-unknown-linux-gnueabi + # os: ubuntu-24.04 + # - target: arm-unknown-linux-gnueabihf + # os: ubuntu-24.04 + # - target: armv7-unknown-linux-gnueabihf + # os: ubuntu-24.04 + # - target: i586-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: i686-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: loongarch64-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: powerpc-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: powerpc64-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: powerpc64le-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: riscv64gc-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: thumbv6m-none-eabi + # os: ubuntu-24.04 + # - target: thumbv7em-none-eabi + # os: ubuntu-24.04 + # - target: thumbv7em-none-eabihf + # os: ubuntu-24.04 + # - target: thumbv7m-none-eabi + # os: ubuntu-24.04 + # - target: wasm32-unknown-unknown + # os: ubuntu-24.04 + # - target: x86_64-unknown-linux-gnu + # os: ubuntu-24.04 + # - target: x86_64-apple-darwin + # os: macos-13 + # - target: i686-pc-windows-msvc + # os: windows-2025 + # test_verbatim: 1 + # - target: x86_64-pc-windows-msvc + # os: windows-2025 + # test_verbatim: 1 - target: i686-pc-windows-gnu os: windows-2025 channel: nightly-i686-gnu @@ -194,143 +194,143 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo clippy --workspace --all-targets - benchmarks: - name: Benchmarks - runs-on: ubuntu-24.04 - timeout-minutes: 20 - steps: - - uses: actions/checkout@master - with: - submodules: true - - uses: taiki-e/install-action@cargo-binstall + # benchmarks: + # name: Benchmarks + # runs-on: ubuntu-24.04 + # timeout-minutes: 20 + # steps: + # - uses: actions/checkout@master + # with: + # submodules: true + # - uses: taiki-e/install-action@cargo-binstall - - name: Set up dependencies - run: | - sudo apt-get update - sudo apt-get install -y valgrind gdb libc6-dbg # Needed for iai-callgrind - rustup update "$BENCHMARK_RUSTC" --no-self-update - rustup default "$BENCHMARK_RUSTC" - # Install the version of iai-callgrind-runner that is specified in Cargo.toml - iai_version="$(cargo metadata --format-version=1 --features icount | - jq -r '.packages[] | select(.name == "iai-callgrind").version')" - cargo binstall -y iai-callgrind-runner --version "$iai_version" - sudo apt-get install valgrind - - uses: Swatinem/rust-cache@v2 + # - name: Set up dependencies + # run: | + # sudo apt-get update + # sudo apt-get install -y valgrind gdb libc6-dbg # Needed for iai-callgrind + # rustup update "$BENCHMARK_RUSTC" --no-self-update + # rustup default "$BENCHMARK_RUSTC" + # # Install the version of iai-callgrind-runner that is specified in Cargo.toml + # iai_version="$(cargo metadata --format-version=1 --features icount | + # jq -r '.packages[] | select(.name == "iai-callgrind").version')" + # cargo binstall -y iai-callgrind-runner --version "$iai_version" + # sudo apt-get install valgrind + # - uses: Swatinem/rust-cache@v2 - - name: Run icount benchmarks - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - run: ./ci/bench-icount.sh + # - name: Run icount benchmarks + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PR_NUMBER: ${{ github.event.pull_request.number }} + # run: ./ci/bench-icount.sh - - name: Upload the benchmark baseline - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BASELINE_NAME }} - path: ${{ env.BASELINE_NAME }}.tar.xz + # - name: Upload the benchmark baseline + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BASELINE_NAME }} + # path: ${{ env.BASELINE_NAME }}.tar.xz - - name: Run wall time benchmarks - run: | - # Always use the same seed for benchmarks. Ideally we should switch to a - # non-random generator. - export LIBM_SEED=benchesbenchesbenchesbencheswoo! - cargo bench --package libm-test \ - --no-default-features \ - --features short-benchmarks,build-musl,libm/force-soft-floats + # - name: Run wall time benchmarks + # run: | + # # Always use the same seed for benchmarks. Ideally we should switch to a + # # non-random generator. + # export LIBM_SEED=benchesbenchesbenchesbencheswoo! + # cargo bench --package libm-test \ + # --no-default-features \ + # --features short-benchmarks,build-musl,libm/force-soft-floats - - name: Print test logs if available - if: always() - run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi - shell: bash + # - name: Print test logs if available + # if: always() + # run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi + # shell: bash - miri: - name: Miri - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install Rust (rustup) - run: rustup update nightly --no-self-update && rustup default nightly - shell: bash - - run: rustup component add miri - - run: cargo miri setup - - uses: Swatinem/rust-cache@v2 - - run: ./ci/miri.sh + # miri: + # name: Miri + # runs-on: ubuntu-24.04 + # timeout-minutes: 10 + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Install Rust (rustup) + # run: rustup update nightly --no-self-update && rustup default nightly + # shell: bash + # - run: rustup component add miri + # - run: cargo miri setup + # - uses: Swatinem/rust-cache@v2 + # - run: ./ci/miri.sh - msrv: - name: Check libm MSRV - runs-on: ubuntu-24.04 - timeout-minutes: 10 - env: - RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings` - steps: - - uses: actions/checkout@master - - name: Install Rust - run: | - msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' libm/Cargo.toml)" - echo "MSRV: $msrv" - rustup update "$msrv" --no-self-update && rustup default "$msrv" - - uses: Swatinem/rust-cache@v2 - - run: | - # FIXME(msrv): Remove the workspace Cargo.toml so 1.63 cargo doesn't see - # `edition = "2024"` and get spooked. - rm Cargo.toml - cargo build --manifest-path libm/Cargo.toml + # msrv: + # name: Check libm MSRV + # runs-on: ubuntu-24.04 + # timeout-minutes: 10 + # env: + # RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings` + # steps: + # - uses: actions/checkout@master + # - name: Install Rust + # run: | + # msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' libm/Cargo.toml)" + # echo "MSRV: $msrv" + # rustup update "$msrv" --no-self-update && rustup default "$msrv" + # - uses: Swatinem/rust-cache@v2 + # - run: | + # # FIXME(msrv): Remove the workspace Cargo.toml so 1.63 cargo doesn't see + # # `edition = "2024"` and get spooked. + # rm Cargo.toml + # cargo build --manifest-path libm/Cargo.toml - rustfmt: - name: Rustfmt - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable `rustfmt` - run: rustup set profile minimal && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check + # rustfmt: + # name: Rustfmt + # runs-on: ubuntu-24.04 + # timeout-minutes: 10 + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Install stable `rustfmt` + # run: rustup set profile minimal && rustup default stable && rustup component add rustfmt + # - run: cargo fmt -- --check - extensive: - name: Extensive tests for ${{ matrix.ty }} - needs: - # Wait on `clippy` so we have some confidence that the crate will build - - clippy - - calculate_vars - runs-on: ubuntu-24.04 - timeout-minutes: 240 # 4 hours - strategy: - matrix: - # Use the output from `calculate_vars` to create the matrix - # FIXME: it would be better to run all jobs (i.e. all types) but mark those that - # didn't change as skipped, rather than completely excluding the job. However, - # this is not currently possible https://github.com/actions/runner/issues/1985. - include: ${{ fromJSON(needs.calculate_vars.outputs.extensive_matrix).extensive_matrix }} - env: - TO_TEST: ${{ matrix.to_test }} - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install Rust - run: | - rustup update nightly --no-self-update - rustup default nightly - - uses: Swatinem/rust-cache@v2 - - name: Run extensive tests - run: ./ci/run-extensive.sh - - name: Print test logs if available - run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi - shell: bash + # extensive: + # name: Extensive tests for ${{ matrix.ty }} + # needs: + # # Wait on `clippy` so we have some confidence that the crate will build + # - clippy + # - calculate_vars + # runs-on: ubuntu-24.04 + # timeout-minutes: 240 # 4 hours + # strategy: + # matrix: + # # Use the output from `calculate_vars` to create the matrix + # # FIXME: it would be better to run all jobs (i.e. all types) but mark those that + # # didn't change as skipped, rather than completely excluding the job. However, + # # this is not currently possible https://github.com/actions/runner/issues/1985. + # include: ${{ fromJSON(needs.calculate_vars.outputs.extensive_matrix).extensive_matrix }} + # env: + # TO_TEST: ${{ matrix.to_test }} + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Install Rust + # run: | + # rustup update nightly --no-self-update + # rustup default nightly + # - uses: Swatinem/rust-cache@v2 + # - name: Run extensive tests + # run: ./ci/run-extensive.sh + # - name: Print test logs if available + # run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi + # shell: bash success: needs: - - benchmarks + # - benchmarks - clippy - - extensive - - miri - - msrv - - rustfmt + # - extensive + # - miri + # - msrv + # - rustfmt - test runs-on: ubuntu-24.04 timeout-minutes: 10 From be88a3156ead3ecd59f5308908805d7fbe0a3a09 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 21:30:53 +0000 Subject: [PATCH 04/31] simplify CI more, exclude tests of compiler-builtins --- ci/run.sh | 290 +++++++++++++++++++++++++++--------------------------- 1 file changed, 145 insertions(+), 145 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index 179de6f9..4ff7341c 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -25,152 +25,152 @@ if [ "${USING_CONTAINER_RUSTC:-}" = 1 ]; then rustup target add "$target" fi -# Test our implementation -if [ "${BUILD_ONLY:-}" = "1" ]; then - echo "no tests to run for build-only targets" -else - test_builtins=(cargo test --package builtins-test --no-fail-fast --target "$target") - "${test_builtins[@]}" - "${test_builtins[@]}" --release - "${test_builtins[@]}" --features c - "${test_builtins[@]}" --features c --release - "${test_builtins[@]}" --features no-asm - "${test_builtins[@]}" --features no-asm --release - "${test_builtins[@]}" --features no-f16-f128 - "${test_builtins[@]}" --features no-f16-f128 --release - "${test_builtins[@]}" --benches - "${test_builtins[@]}" --benches --release - - if [ "${TEST_VERBATIM:-}" = "1" ]; then - verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2) - "${test_builtins[@]}" --target-dir "$verb_path" --features c - fi -fi - - -declare -a rlib_paths - -# Set the `rlib_paths` global array to a list of all compiler-builtins rlibs -update_rlib_paths() { - if [ -d /builtins-target ]; then - rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib ) - else - rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib ) - fi -} - -# Remove any existing artifacts from previous tests that don't set #![compiler_builtins] -update_rlib_paths -rm -f "${rlib_paths[@]}" - -cargo build -p compiler_builtins --target "$target" -cargo build -p compiler_builtins --target "$target" --release -cargo build -p compiler_builtins --target "$target" --features c -cargo build -p compiler_builtins --target "$target" --features c --release -cargo build -p compiler_builtins --target "$target" --features no-asm -cargo build -p compiler_builtins --target "$target" --features no-asm --release -cargo build -p compiler_builtins --target "$target" --features no-f16-f128 -cargo build -p compiler_builtins --target "$target" --features no-f16-f128 --release - -PREFIX=${target//unknown-/}- -case "$target" in - armv7-*) - PREFIX=arm-linux-gnueabihf- - ;; - thumb*) - PREFIX=arm-none-eabi- - ;; - *86*-*) - PREFIX= - ;; -esac - -NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) ) -if [ "$NM" = "" ]; then - NM="${PREFIX}nm" -fi - -# i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with -# rustup run to ensure that those are in PATH. -TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')" -if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then - NM="rustup run $TOOLCHAIN $NM" -fi - -# Look out for duplicated symbols when we include the compiler-rt (C) implementation -update_rlib_paths -for rlib in "${rlib_paths[@]}"; do - set +x - echo "================================================================" - echo "checking $rlib for duplicate symbols" - echo "================================================================" - set -x +# # Test our implementation +# if [ "${BUILD_ONLY:-}" = "1" ]; then +# echo "no tests to run for build-only targets" +# else +# test_builtins=(cargo test --package builtins-test --no-fail-fast --target "$target") +# "${test_builtins[@]}" +# "${test_builtins[@]}" --release +# "${test_builtins[@]}" --features c +# "${test_builtins[@]}" --features c --release +# "${test_builtins[@]}" --features no-asm +# "${test_builtins[@]}" --features no-asm --release +# "${test_builtins[@]}" --features no-f16-f128 +# "${test_builtins[@]}" --features no-f16-f128 --release +# "${test_builtins[@]}" --benches +# "${test_builtins[@]}" --benches --release + +# if [ "${TEST_VERBATIM:-}" = "1" ]; then +# verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2) +# "${test_builtins[@]}" --target-dir "$verb_path" --features c +# fi +# fi + + +# declare -a rlib_paths + +# # Set the `rlib_paths` global array to a list of all compiler-builtins rlibs +# update_rlib_paths() { +# if [ -d /builtins-target ]; then +# rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib ) +# else +# rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib ) +# fi +# } + +# # Remove any existing artifacts from previous tests that don't set #![compiler_builtins] +# update_rlib_paths +# rm -f "${rlib_paths[@]}" + +# cargo build -p compiler_builtins --target "$target" +# cargo build -p compiler_builtins --target "$target" --release +# cargo build -p compiler_builtins --target "$target" --features c +# cargo build -p compiler_builtins --target "$target" --features c --release +# cargo build -p compiler_builtins --target "$target" --features no-asm +# cargo build -p compiler_builtins --target "$target" --features no-asm --release +# cargo build -p compiler_builtins --target "$target" --features no-f16-f128 +# cargo build -p compiler_builtins --target "$target" --features no-f16-f128 --release + +# PREFIX=${target//unknown-/}- +# case "$target" in +# armv7-*) +# PREFIX=arm-linux-gnueabihf- +# ;; +# thumb*) +# PREFIX=arm-none-eabi- +# ;; +# *86*-*) +# PREFIX= +# ;; +# esac + +# NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) ) +# if [ "$NM" = "" ]; then +# NM="${PREFIX}nm" +# fi + +# # i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with +# # rustup run to ensure that those are in PATH. +# TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')" +# if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then +# NM="rustup run $TOOLCHAIN $NM" +# fi + +# # Look out for duplicated symbols when we include the compiler-rt (C) implementation +# update_rlib_paths +# for rlib in "${rlib_paths[@]}"; do +# set +x +# echo "================================================================" +# echo "checking $rlib for duplicate symbols" +# echo "================================================================" +# set -x - duplicates_found=0 - - # NOTE On i586, It's normal that the get_pc_thunk symbol appears several - # times so ignore it - $NM -g --defined-only "$rlib" 2>&1 | - sort | - uniq -d | - grep -v __x86.get_pc_thunk --quiet | - grep 'T __' && duplicates_found=1 - - if [ "$duplicates_found" != 0 ]; then - echo "error: found duplicate symbols" - exit 1 - else - echo "success; no duplicate symbols found" - fi -done - -rm -f "${rlib_paths[@]}" - -build_intrinsics_test() { - cargo build \ - --target "$target" --verbose \ - --manifest-path builtins-test-intrinsics/Cargo.toml "$@" -} - -# Verify that we haven't dropped any intrinsics/symbols -build_intrinsics_test -build_intrinsics_test --release -build_intrinsics_test --features c -build_intrinsics_test --features c --release - -# Verify that there are no undefined symbols to `panic` within our -# implementations -CARGO_PROFILE_DEV_LTO=true build_intrinsics_test -CARGO_PROFILE_RELEASE_LTO=true build_intrinsics_test --release - -# Ensure no references to any symbols from core -update_rlib_paths -for rlib in "${rlib_paths[@]}"; do - set +x - echo "================================================================" - echo "checking $rlib for references to core" - echo "================================================================" - set -x - - tmpdir="${CARGO_TARGET_DIR:-target}/tmp" - test -d "$tmpdir" || mkdir "$tmpdir" - defined="$tmpdir/defined_symbols.txt" - undefined="$tmpdir/defined_symbols.txt" - - $NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined" - $NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined" - grep_has_results=0 - grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1 - - if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then - echo "FIXME: powerpc64 fails these tests" - elif [ "$grep_has_results" != 0 ]; then - echo "error: found unexpected references to core" - exit 1 - else - echo "success; no references to core found" - fi -done +# duplicates_found=0 + +# # NOTE On i586, It's normal that the get_pc_thunk symbol appears several +# # times so ignore it +# $NM -g --defined-only "$rlib" 2>&1 | +# sort | +# uniq -d | +# grep -v __x86.get_pc_thunk --quiet | +# grep 'T __' && duplicates_found=1 + +# if [ "$duplicates_found" != 0 ]; then +# echo "error: found duplicate symbols" +# exit 1 +# else +# echo "success; no duplicate symbols found" +# fi +# done + +# rm -f "${rlib_paths[@]}" + +# build_intrinsics_test() { +# cargo build \ +# --target "$target" --verbose \ +# --manifest-path builtins-test-intrinsics/Cargo.toml "$@" +# } + +# # Verify that we haven't dropped any intrinsics/symbols +# build_intrinsics_test +# build_intrinsics_test --release +# build_intrinsics_test --features c +# build_intrinsics_test --features c --release + +# # Verify that there are no undefined symbols to `panic` within our +# # implementations +# CARGO_PROFILE_DEV_LTO=true build_intrinsics_test +# CARGO_PROFILE_RELEASE_LTO=true build_intrinsics_test --release + +# # Ensure no references to any symbols from core +# update_rlib_paths +# for rlib in "${rlib_paths[@]}"; do +# set +x +# echo "================================================================" +# echo "checking $rlib for references to core" +# echo "================================================================" +# set -x + +# tmpdir="${CARGO_TARGET_DIR:-target}/tmp" +# test -d "$tmpdir" || mkdir "$tmpdir" +# defined="$tmpdir/defined_symbols.txt" +# undefined="$tmpdir/defined_symbols.txt" + +# $NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined" +# $NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined" +# grep_has_results=0 +# grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1 + +# if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then +# echo "FIXME: powerpc64 fails these tests" +# elif [ "$grep_has_results" != 0 ]; then +# echo "error: found unexpected references to core" +# exit 1 +# else +# echo "success; no references to core found" +# fi +# done # Test libm From d71d141916d6966c3fac537029ed34731c38b71d Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 21:42:50 +0000 Subject: [PATCH 05/31] Create a setup script --- .github/workflows/main.yaml | 5 +++++ ci/setup-windows.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 ci/setup-windows.sh diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a3aa8ad3..21da37c8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -152,6 +152,11 @@ jobs: if: matrix.os == 'ubuntu-24.04' run: python3 etc/update-api-list.py --check + - name: Windows CI setup + if: matrix.os == 'windows-2025' + shell: bash + run: ./ci/setup-windows.sh ${{ matrix.target }} + # Non-linux tests just use our raw script - name: Run locally if: matrix.os != 'ubuntu-24.04' diff --git a/ci/setup-windows.sh b/ci/setup-windows.sh new file mode 100755 index 00000000..df504bf3 --- /dev/null +++ b/ci/setup-windows.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eux + +ls / +ls /c/msys64 + +export PATH="/c/msys64:$PATH" + +pacman install m4 + +mv -h From 07438bd2d7b7a28ceaa5f3d224137ac9a04338fb Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 22:19:24 +0000 Subject: [PATCH 06/31] try with msys2 shell --- .github/workflows/main.yaml | 107 +++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 21da37c8..db38eab7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -124,63 +124,72 @@ jobs: - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - - name: Cache Docker layers - uses: actions/cache@v4 - if: matrix.os == 'ubuntu-24.04' - with: - path: /tmp/.buildx-cache - key: ${{ matrix.target }}-buildx-${{ github.sha }} - restore-keys: ${{ matrix.target }}-buildx- - # Configure buildx to use Docker layer caching - - uses: docker/setup-buildx-action@v3 - if: matrix.os == 'ubuntu-24.04' + # - name: Cache Docker layers + # uses: actions/cache@v4 + # if: matrix.os == 'ubuntu-24.04' + # with: + # path: /tmp/.buildx-cache + # key: ${{ matrix.target }}-buildx-${{ github.sha }} + # restore-keys: ${{ matrix.target }}-buildx- + # # Configure buildx to use Docker layer caching + # - uses: docker/setup-buildx-action@v3 + # if: matrix.os == 'ubuntu-24.04' - - name: Cache compiler-rt - id: cache-compiler-rt - uses: actions/cache@v4 - with: - path: compiler-rt - key: ${{ runner.os }}-compiler-rt-${{ hashFiles('ci/download-compiler-rt.sh') }} - - name: Download compiler-rt reference sources - if: steps.cache-compiler-rt.outputs.cache-hit != 'true' - run: ./ci/download-compiler-rt.sh - shell: bash - - run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV" - shell: bash + # - name: Cache compiler-rt + # id: cache-compiler-rt + # uses: actions/cache@v4 + # with: + # path: compiler-rt + # key: ${{ runner.os }}-compiler-rt-${{ hashFiles('ci/download-compiler-rt.sh') }} + # - name: Download compiler-rt reference sources + # if: steps.cache-compiler-rt.outputs.cache-hit != 'true' + # run: ./ci/download-compiler-rt.sh + # shell: bash + # - run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV" + # shell: bash - - name: Verify API list - if: matrix.os == 'ubuntu-24.04' - run: python3 etc/update-api-list.py --check + # - name: Verify API list + # if: matrix.os == 'ubuntu-24.04' + # run: python3 etc/update-api-list.py --check - - name: Windows CI setup + - uses: msys2/setup-msys2@v2 if: matrix.os == 'windows-2025' - shell: bash - run: ./ci/setup-windows.sh ${{ matrix.target }} + with: + msystem: UCRT64 + update: true + install: m4 - # Non-linux tests just use our raw script - - name: Run locally - if: matrix.os != 'ubuntu-24.04' - shell: bash - run: ./ci/run.sh ${{ matrix.target }} + - name: Run on Windows + if: matrix.os == 'windows-2025' + shell: msys2 {0} + run: + ./ci/setup-windows.sh ${{ matrix.target }} + ./ci/run.sh ${{ matrix.target }} - # Otherwise we use our docker containers to run builds - - name: Run in Docker - if: matrix.os == 'ubuntu-24.04' - run: ./ci/run-docker.sh ${{ matrix.target }} + # # Non-linux tests just use our raw script + # - name: Run locally + # if: matrix.os != 'ubuntu-24.04' + # shell: bash + # run: ./ci/run.sh ${{ matrix.target }} - - name: Print test logs if available - if: always() - run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi - shell: bash + # # Otherwise we use our docker containers to run builds + # - name: Run in Docker + # if: matrix.os == 'ubuntu-24.04' + # run: ./ci/run-docker.sh ${{ matrix.target }} - # Workaround to keep Docker cache smaller - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move Docker cache - if: matrix.os == 'ubuntu-24.04' - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + # - name: Print test logs if available + # if: always() + # run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi + # shell: bash + + # # Workaround to keep Docker cache smaller + # # https://github.com/docker/build-push-action/issues/252 + # # https://github.com/moby/buildkit/issues/1896 + # - name: Move Docker cache + # if: matrix.os == 'ubuntu-24.04' + # run: | + # rm -rf /tmp/.buildx-cache + # mv /tmp/.buildx-cache-new /tmp/.buildx-cache clippy: name: Clippy From 3eec0301bd431b1630cb923e15451e86408c075a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 22:21:59 +0000 Subject: [PATCH 07/31] install more --- .github/workflows/main.yaml | 2 +- ci/setup-windows.sh | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index db38eab7..f80cfeaf 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -157,7 +157,7 @@ jobs: with: msystem: UCRT64 update: true - install: m4 + install: diffutils m4 make - name: Run on Windows if: matrix.os == 'windows-2025' diff --git a/ci/setup-windows.sh b/ci/setup-windows.sh index df504bf3..308d297d 100755 --- a/ci/setup-windows.sh +++ b/ci/setup-windows.sh @@ -2,11 +2,5 @@ set -eux -ls / -ls /c/msys64 - -export PATH="/c/msys64:$PATH" - -pacman install m4 - -mv -h +m4 --help +make --help From b565efc2923d79369d881926696606434a5fd3dc Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 22:46:16 +0000 Subject: [PATCH 08/31] fix script --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f80cfeaf..1191cdcc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -162,7 +162,7 @@ jobs: - name: Run on Windows if: matrix.os == 'windows-2025' shell: msys2 {0} - run: + run: | ./ci/setup-windows.sh ${{ matrix.target }} ./ci/run.sh ${{ matrix.target }} From 69fd4c910d382c20b63ab43f09ff38323a19851a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:09:03 +0000 Subject: [PATCH 09/31] install rustup --- .github/workflows/main.yaml | 2 +- ci/setup-windows.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1191cdcc..950cf6ef 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -157,7 +157,7 @@ jobs: with: msystem: UCRT64 update: true - install: diffutils m4 make + install: diffutils m4 make rustup - name: Run on Windows if: matrix.os == 'windows-2025' diff --git a/ci/setup-windows.sh b/ci/setup-windows.sh index 308d297d..897f3105 100755 --- a/ci/setup-windows.sh +++ b/ci/setup-windows.sh @@ -2,5 +2,11 @@ set -eux +target="$1" + m4 --help make --help + +rustup update nightly-x86_64-gnu +rustup default nightly-x86_64-gnu +rustup target add "$target" From 9e698119b32d0698acacf0ff0ef0621afdee9032 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:14:53 +0000 Subject: [PATCH 10/31] try installing rustup again? --- .github/workflows/main.yaml | 5 ++--- ci/{setup-windows.sh => run-windows.sh} | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) rename ci/{setup-windows.sh => run-windows.sh} (81%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 950cf6ef..6927e3b0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -157,14 +157,13 @@ jobs: with: msystem: UCRT64 update: true - install: diffutils m4 make rustup + install: diffutils m4 make mingw-w64-rustup - name: Run on Windows if: matrix.os == 'windows-2025' shell: msys2 {0} run: | - ./ci/setup-windows.sh ${{ matrix.target }} - ./ci/run.sh ${{ matrix.target }} + ./ci/run-windows.sh ${{ matrix.target }} # # Non-linux tests just use our raw script # - name: Run locally diff --git a/ci/setup-windows.sh b/ci/run-windows.sh similarity index 81% rename from ci/setup-windows.sh rename to ci/run-windows.sh index 897f3105..ab05c3e3 100755 --- a/ci/setup-windows.sh +++ b/ci/run-windows.sh @@ -10,3 +10,5 @@ make --help rustup update nightly-x86_64-gnu rustup default nightly-x86_64-gnu rustup target add "$target" + +./ci/run.sh ${{ matrix.target }} From cb622264c1c82dce857c801527005839fa6b6800 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:21:21 +0000 Subject: [PATCH 11/31] install rustup from the script --- .github/workflows/main.yaml | 2 +- ci/run-windows.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6927e3b0..58683a02 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -157,7 +157,7 @@ jobs: with: msystem: UCRT64 update: true - install: diffutils m4 make mingw-w64-rustup + install: diffutils m4 make # mingw-w64-rustup - name: Run on Windows if: matrix.os == 'windows-2025' diff --git a/ci/run-windows.sh b/ci/run-windows.sh index ab05c3e3..f088091c 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -7,8 +7,14 @@ target="$1" m4 --help make --help -rustup update nightly-x86_64-gnu -rustup default nightly-x86_64-gnu -rustup target add "$target" +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | + sh --default-toolchain nightly-x86_64-gnu \ + --target "$target" \ + +cargo -vV + +# rustup update nightly-x86_64-gnu +# rustup default nightly-x86_64-gnu +# rustup target add "$target" ./ci/run.sh ${{ matrix.target }} From 53de1aa2cd653fca50f51314270f80aace5d5c09 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:25:41 +0000 Subject: [PATCH 12/31] fix sh --- ci/run-windows.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index f088091c..3c8a783b 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -7,9 +7,9 @@ target="$1" m4 --help make --help -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh --default-toolchain nightly-x86_64-gnu \ - --target "$target" \ +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ + --default-toolchain nightly-x86_64-gnu \ + --target "$target" cargo -vV @@ -17,4 +17,4 @@ cargo -vV # rustup default nightly-x86_64-gnu # rustup target add "$target" -./ci/run.sh ${{ matrix.target }} +./ci/run.sh "$target" From a43a375e0878c0590773f78258009a9e41c55c7a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:34:35 +0000 Subject: [PATCH 13/31] disable interactive --- ci/run-windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 3c8a783b..5ece2c00 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -9,7 +9,7 @@ make --help curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --default-toolchain nightly-x86_64-gnu \ - --target "$target" + --target "$target" -y cargo -vV From f20d0e6fd4b4dcfff95617ba8bb8f030492a4a11 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:41:15 +0000 Subject: [PATCH 14/31] don't try to run cargo --- .github/workflows/main.yaml | 28 ++++++++++++++-------------- ci/run-windows.sh | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 58683a02..2497324d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -110,20 +110,20 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - name: Install Rust (rustup) - shell: bash - run: | - channel="nightly" - # Account for channels that have required components (MinGW) - [ -n "${{ matrix.channel }}" ] && channel="${{ matrix.channel }}" - rustup update "$channel" --no-self-update - rustup default "$channel" - rustup target add "${{ matrix.target }}" - rustup component add llvm-tools-preview - - uses: taiki-e/install-action@nextest - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} + # - name: Install Rust (rustup) + # shell: bash + # run: | + # channel="nightly" + # # Account for channels that have required components (MinGW) + # [ -n "${{ matrix.channel }}" ] && channel="${{ matrix.channel }}" + # rustup update "$channel" --no-self-update + # rustup default "$channel" + # rustup target add "${{ matrix.target }}" + # rustup component add llvm-tools-preview + # - uses: taiki-e/install-action@nextest + # - uses: Swatinem/rust-cache@v2 + # with: + # key: ${{ matrix.target }} # - name: Cache Docker layers # uses: actions/cache@v4 # if: matrix.os == 'ubuntu-24.04' diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 5ece2c00..e85b7e10 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -11,7 +11,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --default-toolchain nightly-x86_64-gnu \ --target "$target" -y -cargo -vV +# cargo -vV # rustup update nightly-x86_64-gnu # rustup default nightly-x86_64-gnu From 3e349371fc37b9aa9cb8780fa299406be68630e8 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:44:24 +0000 Subject: [PATCH 15/31] inspect path --- .github/workflows/main.yaml | 1 + ci/run-windows.sh | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2497324d..cac20af1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -164,6 +164,7 @@ jobs: shell: msys2 {0} run: | ./ci/run-windows.sh ${{ matrix.target }} + ./ci/run.sh ${{ matrix.target }} # # Non-linux tests just use our raw script # - name: Run locally diff --git a/ci/run-windows.sh b/ci/run-windows.sh index e85b7e10..2e7fc2dd 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -7,14 +7,11 @@ target="$1" m4 --help make --help +echo "$PATH" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --default-toolchain nightly-x86_64-gnu \ - --target "$target" -y - -# cargo -vV - -# rustup update nightly-x86_64-gnu -# rustup default nightly-x86_64-gnu -# rustup target add "$target" + --target "$target" \ + --profile minimal -y -./ci/run.sh "$target" +echo "$PATH" From 37e0106941ccb26e146f5067515943b3b60309e9 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 23:48:07 +0000 Subject: [PATCH 16/31] try splitting so path reloads --- .github/workflows/main.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cac20af1..fd5f76df 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -159,11 +159,16 @@ jobs: update: true install: diffutils m4 make # mingw-w64-rustup - - name: Run on Windows + - name: Setup windows if: matrix.os == 'windows-2025' shell: msys2 {0} run: | ./ci/run-windows.sh ${{ matrix.target }} + + - name: Run on Windows + if: matrix.os == 'windows-2025' + shell: msys2 {0} + run: | ./ci/run.sh ${{ matrix.target }} # # Non-linux tests just use our raw script From 67ea5cef2f2b9430de3f317e09b35ed6fd8c8177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 17:48:06 +0200 Subject: [PATCH 17/31] Add Cargo bin dir to PATH --- ci/run-windows.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 2e7fc2dd..c7cf3249 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,4 +14,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y +export PATH="$USERPROFILE/.cargo.bin:$PATH" + echo "$PATH" From f16c627971ac6ba60152c8eda3b0bf11f7e052ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 17:59:55 +0200 Subject: [PATCH 18/31] Fix the path --- ci/run-windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index c7cf3249..4a0846cf 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y -export PATH="$USERPROFILE/.cargo.bin:$PATH" +export PATH="/c/Users/$USERNAME/.cargo.bin:$PATH" echo "$PATH" From eef45f85ab82e2daaf882863800b3a4fe29f1709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:08:16 +0200 Subject: [PATCH 19/31] Typo --- ci/run-windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 4a0846cf..90d7c80b 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y -export PATH="/c/Users/$USERNAME/.cargo.bin:$PATH" +export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH" echo "$PATH" From 2b4552acbeecea3c468fe6894b504e7d21e41649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:12:37 +0200 Subject: [PATCH 20/31] Try with bashrc --- ci/run-windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 90d7c80b..9689cd7f 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y -export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH" +echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bashrc echo "$PATH" From 31f8c14c7445fbbd15087fb3b59b4764194144fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:18:26 +0200 Subject: [PATCH 21/31] DBG --- ci/run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/run.sh b/ci/run.sh index 4ff7341c..4e28cdcd 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -2,6 +2,10 @@ set -eux +echo PATH_DBG +echo $PATH +ls /c/Users/$USERNAME/.cargo/bin + export RUST_BACKTRACE="${RUST_BACKTRACE:-full}" export NEXTEST_STATUS_LEVEL=all From db0dcf7e390bdc56ff863ff897930f67dfa20a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:24:48 +0200 Subject: [PATCH 22/31] Try inheriting the PATH --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fd5f76df..6628d186 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -158,6 +158,7 @@ jobs: msystem: UCRT64 update: true install: diffutils m4 make # mingw-w64-rustup + path-type: inherit - name: Setup windows if: matrix.os == 'windows-2025' From cc67a46464b8a25c8cd2a07a65576e223b74dd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:38:05 +0200 Subject: [PATCH 23/31] profile instead of bashrc --- ci/run-windows.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 9689cd7f..8976a4b1 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y -echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bashrc +ls ~/ +echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.profile echo "$PATH" From 66c8caeb04c8aecf81544d8c3bbadae9c17ce191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:44:55 +0200 Subject: [PATCH 24/31] bash_profile? --- ci/run-windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 8976a4b1..e0df58e7 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -15,6 +15,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --profile minimal -y ls ~/ -echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.profile +echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bash_profile echo "$PATH" From cdc7d441daa2e3e700bb401319faae4670cfbfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 18:56:51 +0200 Subject: [PATCH 25/31] revert path inheritance --- .github/workflows/main.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6628d186..fd5f76df 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -158,7 +158,6 @@ jobs: msystem: UCRT64 update: true install: diffutils m4 make # mingw-w64-rustup - path-type: inherit - name: Setup windows if: matrix.os == 'windows-2025' From e306e0f98605ce19c5f921b2f6e7085abc9724e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 19:21:06 +0200 Subject: [PATCH 26/31] Install correct C toolchain --- ci/run-windows.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index e0df58e7..14cd6ad2 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,8 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y +pacboy -S toolchain + ls ~/ echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bash_profile From 16b581f82c6625324fe1f4aa75d5c4ce4201931c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 19:27:12 +0200 Subject: [PATCH 27/31] Install pactoys --- ci/run-windows.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 14cd6ad2..b7b334e5 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -14,6 +14,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target "$target" \ --profile minimal -y +# Wrapper to ease managerment of environments +pacman -S pactoys +# Install C toolchain according to `MSYSTEM` pacboy -S toolchain ls ~/ From c40da28b1446cdb4309b24476a80707aace35b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 3 May 2025 19:33:56 +0200 Subject: [PATCH 28/31] --noconfirm --- ci/run-windows.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index b7b334e5..99dda03d 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -15,9 +15,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --profile minimal -y # Wrapper to ease managerment of environments -pacman -S pactoys +pacman --noconfirm -S pactoys # Install C toolchain according to `MSYSTEM` -pacboy -S toolchain +pacboy --noconfirm -S toolchain ls ~/ echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bash_profile From 03821457b9d8b8e44e82e079c98687e91701cf27 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 5 May 2025 06:00:57 +0000 Subject: [PATCH 29/31] print logs --- .github/workflows/main.yaml | 11 +++++++---- ci/run.sh | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fd5f76df..2562458a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -182,10 +182,13 @@ jobs: # if: matrix.os == 'ubuntu-24.04' # run: ./ci/run-docker.sh ${{ matrix.target }} - # - name: Print test logs if available - # if: always() - # run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi - # shell: bash + - name: Print test logs if available + if: always() + run: | + if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi + set -x + find . -name 'config.log' -exec cat {} ';' + shell: bash # # Workaround to keep Docker cache smaller # # https://github.com/docker/build-push-action/issues/252 diff --git a/ci/run.sh b/ci/run.sh index 4e28cdcd..683fe4cb 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -223,6 +223,7 @@ case "$target" in # MSVC cannot link MPFR *windows-msvc*) ;; # Targets that aren't cross compiled in CI work fine + i686-pc-windows-gnu) mflags+=(--features libm-test/build-mpfr --features gmp-mpfr-sys/force-cross) ;; *windows-gnu*) mflags+=(--features libm-test/build-mpfr) ;; aarch64*apple*) mflags+=(--features libm-test/build-mpfr) ;; aarch64*linux*) mflags+=(--features libm-test/build-mpfr) ;; From ec28929f420361438f97d65e27f840b195d1405b Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 5 May 2025 06:43:01 +0000 Subject: [PATCH 30/31] print more --- ci/run-windows.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 99dda03d..3a543cc0 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -19,7 +19,11 @@ pacman --noconfirm -S pactoys # Install C toolchain according to `MSYSTEM` pacboy --noconfirm -S toolchain +pacman --noconfirm -S mingw-w64-x86_64-toolchain + ls ~/ echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bash_profile echo "$PATH" + +rustc -vV From f929fdbe87c0d6e33d04d269438510749ba85d24 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 5 May 2025 06:51:17 +0000 Subject: [PATCH 31/31] fix log --- .github/workflows/main.yaml | 2 ++ ci/run-windows.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2562458a..1ec64037 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -169,6 +169,8 @@ jobs: if: matrix.os == 'windows-2025' shell: msys2 {0} run: | + rustc -vV + rustup show ./ci/run.sh ${{ matrix.target }} # # Non-linux tests just use our raw script diff --git a/ci/run-windows.sh b/ci/run-windows.sh index 3a543cc0..cc8e076d 100755 --- a/ci/run-windows.sh +++ b/ci/run-windows.sh @@ -21,9 +21,9 @@ pacboy --noconfirm -S toolchain pacman --noconfirm -S mingw-w64-x86_64-toolchain +# maybe only need mingw-w64-x86_64-gcc? + ls ~/ echo 'export PATH="/c/Users/$USERNAME/.cargo/bin:$PATH"' >> ~/.bash_profile echo "$PATH" - -rustc -vV