Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI with the latest rustup #2052

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
TOOL: cargo
# The MSRV
TOOLCHAIN: 1.63.0
MSRV: 1.63.0
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 -- -D warnings
- $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 -- -D warnings
- 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 @@ -52,10 +51,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 @@ -76,9 +75,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 @@ -129,7 +128,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 @@ -165,9 +164,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 @@ -242,37 +239,33 @@ 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.63.0
# 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
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
matrix:
- name: DragonFly BSD x86_64
Expand All @@ -299,7 +292,6 @@ task:
name: Minver
env:
HOST: x86_64-unknown-linux-gnu
TOOLCHAIN: nightly
container:
image: rustlang/rust:nightly
setup_script:
Expand All @@ -313,5 +305,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
4 changes: 2 additions & 2 deletions src/sys/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Kqueue {
target_os = "openbsd"
))]
type type_of_udata = *mut libc::c_void;
#[cfg(any(target_os = "netbsd"))]
#[cfg(target_os = "netbsd")]
type type_of_udata = intptr_t;

#[cfg(target_os = "netbsd")]
Expand Down Expand Up @@ -171,7 +171,7 @@ libc_enum! {
))]
#[doc(hidden)]
pub type type_of_event_flag = u16;
#[cfg(any(target_os = "netbsd"))]
#[cfg(target_os = "netbsd")]
#[doc(hidden)]
pub type type_of_event_flag = u32;
libc_bitflags! {
Expand Down
6 changes: 3 additions & 3 deletions test/sys/test_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::Path;
use std::slice;
use std::str::FromStr;

#[cfg(any(target_os = "linux"))]
#[cfg(target_os = "linux")]
#[cfg_attr(qemu, ignore)]
#[test]
pub fn test_timestamping() {
Expand Down Expand Up @@ -2082,7 +2082,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 @@ -2137,7 +2137,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