From 57efacea9f250ca9f9d02fd23301b772d05611ee Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 10 Jun 2021 03:50:20 +0900 Subject: [PATCH 1/4] Turn on WASI CI --- .github/workflows/bors.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml index 241940a8236e3..194415590ea88 100644 --- a/.github/workflows/bors.yml +++ b/.github/workflows/bors.yml @@ -129,8 +129,7 @@ jobs: powerpc64le-unknown-linux-gnu, s390x-unknown-linux-gnu, riscv64gc-unknown-linux-gnu, - # FIXME: Figure out why this is disabled. - #wasm32-wasi, + wasm32-wasi, sparc64-unknown-linux-gnu, wasm32-unknown-emscripten, x86_64-linux-android, From 5315a95482227a6572026bde8202322a7d363462 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 10 Jun 2021 03:53:31 +0900 Subject: [PATCH 2/4] DNM: Shrink CI config for testing --- .github/workflows/bors.yml | 246 ------------------------------------- .github/workflows/main.yml | 68 ---------- 2 files changed, 314 deletions(-) diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml index 194415590ea88..63a3f381470b5 100644 --- a/.github/workflows/bors.yml +++ b/.github/workflows/bors.yml @@ -7,86 +7,9 @@ on: - try jobs: - docker_linux_tier1: - name: Docker Linux Tier1 - runs-on: ubuntu-20.04 - strategy: - fail-fast: true - matrix: - target: [ - i686-unknown-linux-gnu, - x86_64-unknown-linux-gnu, - ] - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} - - macos: - name: macOS - runs-on: macos-10.15 - strategy: - fail-fast: true - matrix: - target: [ - x86_64-apple-darwin, - ] - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - - windows: - name: Windows - runs-on: windows-2019 - env: - OS: windows - strategy: - fail-fast: true - matrix: - include: - - target: x86_64-pc-windows-gnu - env: - ARCH_BITS: 64 - ARCH: x86_64 - - target: x86_64-pc-windows-msvc - # Disabled because broken: - # https://github.com/rust-lang/libc/issues/1592 - #- target: i686-pc-windows-gnu - # env: - # ARCH_BITS: 32 - # ARCH: i686 - - target: i686-pc-windows-msvc - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Self-update rustup - run: rustup self update - shell: bash - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - shell: bash - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - shell: bash - style_check: name: Style check runs-on: ubuntu-20.04 - strategy: - fail-fast: true steps: - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master with: @@ -99,45 +22,13 @@ jobs: docker_linux_tier2: name: Docker Linux Tier2 - needs: [docker_linux_tier1, style_check] runs-on: ubuntu-20.04 strategy: fail-fast: true max-parallel: 12 matrix: target: [ - # FIXME: Mysterious failures in CI, see - # https://github.com/rust-lang/libc/issues/2081 - # aarch64-linux-android, - aarch64-unknown-linux-gnu, - aarch64-unknown-linux-musl, - arm-linux-androideabi, - arm-unknown-linux-gnueabihf, - arm-unknown-linux-musleabihf, - asmjs-unknown-emscripten, - i686-linux-android, - i686-unknown-linux-musl, - mips-unknown-linux-gnu, - mips-unknown-linux-musl, - # FIXME: Somehow failed on CI - # https://github.com/rust-lang/libc/runs/1659882216 - # mips64-unknown-linux-gnuabi64, - # mips64el-unknown-linux-gnuabi64, - mipsel-unknown-linux-musl, - powerpc-unknown-linux-gnu, - powerpc64-unknown-linux-gnu, - powerpc64le-unknown-linux-gnu, - s390x-unknown-linux-gnu, - riscv64gc-unknown-linux-gnu, wasm32-wasi, - sparc64-unknown-linux-gnu, - wasm32-unknown-emscripten, - x86_64-linux-android, - x86_64-unknown-linux-gnux32, - x86_64-unknown-linux-musl, - # FIXME: It seems some items in `src/unix/mod.rs` - # aren't defined on redox actually. - # x86_64-unknown-redox, ] steps: - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master @@ -149,129 +40,6 @@ jobs: - name: Execute run-docker.sh run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} - # devkitpro's pacman needs to be connected from Docker. - docker_switch: - name: Docker Switch - needs: [docker_linux_tier1, style_check] - runs-on: ubuntu-20.04 - strategy: - fail-fast: true - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: sh ./ci/install-rust.sh - - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh switch - - build_channels_linux: - name: Build Channels Linux - needs: docker_linux_tier2 - runs-on: ubuntu-20.04 - env: - OS: linux - strategy: - fail-fast: true - max-parallel: 5 - matrix: - toolchain: [ - stable, - beta, - nightly, - 1.13.0, - 1.19.0, - 1.24.0, - 1.25.0, - 1.30.0, - ] - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh - - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh - - build_channels_macos: - name: Build Channels macOS - needs: macos - runs-on: macos-10.15 - env: - OS: macos - strategy: - fail-fast: true - max-parallel: 4 - matrix: - toolchain: [ - stable, - beta, - nightly, - 1.13.0, - 1.19.0, - 1.24.0, - 1.25.0, - 1.30.0, - ] - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh - - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh - - semver_linux: - name: Semver Linux - needs: build_channels_linux - runs-on: ubuntu-20.04 - continue-on-error: true - strategy: - fail-fast: true - steps: - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - # Should update the semverver revision in semver.sh if we touch nightly ver. - run: TOOLCHAIN=nightly-2020-11-19 sh ./ci/install-rust.sh - - name: Check breaking changes - run: sh ci/semver.sh linux - - semver_macos: - name: Semver macOS - needs: build_channels_macos - runs-on: macos-10.15 - continue-on-error: true - strategy: - fail-fast: true - steps: - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - # FIXME: Pin nightly version to make semverver compilable. - run: TOOLCHAIN=nightly-2020-11-19 sh ./ci/install-rust.sh - - name: Check breaking changes - run: sh ci/semver.sh macos - - docs: - name: Generate documentation - runs-on: ubuntu-20.04 - needs: docker_linux_tier2 - strategy: - fail-fast: true - steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: sh ./ci/install-rust.sh - - name: Generate documentation - run: LIBC_CI=1 sh ci/dox.sh - # These jobs doesn't actually test anything, but they're only used to tell # bors the build completed, as there is no practical way to detect when a # workflow is successful listening to webhooks only. @@ -283,15 +51,8 @@ jobs: if: github.event.pusher.name == 'bors' && success() runs-on: ubuntu-20.04 needs: [ - docker_linux_tier1, docker_linux_tier2, - macos, - windows, style_check, - docker_switch, - build_channels_linux, - build_channels_macos, - docs, ] steps: @@ -303,15 +64,8 @@ jobs: if: github.event.pusher.name == 'bors' && (failure() || cancelled()) runs-on: ubuntu-20.04 needs: [ - docker_linux_tier1, docker_linux_tier2, - macos, - windows, style_check, - docker_switch, - build_channels_linux, - build_channels_macos, - docs, ] steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06f02c2660d9b..20cc301509eba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,77 +8,9 @@ on: - master jobs: - docker_linux_tier1: - name: Docker Linux Tier1 - runs-on: ubuntu-20.04 - strategy: - fail-fast: true - matrix: - target: [ - i686-unknown-linux-gnu, - x86_64-unknown-linux-gnu, - ] - steps: - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} - - macos: - name: macOS - runs-on: macos-10.15 - strategy: - fail-fast: true - matrix: - target: [ - x86_64-apple-darwin, - ] - steps: - - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - - windows: - name: Windows - runs-on: windows-2019 - env: - OS: windows - strategy: - fail-fast: true - matrix: - include: - - target: x86_64-pc-windows-gnu - env: - ARCH_BITS: 64 - ARCH: x86_64 - - target: x86_64-pc-windows-msvc - # Disabled because broken: - # https://github.com/rust-lang/libc/issues/1592 - #- target: i686-pc-windows-gnu - # env: - # ARCH_BITS: 32 - # ARCH: i686 - - target: i686-pc-windows-msvc - steps: - - uses: actions/checkout@v2 - - name: Self-update rustup - run: rustup self update - shell: bash - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - shell: bash - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - shell: bash - style_check: name: Style check runs-on: ubuntu-20.04 - strategy: - fail-fast: true steps: - uses: actions/checkout@v2 - name: Setup Rust toolchain From 14fe8d41cbe9070c3ed1f74ac2ff1aeea337d1bf Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 10 Jun 2021 04:17:42 +0900 Subject: [PATCH 3/4] Create a symbolic link for wasm-ld --- ci/docker/wasm32-wasi/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/docker/wasm32-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile index 497d25363526c..d8c4b5050c602 100644 --- a/ci/docker/wasm32-wasi/Dockerfile +++ b/ci/docker/wasm32-wasi/Dockerfile @@ -26,6 +26,7 @@ ENV PATH=$PATH:/wasmtime-dev-x86_64-linux COPY docker/wasm32-wasi/clang.sh /wasi-libc/bin/clang RUN apt-get install -y --no-install-recommends lld +RUN ln -s /usr/bin/wasm-ld-10 /usr/bin/wasm-ld ENV PATH=$PATH:/usr/lib/llvm-9/bin # Of note here is our clang wrapper which just executes a normal clang From f52bd66c3f26d6a7cb766408157a2283906e1cab Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 10 Jun 2021 04:27:13 +0900 Subject: [PATCH 4/4] Attempt to fix the link error --- ci/docker/wasm32-wasi/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/wasm32-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile index d8c4b5050c602..6f5d58352a586 100644 --- a/ci/docker/wasm32-wasi/Dockerfile +++ b/ci/docker/wasm32-wasi/Dockerfile @@ -37,4 +37,4 @@ ENV CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime \ CARGO_TARGET_WASM32_WASI_LINKER=/wasi-libc/bin/clang \ CC_wasm32_wasi=/wasi-libc/bin/clang \ PATH=$PATH:/rust/bin \ - RUSTFLAGS=-Ctarget-feature=-crt-static + RUSTFLAGS='-Ctarget-feature=-crt-static -Clink-args=-Wl,-v'