Skip to content

Commit

Permalink
feat: support {Free|Net|Open}BSD (#2311)
Browse files Browse the repository at this point in the history
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <[email protected]>
  • Loading branch information
dignifiedquire and flub authored May 24, 2024
1 parent 544280a commit 764f0f2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 764f0f2

Please sign in to comment.