From 3a2e20f44a951d7ac45839632470cf554c4df27a Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 24 May 2024 19:03:44 +0200 Subject: [PATCH] feat: support {Free|Net|Open}BSD (#2311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for `iroh` on `NetBSD`, `FreeBSD` and `OpenBSD`. ## Status - NetBsd - [x] Compiles - [ ] Tests passing - [ ] Iroh: mostly passing, failures are only due to https://github.com/shellrow/netdev/issues/69 - [x] Quinn - [x] Implementation adapted - FreeBsd - [x] Compiles - [ ] Tests passing - [ ] Iroh: mostly passing, failures are only due to https://github.com/shellrow/netdev/issues/69 - [x] Quinn - [x] Implementation adapted - OpenBsd - [x] Compiles - [ ] Tests passing - [ ] Iroh: mostly passing, failures are only due to https://github.com/shellrow/netdev/issues/69 - [x] Quinn - [x] Implementation adapted ## Caveats - Build only in CI for now ## Related Issues - https://github.com/shellrow/netdev/issues/69 - https://github.com/n0-computer/quinn/pull/9 ## References - https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh - https://github.com/rust-lang/libc/issues/3711 Closes #2306 --------- Co-authored-by: Floris Bruynooghe --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++------- Cargo.lock | 2 +- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a207c1..074a3be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,18 +25,23 @@ jobs: if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" uses: './.github/workflows/tests.yaml' - cross: + cross_build: + name: Cross Build Only if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" timeout-minutes: 30 - name: Cross compile runs-on: [self-hosted, linux, X64] strategy: fail-fast: false matrix: target: - - i686-unknown-linux-gnu + # cross tests are currently broken vor armv7 and aarch64 + # see https://github.com/cross-rs/cross/issues/1311 - armv7-linux-androideabi - aarch64-linux-android + # Freebsd execution fails in cross + # - i686-unknown-freebsd # Linking fails :/ + - x86_64-unknown-freebsd + - x86_64-unknown-netbsd steps: - name: Checkout uses: actions/checkout@v4 @@ -59,15 +64,39 @@ jobs: # cross tests are currently broken vor armv7 and aarch64 # see https://github.com/cross-rs/cross/issues/1311. So on # those platforms we only build but do not run tests. - if: matrix.target != 'i686-unknown-linux-gnu' run: cross build --all --target ${{ matrix.target }} env: RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG'}} + cross_test: + name: Cross Test + if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" + timeout-minutes: 30 + runs-on: [self-hosted, linux, X64] + strategy: + fail-fast: false + matrix: + target: + - i686-unknown-linux-gnu + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Cleanup Docker + continue-on-error: true + run: | + docker kill $(docker ps -q) + + - name: Install cross + # See https://github.com/cross-rs/cross/issues/1222 + run: cargo install cross --git https://github.com/cross-rs/cross + - name: test - # cross tests are currently broken vor armv7 and aarch64 - # see https://github.com/cross-rs/cross/issues/1311 - if: matrix.target == 'i686-unknown-linux-gnu' run: cross test --all --target ${{ matrix.target }} -- --test-threads=12 env: RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }} diff --git a/Cargo.lock b/Cargo.lock index 2e7c2c1..49b5936 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2806,7 +2806,7 @@ dependencies = [ "rand", "rand_chacha", "rand_core", - "rcgen 0.11.3", + "rcgen 0.12.1", "regex", "reqwest 0.12.4", "ring 0.17.8",