Chore: flush out requirement for nightly

This commit is contained in:
Denis Benato
2025-10-20 00:39:17 +02:00
parent d8f06230fa
commit 60fce30a06
7 changed files with 38 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
set -e
echo '+cargo +nightly fmt --all -- --check'
cargo +nightly fmt --all -- --check
echo '+cargo fmt --all -- --check'
cargo fmt --all -- --check
git add -u

View File

@@ -2,8 +2,8 @@
set -e
echo '+cargo +nightly fmt --all -- --check'
cargo +nightly fmt --all -- --check
echo '+cargo fmt --all -- --check'
cargo fmt --all -- --check
echo '+cargo clippy --all -- -D warnings'
cargo clippy --all -- -D warnings
echo '+cargo cranky'

View File

@@ -31,8 +31,7 @@ format:
- tags
<<: *rust_cache
script:
- echo "nightly" > rust-toolchain
- rustup component add rustfmt
- rustup component add rustfmt || true
- cargo fmt --check
check:
@@ -40,8 +39,8 @@ check:
- tags
<<: *rust_cache
script:
- rustup component add clippy
- cargo check
- rustup component add clippy || true
- cargo check --locked --workspace
# deny currently catches too much
#- cargo install cargo-deny && cargo deny
- cargo install cargo-cranky && cargo cranky
@@ -52,7 +51,7 @@ test:
<<: *rust_cache
script:
- mkdir -p .git/hooks > /dev/null
- cargo test --all -- --test-threads=1
- cargo test --locked --all
release:
only:
@@ -60,7 +59,7 @@ release:
<<: *rust_cache
script:
- cargo install cargo-vendor-filterer
- make && make vendor
- make FROZEN=1 && make vendor
artifacts:
paths:
- vendor_asusctl*.tar.xz
@@ -72,7 +71,7 @@ pages:
- tags
<<: *rust_cache
script:
- cargo doc --document-private-items --no-deps --workspace
- cargo doc --locked --document-private-items --no-deps --workspace
- rm -rf public
- mkdir public
- cp -R target/doc/* public

View File

@@ -37,6 +37,15 @@ ifeq ($(X11),1)
ARGS += --features "rog-control-center/x11"
endif
# Always use the versions in Cargo.lock by default
ARGS += --locked
# Allow optionally freezing the build to avoid any network access and enforce Cargo.lock strictly
FROZEN ?= 0
ifeq ($(FROZEN),1)
ARGS += --frozen
endif
VENDORED ?= 0
ifeq ($(VENDORED),1)
ARGS += --frozen

View File

@@ -84,7 +84,7 @@ A gui is now in the repo - ROG Control Center. At this time it is still a WIP, b
Rust and cargo are required, they can be installed from [rustup.rs](https://rustup.rs/).
Distro repos probably won't work (unless rustup is shipped like in the case of archlinux) as nightly is needed.
Distro packaging should work with the stable toolchain. If your distro does not provide a recent Rust toolchain, install rustup and use the stable toolchain.
**fedora:**

View File

@@ -231,6 +231,8 @@ impl AuraConfig {
#[cfg(test)]
mod tests {
use std::sync::{Mutex, MutexGuard, OnceLock};
use rog_aura::keyboard::AuraPowerState;
use rog_aura::{
AuraEffect, AuraModeNum, AuraZone, Colour, Direction, LedBrightness, PowerZones, Speed,
@@ -238,8 +240,20 @@ mod tests {
use super::AuraConfig;
// Global mutex to serialize tests that rely on process-wide environment
// variables
static TEST_MUTEX: OnceLock<Mutex<()>> = OnceLock::new();
fn test_lock() -> MutexGuard<'static, ()> {
TEST_MUTEX
.get_or_init(|| Mutex::new(()))
.lock()
.expect("TEST_MUTEX poisoned")
}
#[test]
fn set_multizone_4key_config() {
let _guard = test_lock();
std::env::set_var("BOARD_NAME", "");
let mut config = AuraConfig::new("19b6");
@@ -319,6 +333,7 @@ mod tests {
#[test]
fn set_multizone_multimode_config() {
let _guard = test_lock();
std::env::set_var("BOARD_NAME", "");
let mut config = AuraConfig::new("19b6");
@@ -367,6 +382,7 @@ mod tests {
#[test]
fn verify_0x1866_g531i() {
let _guard = test_lock();
std::env::set_var("BOARD_NAME", "G513I");
let mut config = AuraConfig::new("1866");
@@ -392,6 +408,7 @@ mod tests {
#[test]
fn verify_0x19b6_g634j() {
let _guard = test_lock();
std::env::set_var("BOARD_NAME", "G634J");
let mut config = AuraConfig::new("19b6");

View File

@@ -12,7 +12,7 @@ edition.workspace = true
default = []
mocking = []
x11 = ["slint/backend-winit-x11"]
# Requires RUSTFLAGS="--cfg tokio_unstable"
# Optional tokio debug feature does not require nightly; remove RUSTFLAGS note.
tokio-debug = ["console-subscriber"]
[dependencies]