Skip to content

Commit 98b22f9

Browse files
committed
Merge branch 'main' into Frando/improve-holepunching
2 parents f7e0d6b + 14bae03 commit 98b22f9

26 files changed

Lines changed: 1243 additions & 817 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -373,37 +373,25 @@ jobs:
373373
# Pin to the nightly that the pinned `cargo-check-external-types`
374374
# release was last tested against. Update both together.
375375
CARGO_CHECK_EXTERNAL_TYPES_VERSION: "0.4.0"
376-
CARGO_CHECK_EXTERNAL_TYPES_NIGHTLY: "nightly-2025-10-18"
376+
TOOLCHAIN: "nightly-2025-10-18"
377377
steps:
378378
- uses: actions/checkout@v6
379379
- uses: dtolnay/rust-toolchain@master
380380
with:
381-
toolchain: ${{ env.CARGO_CHECK_EXTERNAL_TYPES_NIGHTLY }}
381+
toolchain: ${{ env.TOOLCHAIN }}
382382
- name: Install sccache
383383
uses: mozilla-actions/sccache-action@v0.0.9
384384

385385
- name: Install cargo-binstall
386386
uses: cargo-bins/cargo-binstall@v1.18.1
387387

388+
- uses: taiki-e/install-action@cargo-make
389+
388390
- name: Install cargo-check-external-types
389-
# Match the version of wasm-bindgen used in Cargo.lock
390391
run: cargo binstall cargo-check-external-types@${{ env.CARGO_CHECK_EXTERNAL_TYPES_VERSION }} --locked --no-confirm
391392

392393
- name: Check external types
393-
run: |
394-
set -e
395-
fail=0
396-
for crate in iroh-base iroh-dns iroh-relay iroh iroh-dns-server; do
397-
echo "::group::$crate"
398-
if ! cargo "+${CARGO_CHECK_EXTERNAL_TYPES_NIGHTLY}" check-external-types \
399-
--manifest-path "$crate/Cargo.toml" \
400-
--config external-types.toml \
401-
--all-features; then
402-
fail=1
403-
fi
404-
echo "::endgroup::"
405-
done
406-
exit $fail
394+
run: cargo make check-external-types
407395

408396
check_fmt:
409397
timeout-minutes: 30

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,12 @@ jobs:
198198
# Native build on self-hosted linux runners; use musl-gcc from musl-tools.
199199
export CARGO_TARGET_$(echo ${{ matrix.cargo_targets }} | tr 'a-z-' 'A-Z_')_LINKER=musl-gcc
200200
export CC=musl-gcc
201-
export RUSTFLAGS="${RUSTFLAGS:-} -C target-feature=+crt-static -C link-arg=-static"
201+
# `relocation-model=static` is required so rustc selects the
202+
# non-PIE musl crt1.o (not rcrt1.o) to match the ET_EXEC binary
203+
# produced by `musl-gcc -static`. Without it the PIE startup
204+
# code (rcrt1.o) ends up linked into a non-PIE binary and the
205+
# process segfaults in `_start_c` before reaching `main`.
206+
export RUSTFLAGS="${RUSTFLAGS:-} -C target-feature=+crt-static -C relocation-model=static -C link-arg=-static"
202207
fi
203208
cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }}
204209

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(iroh_docsrs)", "cfg(iroh_l
4343
unused-async = "warn"
4444

4545
[patch.crates-io]
46-
noq = { git = "https://github.com/n0-computer/noq", branch = "Frando/feat-discover-off-path-probes" }
47-
noq-proto = { git = "https://github.com/n0-computer/noq", branch = "Frando/feat-discover-off-path-probes" }
48-
noq-udp = { git = "https://github.com/n0-computer/noq", branch = "Frando/feat-discover-off-path-probes" }
46+
noq = { git = "https://github.com/n0-computer/noq", branch = "flub/probe-peer-hard-nat" }
47+
noq-proto = { git = "https://github.com/n0-computer/noq", branch = "flub/probe-peer-hard-nat" }
48+
noq-udp = { git = "https://github.com/n0-computer/noq", branch = "flub/probe-peer-hard-nat" }

Makefile.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Use cargo-make to run tasks here: https://crates.io/crates/cargo-make
22

3+
[env]
4+
# Make per-member iterations inherit this Makefile so workspace tasks can be
5+
# defined here without needing a per-crate Makefile.toml.
6+
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
7+
# Workspace members to exclude when setting `workspace = true` for a task.
8+
# Must live at global env (not task-level) so it's read before workspace iteration
9+
# is generated. Only the `check-external-types` task uses this.
10+
CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["iroh/bench"]
11+
312
[tasks.format]
413
workspace = false
514
command = "cargo"
@@ -31,3 +40,12 @@ args = [
3140
workspace = false
3241
command = "cargo"
3342
args = ["nextest", "run", "-p", "iroh", "--features", "qlog", "--test", "patchbay", "--profile", "patchbay", "${@}"]
43+
44+
[tasks.check-external-types]
45+
description = "Run cargo check-external-types on workspace crates"
46+
workspace = true
47+
# cargo check-external-types needs a specific nightly toolchain,
48+
# see https://github.com/awslabs/cargo-check-external-types#how-to-use
49+
toolchain = "${TOOLCHAIN:nightly-2025-10-18}"
50+
command = "cargo"
51+
args = ["check-external-types", "--all-features"]

external-types.toml

Lines changed: 0 additions & 44 deletions
This file was deleted.

iroh-base/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ relay = [
6868
[package.metadata.docs.rs]
6969
all-features = true
7070
rustdoc-args = ["--cfg", "iroh_docsrs"]
71+
72+
[package.metadata.cargo_check_external_types]
73+
allowed_external_types = [
74+
"n0_error::*",
75+
"serde_core::*",
76+
"url::*",
77+
]

iroh-dns-server/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,10 @@ vergen-gitcl = "9.1"
9393

9494
[package.metadata.docs.rs]
9595
all-features = true
96+
97+
[package.metadata.cargo_check_external_types]
98+
allowed_external_types = [
99+
"iroh_metrics::*",
100+
"n0_error::*",
101+
"serde_core::*",
102+
]

iroh-dns/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ tls-aws-lc-rs = ["rustls/aws-lc-rs", "hickory-resolver/https-aws-lc-rs"]
4545
[dev-dependencies]
4646
n0-tracing-test = "0.3"
4747
tokio = { version = "1", features = ["macros", "rt"] }
48+
49+
[package.metadata.cargo_check_external_types]
50+
allowed_external_types = [
51+
"iroh_base::*",
52+
"n0_error::*",
53+
"rustls::*",
54+
"url::*",
55+
# only type alias
56+
"futures_lite::future::Boxed",
57+
]

iroh-relay/Cargo.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,29 @@ required-features = ["server"]
182182
[package.metadata.docs.rs]
183183
all-features = true
184184
rustdoc-args = ["--cfg", "iroh_docsrs"]
185+
186+
[package.metadata.cargo_check_external_types]
187+
allowed_external_types = [
188+
# workspace crates
189+
"iroh_base::*",
190+
"iroh_dns::*",
191+
# crates owned by us that will move to 1.0 as well
192+
"iroh_metrics::*",
193+
"n0_error::*",
194+
"noq::*",
195+
"noq_proto::*",
196+
# 1.0 crates that we deem fine to be part of the public API
197+
"bytes::*",
198+
"http::*",
199+
"http_body::*",
200+
"hyper::*",
201+
"rustls_pki_types::*",
202+
"serde_core::*",
203+
"tokio::*",
204+
"url::*",
205+
# non-1.0 crates that we decided to accept in the public API
206+
"rustls::*",
207+
"tokio_rustls::*",
208+
"futures_core::stream::Stream",
209+
"futures_sink::Sink",
210+
]

0 commit comments

Comments
 (0)