From 30fa33e8fc00fccd67ee640d4a85e736cf25c847 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Dec 2023 15:58:16 -0800 Subject: [PATCH 1/5] TEST COMMIT PLEASE ignore Signed-off-by: John Nunley --- .github/workflows/ci.yml | 4 +++- tests/async.rs | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b6d03b..c006c6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - run: cargo build --all --all-features --all-targets + - run: sudo apt update && sudo apt install -y seatd && (seatd &) && ls /var/run + if: startsWith(matrix.os, 'ubuntu') - name: Run cargo check (without dev-dependencies to catch missing feature flags) if: startsWith(matrix.rust, 'nightly') run: cargo check -Z features=dev_dep @@ -49,7 +51,7 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf - - run: cargo test + - run: (seatd &) && cargo test # Copied from: https://github.com/rust-lang/stacker/pull/19/files windows_gnu: diff --git a/tests/async.rs b/tests/async.rs index 9218e71..62860de 100644 --- a/tests/async.rs +++ b/tests/async.rs @@ -33,6 +33,17 @@ fn spawn( Box::pin(async move { r.recv().await.unwrap() }) } +#[cfg(target_os = "linux")] +#[test] +fn socket() { + future::block_on(async { + let _sock = + async_io::Async::::connect("/var/run/seatd.sock") + .await + .unwrap(); + }); +} + #[test] fn tcp_connect() -> io::Result<()> { future::block_on(async { From caa6ee04c4a471da9cd93080e037bd51bf30807b Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Dec 2023 16:00:02 -0800 Subject: [PATCH 2/5] Run cargo test with sudo Signed-off-by: John Nunley --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c006c6c..930a3e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf - - run: (seatd &) && cargo test + - run: sudo cargo test # Copied from: https://github.com/rust-lang/stacker/pull/19/files windows_gnu: From 1e98973f9fc97a8587e0bbcd9c539ad82de5285b Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Dec 2023 16:01:31 -0800 Subject: [PATCH 3/5] Where's cargo? Signed-off-by: John Nunley --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 930a3e1..25c33ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,8 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf - - run: sudo cargo test + - run: whereis cargo || true + - run: sudo /home/runner/.cargo/bin/cargo test # Copied from: https://github.com/rust-lang/stacker/pull/19/files windows_gnu: From 55a77e1c8fab3b57b99d2ecb3ad9d438060d7112 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Dec 2023 16:03:00 -0800 Subject: [PATCH 4/5] Add +stable to cargo Signed-off-by: John Nunley --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25c33ad..4b90e4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,8 +51,7 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf - - run: whereis cargo || true - - run: sudo /home/runner/.cargo/bin/cargo test + - run: sudo /home/runner/.cargo/bin/cargo +stable test # Copied from: https://github.com/rust-lang/stacker/pull/19/files windows_gnu: From 432e25812edc0afea942d96307d6eb9d2553f128 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Dec 2023 16:05:01 -0800 Subject: [PATCH 5/5] Explicitly own the seatd socket Signed-off-by: John Nunley --- .cirrus.yml | 61 ---------------------- .github/workflows/ci.yml | 106 ++------------------------------------- 2 files changed, 4 insertions(+), 163 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a0c8143..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,61 +0,0 @@ -only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master') -auto_cancellation: $CIRRUS_BRANCH != 'master' -env: - CARGO_INCREMENTAL: '0' - CARGO_NET_GIT_FETCH_WITH_CLI: 'true' - CARGO_NET_RETRY: '10' - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: 'sparse' - CARGO_TERM_COLOR: always - RUST_BACKTRACE: '1' - RUSTDOCFLAGS: -D warnings - RUSTFLAGS: -D warnings - RUSTUP_MAX_RETRIES: '10' - -freebsd_task: - name: test ($TARGET) - freebsd_instance: - image_family: freebsd-12-4 - matrix: - - env: - TARGET: x86_64-unknown-freebsd - - env: - TARGET: i686-unknown-freebsd - setup_script: - # https://github.com/cirruslabs/cirrus-ci-docs/issues/483 - - sudo sysctl net.inet.tcp.blackhole=0 - - pkg install -y git - - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target $TARGET - test_script: - - . $HOME/.cargo/env - - cargo test --target $TARGET - -netbsd_task: - name: test ($TARGET) - compute_engine_instance: - image_project: pg-ci-images - # https://github.com/anarazel/pg-vm-images/blob/main/packer/netbsd.pkrvars.hcl - image: family/pg-ci-netbsd-vanilla-9-3 - platform: netbsd - env: - TARGET: x86_64-unknown-netbsd - setup_script: - - pkgin -y install git - - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable - test_script: - - . $HOME/.cargo/env - - cargo test - -openbsd_task: - name: test ($TARGET) - compute_engine_instance: - image_project: pg-ci-images - # https://github.com/anarazel/pg-vm-images/blob/main/packer/openbsd.pkrvars.hcl - image: family/pg-ci-openbsd-vanilla-7-2 - platform: openbsd - env: - TARGET: x86_64-unknown-openbsd - setup_script: - # OpenBSD is tier 3 target, so install rust from package manager instead of rustup - - pkg_add git rust - test_script: - - cargo test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b90e4d..feec702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - rust: [nightly, beta, stable] + os: [ubuntu-latest] + rust: [stable] steps: - uses: actions/checkout@v4 - name: Install Rust @@ -51,103 +51,5 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf - - run: sudo /home/runner/.cargo/bin/cargo +stable test - - # Copied from: https://github.com/rust-lang/stacker/pull/19/files - windows_gnu: - runs-on: windows-latest - strategy: - matrix: - rust: [nightly] - target: - - x86_64-pc-windows-gnu - steps: - - uses: actions/checkout@v4 - - name: Install Rust - # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - - run: rustup target add ${{ matrix.target }} - - run: cargo build --target ${{ matrix.target }} --all --all-features --all-targets - - run: cargo test --target ${{ matrix.target }} - - cross: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - name: Install cross - uses: taiki-e/install-action@cross - # We don't test BSDs, since we already test them in Cirrus. - - name: Android - if: startsWith(matrix.os, 'ubuntu') - run: cross test --target arm-linux-androideabi - - name: iOS - if: startsWith(matrix.os, 'macos') - run: | - rustup target add aarch64-apple-ios - cross build --target aarch64-apple-ios - - name: Linux x32 - if: startsWith(matrix.os, 'ubuntu') - run: | - rustup target add x86_64-unknown-linux-gnux32 - cross check --target x86_64-unknown-linux-gnux32 - - name: Fuchsia - if: startsWith(matrix.os, 'ubuntu') - run: | - rustup target add x86_64-unknown-fuchsia - cargo build --target x86_64-unknown-fuchsia - - name: illumos - if: startsWith(matrix.os, 'ubuntu') - run: | - rustup target add x86_64-unknown-illumos - cargo build --target x86_64-unknown-illumos - - msrv: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - # When updating this, the reminder to update the minimum supported - # Rust version in Cargo.toml. - rust: ['1.63'] - steps: - - uses: actions/checkout@v4 - - name: Install Rust - # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - - run: cargo build - - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - run: cargo clippy --all-features --all-targets - - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - run: cargo fmt --all --check - - security_audit: - permissions: - checks: write - contents: read - issues: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # https://github.com/rustsec/audit-check/issues/2 - - uses: rustsec/audit-check@master - with: - token: ${{ secrets.GITHUB_TOKEN }} + - run: sudo chown runner:runner /var/run/seatd.sock + - run: cargo test