Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2052: Fix CI with the latest rustup r=asomers a=asomers

Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Ben Kimock <kimockb@gmail.com>
  • Loading branch information
3 people committed Aug 27, 2023
1 parent a063e42 commit 39a02f3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 31 deletions.
48 changes: 20 additions & 28 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@ env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
TOOL: cargo
# The MSRV
TOOLCHAIN: 1.56.1
MSRV: 1.56.1
ZFLAGS:

# Tests that don't require executing the build binaries
build: &BUILD
build_script:
- . $HOME/.cargo/env || true
- $TOOL +$TOOLCHAIN -Vv
- rustc +$TOOLCHAIN -Vv
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- $CLIPPYFLAGS
- $TOOL -Vv
- rustc -Vv
- $TOOL $BUILD $ZFLAGS --target $TARGET --all-targets
- $TOOL doc $ZFLAGS --no-deps --target $TARGET
- $TOOL clippy $ZFLAGS --target $TARGET --all-targets -- $CLIPPYFLAGS
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi
- if [ -z "$NOHACK" ]; then $TOOL hack $ZFLAGS check --target $TARGET --each-feature; fi

# Tests that do require executing the binaries
test: &TEST
<< : *BUILD
test_script:
- . $HOME/.cargo/env || true
- $TOOL +$TOOLCHAIN test --target $TARGET
- $TOOL test --target $TARGET

# Test FreeBSD in a full VM. Test the i686 target too, in the
# same VM. The binary will be built in 32-bit mode, but will execute on a
Expand All @@ -53,10 +52,10 @@ task:
setup_script:
- kldload mqueuefs
- fetch https://sh.rustup.rs -o rustup.sh
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
- . $HOME/.cargo/env
- rustup target add i686-unknown-freebsd
- rustup component add --toolchain $TOOLCHAIN clippy
- rustup component add clippy
<< : *TEST
i386_test_script:
- . $HOME/.cargo/env
Expand All @@ -77,9 +76,9 @@ task:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
setup_script:
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
- . $HOME/.cargo/env
- rustup component add --toolchain $TOOLCHAIN clippy
- rustup component add clippy
<< : *TEST
before_cache_script: rm -rf $CARGO_HOME/registry/index

Expand Down Expand Up @@ -130,7 +129,7 @@ task:
setup_script:
- mkdir /tmp/home
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
- . $HOME/.cargo/env
- cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
<< : *TEST
Expand Down Expand Up @@ -167,9 +166,7 @@ task:
image: rust:latest
env:
TARGET: x86_64-unknown-linux-gnu
TOOLCHAIN:
setup_script:
- rustup target add $TARGET
- rustup component add clippy
<< : *TEST
before_cache_script: rm -rf $CARGO_HOME/registry/index
Expand Down Expand Up @@ -244,38 +241,34 @@ task:
TARGET: x86_64-unknown-netbsd
setup_script:
- rustup target add $TARGET
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
- rustup component add --toolchain $TOOLCHAIN clippy
- rustup component add clippy
<< : *BUILD
before_cache_script: rm -rf $CARGO_HOME/registry/index

task:
container:
image: rust:1.56
# Redox's MSRV policy is unclear. Until they define it, use nightly.
image: rustlang/rust:nightly
env:
BUILD: check
name: Redox x86_64
env:
HOST: x86_64-unknown-linux-gnu
TARGET: x86_64-unknown-redox
# Redox's MSRV policy is unclear. Until they define it, use nightly.
TOOLCHAIN: nightly
CLIPPYFLAGS: -D warnings
setup_script:
- rustup target add $TARGET
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
- rustup component add --toolchain $TOOLCHAIN clippy
- rustup component add clippy
<< : *BUILD
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Rust Tier 3 targets can't use Rustup
## Rust Tier 3 targets can't use Rustup
task:
container:
image: rustlang/rust:nightly
env:
BUILD: check
HOST: x86_64-unknown-linux-gnu
TOOLCHAIN: nightly
ZFLAGS: -Zbuild-std
CLIPPYFLAGS: -D warnings
matrix:
Expand Down Expand Up @@ -303,7 +296,6 @@ task:
name: Minver
env:
HOST: x86_64-unknown-linux-gnu
TOOLCHAIN: nightly
container:
image: rustlang/rust:nightly
setup_script:
Expand All @@ -317,5 +309,5 @@ task:
name: Rust Formatter
container:
image: rust:latest
setup_script: rustup +$TOOLCHAIN component add rustfmt
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check **/*.rs
setup_script: rustup component add rustfmt
test_script: cargo fmt --all -- --check **/*.rs
6 changes: 3 additions & 3 deletions test/sys/test_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() {
assert_eq!(from_storage, sockaddr);
}

#[cfg(any(target_os = "linux"))]
#[cfg(target_os = "linux")]
#[cfg_attr(qemu, ignore)]
#[test]
pub fn test_timestamping() {
Expand Down Expand Up @@ -2231,7 +2231,7 @@ pub fn test_vsock() {
// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack
// of QEMU support is suspected.
#[cfg_attr(qemu, ignore)]
#[cfg(all(target_os = "linux"))]
#[cfg(target_os = "linux")]
#[test]
fn test_recvmsg_timestampns() {
use nix::sys::socket::*;
Expand Down Expand Up @@ -2286,7 +2286,7 @@ fn test_recvmsg_timestampns() {
// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack
// of QEMU support is suspected.
#[cfg_attr(qemu, ignore)]
#[cfg(all(target_os = "linux"))]
#[cfg(target_os = "linux")]
#[test]
fn test_recvmmsg_timestampns() {
use nix::sys::socket::*;
Expand Down

0 comments on commit 39a02f3

Please sign in to comment.