Skip to content

Commit c807908

Browse files
committed
ci: update workflows to use workspace option
1 parent 252ec26 commit c807908

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ jobs:
856856
lima ls
857857
lima bash -c "cd work && cargo test --features 'feat_selinux' --no-default-features"
858858
- name: Lint with SELinux
859-
run: lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' --no-default-features -- -D warnings"
859+
run: lima bash -c "cd work && cargo clippy --workspace --all-targets --features 'feat_selinux' --no-default-features -- -D warnings"
860860

861861
test_selinux_stubs:
862862
name: Build/SELinux-Stubs (Non-Linux)
@@ -884,7 +884,7 @@ jobs:
884884
test -f target/debug/runcon || test -f target/debug/runcon.exe
885885
# check is enough to detect workspace breakage by chcon
886886
- name: Verify workspace builds with stubs
887-
run: cargo check --features ${{ matrix.job.features }}
887+
run: cargo check --workspace --features ${{ matrix.job.features }}
888888

889889
test_safe_traversal:
890890
name: Safe Traversal Security Check

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
job:
7474
- { os: ubuntu-latest , features: all , workspace: true }
7575
- { os: macos-latest , features: feat_os_unix }
76-
- { os: windows-latest , features: feat_os_windows }
76+
- { os: windows-latest , features: feat_os_windows , workspace: true }
7777
- { os: ubuntu-latest , features: feat_wasm , target: wasm32-wasip1 }
7878
steps:
7979
- uses: actions/checkout@v6

src/uucore/src/lib/features/uptime.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl FormattedUptime {
253253
///
254254
/// Returns a UResult with the uptime in seconds if successful, otherwise an UptimeError.
255255
#[cfg(windows)]
256+
#[allow(clippy::unnecessary_wraps, reason = "needed on some platforms")]
256257
pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
257258
use windows_sys::Win32::System::SystemInformation::GetTickCount;
258259
// SAFETY: always return u32
@@ -345,7 +346,10 @@ pub fn get_nusers(file: &str) -> usize {
345346
#[cfg(target_os = "windows")]
346347
pub fn get_nusers() -> usize {
347348
use std::ptr;
348-
use windows_sys::Win32::System::RemoteDesktop::*;
349+
use windows_sys::Win32::System::RemoteDesktop::{
350+
WTS_CURRENT_SERVER_HANDLE, WTSEnumerateSessionsW, WTSFreeMemory,
351+
WTSQuerySessionInformationW,
352+
};
349353

350354
let mut num_user = 0;
351355

@@ -358,8 +362,8 @@ pub fn get_nusers() -> usize {
358362
WTS_CURRENT_SERVER_HANDLE,
359363
0,
360364
1,
361-
&mut session_info_ptr,
362-
&mut session_count,
365+
&raw mut session_info_ptr,
366+
&raw mut session_count,
363367
);
364368
if result == 0 {
365369
return 0;
@@ -375,8 +379,8 @@ pub fn get_nusers() -> usize {
375379
WTS_CURRENT_SERVER_HANDLE,
376380
session.SessionId,
377381
5,
378-
&mut buffer,
379-
&mut bytes_returned,
382+
&raw mut buffer,
383+
&raw mut bytes_returned,
380384
);
381385
if result == 0 || buffer.is_null() {
382386
continue;
@@ -387,10 +391,10 @@ pub fn get_nusers() -> usize {
387391
num_user += 1;
388392
}
389393

390-
WTSFreeMemory(buffer as _);
394+
WTSFreeMemory(buffer.cast());
391395
}
392396

393-
WTSFreeMemory(session_info_ptr as _);
397+
WTSFreeMemory(session_info_ptr.cast());
394398
}
395399

396400
num_user

0 commit comments

Comments
 (0)