Skip to content

Commit 0acb5a8

Browse files
author
Saran-386
committed
fix(stability): resolve shm.rs regression and finalize distro-specific CI naming
1 parent 8dfde9e commit 0acb5a8

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

.github/workflows/multi-build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@ jobs:
1515
include:
1616
- os: ubuntu-latest
1717
target: x86_64-unknown-linux-gnu
18-
suffix: linux-amd64
18+
suffix: x64_ubuntu
19+
binary: cortex
20+
- os: ubuntu-latest
21+
target: x86_64-unknown-linux-gnu
22+
suffix: x64_fedora_arch
1923
binary: cortex
2024
- os: macos-14 # Specifically for Apple Silicon (macOS 14+)
2125
target: aarch64-apple-darwin
22-
suffix: macos-arm64
26+
suffix: arm64_macos
2327
binary: cortex
2428
- os: macos-14 # Standard stable runner
2529
target: x86_64-apple-darwin
26-
suffix: macos-amd64
30+
suffix: x64_macos
2731
binary: cortex
2832
- os: windows-latest
2933
target: x86_64-pc-windows-msvc
30-
suffix: windows-amd64
34+
suffix: x64_windows
3135
binary: cortex.exe
3236

3337
steps:

rust/cortex-runtime/src/parallel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::PathBuf;
44
use std::time::Duration;
55
use tokio::process::Command;
66
use tracing::{debug, error, info};
7-
#[cfg(unix)]
7+
#[cfg(target_os = "linux")]
88
use std::os::unix::io::{BorrowedFd, RawFd};
99

1010
#[derive(Debug, Clone)]

rust/cortex-runtime/src/secrets.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
use anyhow::{Result, anyhow};
2-
use std::fs::File;
3-
use std::io::Write;
1+
use anyhow::Result;
42
#[cfg(unix)]
5-
use std::os::unix::io::{AsRawFd, FromRawFd};
3+
use std::os::unix::io::AsRawFd;
64
#[cfg(windows)]
7-
use std::os::windows::io::{AsRawHandle, FromRawHandle};
5+
use std::os::windows::io::AsRawHandle;
86
use tracing::info;
97

108
pub struct SecretManager;
@@ -16,6 +14,11 @@ impl SecretManager {
1614

1715
#[cfg(target_os = "linux")]
1816
{
17+
use anyhow::anyhow;
18+
use std::fs::File;
19+
use std::io::Write;
20+
use std::os::unix::io::FromRawFd;
21+
1922
let name = std::ffi::CString::new(label)?;
2023
let fd = unsafe { libc::memfd_create(name.as_ptr(), 0) };
2124

@@ -32,6 +35,7 @@ impl SecretManager {
3235
}
3336
#[cfg(all(unix, not(target_os = "linux")))]
3437
{
38+
use std::io::Write;
3539
// Fallback for macOS/BSD: Use a temporary file in /tmp or shm_open
3640
// For now, we'll use a temporary file and return its FD.
3741
// In a future hardening pass, shm_open will be used.
@@ -44,6 +48,8 @@ impl SecretManager {
4448
}
4549
#[cfg(windows)]
4650
{
51+
use std::io::Write;
52+
use std::fs::File;
4753
// Windows: Use temporary files as there is no direct memfd equivalent for handle passing in this logic.
4854
let mut path = std::env::temp_dir();
4955
path.push(format!("cortex_secret_{}.tmp", label));

rust/cortex-runtime/src/shm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ unsafe impl Sync for ZeroCopyBus {}
2626

2727
impl ZeroCopyBus {
2828
/// Creates a new anonymous shared memory region of `size` bytes.
29-
pub fn new(_size: usize) -> anyhow::Result<Self> {
29+
pub fn new(size: usize) -> anyhow::Result<Self> {
3030
#[cfg(unix)]
3131
{
3232
use std::os::fd::FromRawFd;

0 commit comments

Comments
 (0)