Skip to content

Commit

Permalink
Merge branch 'main' into cleanup-tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert authored May 7, 2024
2 parents 4e175b4 + 6979f01 commit c243e92
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 26 deletions.
9 changes: 9 additions & 0 deletions fuzz/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
println!("cargo:rustc-check-cfg=cfg(fuzzing)");
}
1 change: 0 additions & 1 deletion neqo-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "neqo-common"
build = "build.rs"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
Expand Down
1 change: 0 additions & 1 deletion neqo-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "neqo-crypto"
build = "build.rs"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
Expand Down
1 change: 1 addition & 0 deletions neqo-crypto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ fn setup_for_gecko() -> Vec<String> {
}

fn main() {
println!("cargo:rustc-check-cfg=cfg(nss_nodb)");
let flags = if cfg!(feature = "gecko") {
setup_for_gecko()
} else if let Ok(nss_dir) = env::var("NSS_DIR") {
Expand Down
6 changes: 3 additions & 3 deletions neqo-http3/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,11 +1271,11 @@ mod tests {
while let Some(event) = hconn.next_event() {
match event {
Http3ServerEvent::Headers { stream, .. } => {
assert!(!requests.contains_key(&stream));
requests.insert(stream, 0);
assert!(!requests.contains_key(&stream.stream_id()));
requests.insert(stream.stream_id(), 0);
}
Http3ServerEvent::Data { stream, .. } => {
assert!(requests.contains_key(&stream));
assert!(requests.contains_key(&stream.stream_id()));
}
Http3ServerEvent::DataWritable { .. }
| Http3ServerEvent::StreamReset { .. }
Expand Down
14 changes: 6 additions & 8 deletions neqo-http3/tests/httpconn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,12 @@ fn fetch_noresponse_will_idletimeout() {
let mut done = false;
while !done {
while let Some(event) = hconn_c.next_event() {
if let Http3ClientEvent::StateChange(state) = event {
match state {
Http3State::Closing(error_code) | Http3State::Closed(error_code) => {
assert_eq!(error_code, CloseReason::Transport(Error::IdleTimeout));
done = true;
}
_ => {}
}
if let Http3ClientEvent::StateChange(
Http3State::Closing(error_code) | Http3State::Closed(error_code),
) = event
{
assert_eq!(error_code, CloseReason::Transport(Error::IdleTimeout));
done = true;
}
}

Expand Down
9 changes: 9 additions & 0 deletions neqo-transport/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
println!("cargo:rustc-check-cfg=cfg(fuzzing)");
}
50 changes: 37 additions & 13 deletions qns/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
FROM martenseemann/quic-network-simulator-endpoint@sha256:12596544531465e77bdede50dd1e85b2c46c00f1634b3445eed277ca177666db AS buildimage

RUN apt-get update && apt-get install -y --no-install-recommends \
curl git mercurial coreutils \
build-essential libclang-dev lld \
gyp ninja-build zlib1g-dev python \
git coreutils build-essential libclang-dev lld gyp ninja-build zlib1g-dev python \
&& apt-get autoremove -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

ARG RUST_VERSION=stable
# From https://github.com/rust-lang/docker-rust/blob/cc31986e1dfe94671c639231ecf0503942c121d9/1.78.0/bookworm/slim/Dockerfile

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.78.0

ADD --checksum=sha256:a3d541a5484c8fa2f1c21478a6f6c505a778d473c21d60a18a4df5185d320ef8 \
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init x86_64_rustup

ADD --checksum=sha256:76cd420cb8a82e540025c5f97bda3c65ceb0b0661d5843e6ef177479813b0367 \
https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-gnu/rustup-init aarch64_rustup
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
libc6-dev \
wget \
; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='a3d541a5484c8fa2f1c21478a6f6c505a778d473c21d60a18a4df5185d320ef8' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='7cff34808434a28d5a697593cd7a46cefdf59c4670021debccd4c86afde0ff76' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='76cd420cb8a82e540025c5f97bda3c65ceb0b0661d5843e6ef177479813b0367' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='cacdd10eb5ec58498cd95dbb7191fdab5fa4343e05daaf0fb7cdcae63be0a272' ;; \
ppc64el) rustArch='powerpc64le-unknown-linux-gnu'; rustupSha256='b152711fb15fd629f0d4c2731cbf9167e6352da0ffcb2210447d80c010180f96' ;; \
s390x) rustArch='s390x-unknown-linux-gnu'; rustupSha256='4ff9e7963ed0457e64cbb29d2b5a37496d1fa303f9300adc5251ee3c16bd3b30' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.27.0/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version; \
apt-get remove -y --auto-remove \
wget \
; \
rm -rf /var/lib/apt/lists/*;

RUN mv $(uname -m)_rustup rustup-init && \
chmod +x rustup-init && \
./rustup-init -y -q --no-modify-path --profile minimal --default-toolchain $RUST_VERSION
# End of copy from https://github.com/rust-lang/docker-rust...

ENV NSS_DIR=/nss \
NSPR_DIR=/nspr \
Expand Down

0 comments on commit c243e92

Please sign in to comment.