Skip to content

Commit

Permalink
Merge branch 'main' into chore-unwrap-less
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert authored Feb 2, 2025
2 parents f4a9ced + 63506c5 commit 582f74c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 25 deletions.
18 changes: 16 additions & 2 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,30 @@ runs:
if: env.SCCACHE_ENABLED != '1' && runner.environment != 'github-hosted'
uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4

# See https://corrode.dev/blog/tips-for-faster-ci-builds/
- name: Set up build environment
shell: bash
run: |
{
echo "CARGO_PROFILE_RELEASE_LTO=true"
echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1"
} >> "$GITHUB_ENV"
- name: Enable sscache
if: runner.environment != 'github-hosted'
shell: bash
run: |
echo "SCCACHE_ENABLED=1" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
if [ "${{ runner.environment }}" == "github-hosted" ]; then
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
fi
- name: Enable Rust cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
cache-bin: ${{ runner.environment == 'github-hosted' }}

- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -74,4 +87,5 @@ runs:
if: inputs.tools != ''
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: cargo quickinstall $(echo ${{ inputs.tools }} | tr -d ",")
# FIXME: See https://github.com/Swatinem/rust-cache/issues/204 for why `--force`.
run: cargo quickinstall --force $(echo ${{ inputs.tools }} | tr -d ",")
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Build neqo
run: |
cargo "+$TOOLCHAIN" bench --workspace --features bench --no-run
cargo "+$TOOLCHAIN" build --release --bin neqo-client --bin neqo-server
cargo "+$TOOLCHAIN" build --locked --release --bin neqo-client --bin neqo-server
- name: Build msquic
run: |
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/check-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
fi
sh rustup.sh --default-toolchain stable --profile minimal --component clippy llvm-tools -y
. "$HOME/.cargo/env"
cargo check --all-targets
cargo check --locked --all-targets
cargo clippy -- -D warnings
cargo install cargo-llvm-cov --locked
cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast --release
cargo llvm-cov test --locked --no-fail-fast --lcov --output-path lcov.info
cargo test --locked --no-fail-fast --release
rm -rf target # Don't sync this back to host
- if: matrix.os == 'openbsd'
Expand All @@ -85,17 +85,17 @@ jobs:
exit 0
fi
export LIBCLANG_PATH=/usr/local/llvm16/lib
cargo check --all-targets
cargo check --locked --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in openbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# export LLVM_COV=/usr/local/llvm16/bin/llvm-cov
# export LLVM_PROFDATA=/usr/local/llvm16/bin/llvm-profdata
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
# cargo llvm-cov test --locked --no-fail-fast --lcov --output-path lcov.info
cargo test --locked --no-fail-fast # Remove this once profiler is supported
cargo test --locked --no-fail-fast --release
rm -rf target # Don't sync this back to host
- if: matrix.os == 'netbsd'
Expand All @@ -120,15 +120,15 @@ jobs:
. "$HOME/.cargo/env"
# FIXME: Why do we need to set this on NetBSD?
export LD_LIBRARY_PATH=/usr/pkg/lib/nss:/usr/pkg/lib/nspr
cargo check --all-targets
cargo check --locked --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in netbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
# cargo llvm-cov test --locked --no-fail-fast --lcov --output-path lcov.info
cargo test --locked --no-fail-fast # Remove this once profiler is supported
cargo test --locked --no-fail-fast --release
rm -rf target # Don't sync this back to host
- if: matrix.os == 'solaris'
Expand All @@ -151,15 +151,15 @@ jobs:
fi
source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install) || true # This doesn't exit with zero on success
export LIBCLANG_PATH="/usr/lib/amd64"
cargo check --all-targets
cargo check --locked --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in openbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
# cargo llvm-cov test --locked --no-fail-fast --lcov --output-path lcov.info
cargo test --locked --no-fail-fast # Remove this once profiler is supported
cargo test --locked --no-fail-fast --release
rm -rf target # Don't sync this back to host
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Check
run: |
# shellcheck disable=SC2086
cargo check $BUILD_TYPE --all-targets --features ci
cargo check $BUILD_TYPE --locked --all-targets --features ci
- name: Run tests and determine coverage
env:
Expand All @@ -87,9 +87,9 @@ jobs:
export DUMP_SIMULATION_SEEDS
# shellcheck disable=SC2086
if [ "${{ matrix.rust-toolchain }}" == "nightly" ]; then
cargo llvm-cov nextest $BUILD_TYPE --mcdc --include-ffi --features ci --profile ci --codecov --output-path codecov.json
cargo llvm-cov nextest $BUILD_TYPE --locked --mcdc --include-ffi --features ci --profile ci --codecov --output-path codecov.json
else
cargo nextest run $BUILD_TYPE --features ci --profile ci
cargo nextest run $BUILD_TYPE --locked --features ci --profile ci
fi
- name: Run client/server transfer
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
PWD=$(pwd)
export LSAN_OPTIONS="suppressions=$PWD/suppressions.txt"
fi
cargo nextest run -Z build-std --features ci --profile ci --target "$TARGET"
cargo nextest run --locked -Z build-std --features ci --profile ci --target "$TARGET"
- name: Save simulation seeds artifact
if: env.DUMP_SIMULATION_SEEDS
Expand Down
2 changes: 1 addition & 1 deletion qns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN cargo chef cook --release --recipe-path recipe.json
ADD . /neqo
RUN set -eux; \
cd /neqo; \
CARGO_PROFILE_RELEASE_DEBUG=true cargo build --release --bin neqo-client --bin neqo-server
CARGO_PROFILE_RELEASE_DEBUG=true cargo build --locked --release --bin neqo-client --bin neqo-server

# Copy only binaries to the final image to keep it small.

Expand Down
4 changes: 2 additions & 2 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
set -e
tmp=$(mktemp -d)

cargo build --bin neqo-client --bin neqo-server
cargo build --locked --bin neqo-client --bin neqo-server

addr=localhost
port=4433
Expand All @@ -28,7 +28,7 @@ if [ "$NSS_DIR" ] && [ "$NSS_TARGET" ]; then
export DYLD_FALLBACK_LIBRARY_PATH="$LD_LIBRARY_PATH"
fi

client="./target/debug/neqo-client $flags --no-sni-slicing --output-dir $tmp --stats https://$addr:$port$path"
client="./target/debug/neqo-client $flags --output-dir $tmp --stats https://$addr:$port$path"
server="SSLKEYLOGFILE=$tmp/test.tlskey ./target/debug/neqo-server $flags $addr:$port"

tcpdump -U -i "$iface" -w "$tmp/test.pcap" host $addr and port $port >/dev/null 2>&1 &
Expand Down

0 comments on commit 582f74c

Please sign in to comment.