Skip to content
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
2 changes: 1 addition & 1 deletion src/command/agent/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ fn discover_codex(since: Option<i64>, deadline: Instant) -> Result<Vec<Candidate
return discover_codex_unix(&root, &directory, since, deadline);
#[cfg(not(unix))]
{
let pinned_root = root;
let pinned_root = root.clone();
let mut scanned = 0usize;
let mut candidates = Vec::new();
for year in read_codex_discovery_directory(&pinned_root, deadline, &mut scanned)? {
Expand Down
45 changes: 45 additions & 0 deletions src/internal/upgrade/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub enum EntryKind {
Other,
}

#[cfg(unix)]
fn validate_entry_name(name: &str) -> Result<(), InstallDirError> {
if name.is_empty() || name == "." || name == ".." || name.contains('/') || name.contains('\0') {
return Err(InstallDirError::BadEntryName(name.to_string()));
Expand Down Expand Up @@ -423,6 +424,50 @@ impl InstallDir {
pub fn open_validated(_path: &Path) -> Result<Self, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

/// The canonical directory path (diagnostics only).
pub fn path(&self) -> &Path {
&self.path
}

// Keep the Unix-only upgrade callers type-checking on unsupported
// platforms while failing closed before any filesystem operation.
pub fn stat_entry(&self, _name: &str) -> Result<Option<EntryKind>, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn read_file(&self, _name: &str) -> Result<Option<Vec<u8>>, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn write_file_atomic(
&self,
_name: &str,
_bytes: &[u8],
_mode: u32,
) -> Result<(), InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn rename_entry(&self, _from: &str, _to: &str) -> Result<(), InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn remove_file(&self, _name: &str) -> Result<bool, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn fsync_dir(&self) -> Result<(), InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn try_lock(&self) -> Result<Option<UpgradeLock>, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}

pub fn lock_blocking(&self) -> Result<UpgradeLock, InstallDirError> {
Err(InstallDirError::UnsupportedPlatform)
}
}

#[cfg(all(test, unix))]
Expand Down
Loading