From 97f8fccdcbc1c85c40efb9770c3529e6f6a3d094 Mon Sep 17 00:00:00 2001 From: Ross Smyth Date: Wed, 27 Mar 2024 14:32:04 -0400 Subject: [PATCH 1/4] Fix nightly lint causing compilation to fail --- .github/workflows/ci.yaml | 22 ++++++++++++++++++++++ src/lib.rs | 1 - 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ccacede3..59a79473 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -244,3 +244,25 @@ jobs: disable_extra_builds: true disable_tests: true target: x86_64-unknown-netbsd + + x86_64-pc-windows-msvc-nightly: + uses: ./.github/workflows/build.yaml + with: + runs_on: windows-2019 + target: x86_64-pc-windows-msvc + toolchain: nightly + + x86_64-unknown-linux-gnu-nightly: + uses: ./.github/workflows/build.yaml + with: + extra_packages: libudev-dev + target: x86_64-unknown-linux-gnu + toolchain: nightly + + aarch64-apple-darwin-nightly: + uses: ./.github/workflows/build.yaml + with: + disable_tests: true + runs_on: macos-latest + target: aarch64-apple-darwin + toolchain: nightly diff --git a/src/lib.rs b/src/lib.rs index f369c41c..25b98db4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,6 @@ // doc tests. #![doc(test(attr(allow(unused_must_use))))] -use std::convert::From; use std::error::Error as StdError; use std::fmt; use std::io; From 8d94b1afdb3e58e6d3eb6b555f79ac0932b5e595 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Thu, 28 Mar 2024 23:33:04 +0100 Subject: [PATCH 2/4] Relax checks on unused imports This is definitely worth a warning but should not make builds fail for users. We deny warnings in CI and sort this out before integrating. See issue #169 for more details. --- .github/workflows/build.yaml | 2 ++ src/lib.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6a0dd531..77c01ebe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,6 +46,8 @@ env: CARGO_TERM_COLOR: always # Enable cross compilation for `pkg_config`. PKG_CONFIG_ALLOW_CROSS: 1 + # Deny warnings. + RUSTFLAGS: -D warnings jobs: build: diff --git a/src/lib.rs b/src/lib.rs index 25b98db4..f01363dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,8 +19,7 @@ #![deny( missing_docs, missing_debug_implementations, - missing_copy_implementations, - unused + missing_copy_implementations )] // Document feature-gated elements on docs.rs. See // https://doc.rust-lang.org/rustdoc/unstable-features.html?highlight=doc(cfg#doccfg-recording-what-platforms-or-features-are-required-for-code-to-be-present From 6b8496073d6b263b9316b9bffab7cb9ac6c2b99c Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Fri, 29 Mar 2024 00:16:45 +0100 Subject: [PATCH 3/4] Don't let nightly builds fail CI --- .github/workflows/build.yaml | 4 ++++ .github/workflows/ci.yaml | 22 ++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77c01ebe..ea08181d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,6 +18,9 @@ on: toolchain: default: stable type: string + continue-on-error: + default: false + type: boolean env: # While we could define these on a per-job basis, there's no harm in simply @@ -52,6 +55,7 @@ env: jobs: build: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue-on-error }} steps: - name: Build | install dependencies if: inputs.runs_on == 'ubuntu-latest' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 59a79473..e488faab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -245,9 +245,22 @@ jobs: disable_tests: true target: x86_64-unknown-netbsd + # -------------------------------------------------------------------------- + # NIGHTLY BUILD + + aarch64-apple-darwin-nightly: + uses: ./.github/workflows/build.yaml + with: + continue-on-error: true + disable_tests: true + runs_on: macos-latest + target: aarch64-apple-darwin + toolchain: nightly + x86_64-pc-windows-msvc-nightly: uses: ./.github/workflows/build.yaml with: + continue-on-error: true runs_on: windows-2019 target: x86_64-pc-windows-msvc toolchain: nightly @@ -255,14 +268,7 @@ jobs: x86_64-unknown-linux-gnu-nightly: uses: ./.github/workflows/build.yaml with: + continue-on-error: true extra_packages: libudev-dev target: x86_64-unknown-linux-gnu toolchain: nightly - - aarch64-apple-darwin-nightly: - uses: ./.github/workflows/build.yaml - with: - disable_tests: true - runs_on: macos-latest - target: aarch64-apple-darwin - toolchain: nightly From 7fec3df878625a85c36857333e9fca48caa77a47 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Fri, 29 Mar 2024 16:17:59 +0100 Subject: [PATCH 4/4] Clean up superfluous explicit import Current nightly considers use nix::self as an unused import as nix is already through the extern prelude (since edition 2018) and generates a warning. Remove the explicit import to silence it. See: * Output of 'cargo --verbose check' * https://doc.rust-lang.org/stable/reference/names/preludes.html#extern-prelude --- src/posix/tty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/posix/tty.rs b/src/posix/tty.rs index c21cf2d1..e29a8a85 100644 --- a/src/posix/tty.rs +++ b/src/posix/tty.rs @@ -5,7 +5,7 @@ use std::time::Duration; use std::{io, mem}; use nix::fcntl::{fcntl, OFlag}; -use nix::{self, libc, unistd}; +use nix::{libc, unistd}; use crate::posix::ioctl::{self, SerialLines}; use crate::posix::termios;