diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8509f26c3..9908986df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,81 +2,15 @@ name: CI on: push: - pull_request: workflow_dispatch: - schedule: [cron: "40 1 * * *"] permissions: contents: read jobs: - pre_ci: - uses: dtolnay/.github/.github/workflows/pre_ci.yml@master - - test: - name: ${{matrix.name || format('Rust {0}', matrix.rust)}} - needs: pre_ci - if: needs.pre_ci.outputs.continue - runs-on: ${{matrix.os || 'ubuntu'}}-latest - strategy: - fail-fast: false - matrix: - include: - - rust: nightly - - rust: beta - - rust: stable - - rust: 1.60.0 - - rust: 1.64.0 - - name: macOS - rust: nightly - os: macos - - name: Windows (msvc) - rust: nightly-x86_64-pc-windows-msvc - os: windows - flags: /EHsc - env: - CXXFLAGS: ${{matrix.flags}} - RUSTFLAGS: --cfg deny_warnings -Dwarnings - timeout-minutes: 45 - steps: - - name: Enable symlinks (windows) - if: matrix.os == 'windows' - run: git config --global core.symlinks true - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{matrix.rust}} - - name: Determine test suite subset - # Our Windows and macOS jobs are the longest running, so exclude the - # relatively slow compiletest from them to speed up end-to-end CI time, - # except during cron builds when no human is presumably waiting on the - # build. The extra coverage is not particularly valuable and we can - # still ensure the test is kept passing on the basis of the scheduled - # builds. - run: | - echo RUSTFLAGS=$RUSTFLAGS >> $GITHUB_ENV - echo exclude=--exclude cxx-test-suite ${{matrix.rust == '1.60.0' && '--exclude cxxbridge-cmd' || ''}} >> $GITHUB_OUTPUT - env: - RUSTFLAGS: ${{env.RUSTFLAGS}} ${{matrix.os && github.event_name != 'schedule' && '--cfg skip_ui_tests' || ''}} - id: testsuite - shell: bash - - run: cargo run --manifest-path demo/Cargo.toml - - run: cargo test --workspace ${{steps.testsuite.outputs.exclude}} - - run: cargo check --no-default-features --features alloc - env: - RUSTFLAGS: --cfg compile_error_if_std ${{env.RUSTFLAGS}} - - run: cargo check --no-default-features - env: - RUSTFLAGS: --cfg compile_error_if_alloc --cfg cxx_experimental_no_alloc ${{env.RUSTFLAGS}} - buck: - name: Buck2 on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || '???'}} - runs-on: ${{matrix.os}}-latest - if: github.event_name != 'pull_request' - strategy: - fail-fast: false - matrix: - os: [ubuntu, macos] + name: Buck2 + runs-on: windows-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 @@ -84,67 +18,6 @@ jobs: submodules: true - uses: dtolnay/rust-toolchain@stable - uses: dtolnay/install-buck2@latest - - name: Install lld - run: sudo apt-get install lld - if: matrix.os == 'ubuntu' - run: buck2 run demo - run: buck2 build ... - run: buck2 test ... - - uses: dtolnay/install@reindeer - if: matrix.os == 'ubuntu' - - run: reindeer buckify - if: matrix.os == 'ubuntu' - working-directory: third-party - - name: Check reindeer-generated BUCK file up to date - run: git diff --exit-code - if: matrix.os == 'ubuntu' - - bazel: - name: Bazel - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - name: Install Bazel - run: | - wget -q -O install.sh https://github.com/bazelbuild/bazel/releases/download/6.0.0/bazel-6.0.0-installer-linux-x86_64.sh - chmod +x install.sh - ./install.sh --user - echo $HOME/bin >> $GITHUB_PATH - - name: Install lld - run: sudo apt-get install lld - - run: bazel run demo --verbose_failures --noshow_progress - - run: bazel test ... --verbose_failures --noshow_progress - - clippy: - name: Clippy - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@clippy - - run: cargo clippy --workspace --tests -- -Dclippy::all - - clang-tidy: - name: Clang Tidy - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - name: Install clang-tidy - run: sudo apt-get install clang-tidy-11 - - name: Run clang-tidy - run: clang-tidy-11 src/cxx.cc --warnings-as-errors=* - - outdated: - name: Outdated - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/install@cargo-outdated - - run: cargo outdated --workspace --exit-code 1 diff --git a/third-party/BUCK b/third-party/BUCK index 945ad9b7a..cd72f5292 100644 --- a/third-party/BUCK +++ b/third-party/BUCK @@ -465,10 +465,54 @@ cargo.rust_library( "winerror", "winnt", ], + rustc_flags = [ + "--cap-lints=allow", + "@$(location :winapi-0.3.9-build-script-run[rustc_flags])", + ], + visibility = [], +) + +cargo.rust_binary( + name = "winapi-0.3.9-build-script-build", + srcs = [":winapi-0.3.9.crate"], + crate = "build_script_build", + crate_root = "winapi-0.3.9.crate/build.rs", + edition = "2015", + features = [ + "consoleapi", + "errhandlingapi", + "fileapi", + "minwindef", + "processenv", + "std", + "winbase", + "wincon", + "winerror", + "winnt", + ], rustc_flags = ["--cap-lints=allow"], visibility = [], ) +buildscript_run( + name = "winapi-0.3.9-build-script-run", + package_name = "winapi", + buildscript_rule = ":winapi-0.3.9-build-script-build", + features = [ + "consoleapi", + "errhandlingapi", + "fileapi", + "minwindef", + "processenv", + "std", + "winbase", + "wincon", + "winerror", + "winnt", + ], + version = "0.3.9", +) + http_archive( name = "winapi-util-0.1.5.crate", sha256 = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178", diff --git a/third-party/fixups/winapi/fixups.toml b/third-party/fixups/winapi/fixups.toml index db40d72cb..5e026f75e 100644 --- a/third-party/fixups/winapi/fixups.toml +++ b/third-party/fixups/winapi/fixups.toml @@ -1 +1,2 @@ -buildscript = [] +[[buildscript]] +[buildscript.rustc_flags] diff --git a/tools/buck/prelude b/tools/buck/prelude index 29c6ae985..22cc3a9db 160000 --- a/tools/buck/prelude +++ b/tools/buck/prelude @@ -1 +1 @@ -Subproject commit 29c6ae9859e1bdc617402614cdda4efb1854d39b +Subproject commit 22cc3a9dba8483d9f293da50336db21fa78fdc24 diff --git a/tools/buck/toolchains/BUCK b/tools/buck/toolchains/BUCK index 24ebf009f..e0f685d11 100644 --- a/tools/buck/toolchains/BUCK +++ b/tools/buck/toolchains/BUCK @@ -6,9 +6,11 @@ load("@prelude//toolchains:rust.bzl", "system_rust_toolchain") system_cxx_toolchain( name = "cxx", cxx_flags = ["-std=c++17"], + linker = "link.exe" if host_info().os.is_windows else None, link_flags = select({ - "DEFAULT": ["-lstdc++"], + "config//os:linux": ["-lstdc++"], "config//os:macos": ["-lc++"], + "config//os:windows": [], }), visibility = ["PUBLIC"], )