Skip to content

Commit be2f093

Browse files
authored
Merge pull request #1600 from Earthmark/earthmark/wasi_identity
Implemented `is_path_owned_by_current_user` for wasi.
2 parents 5ef4d5d + 67536a0 commit be2f093

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ jobs:
177177
- name: Install Rust
178178
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
179179
- uses: Swatinem/rust-cache@v2
180+
- run: set +x; for name in gix-sec; do (cd $name && cargo build --target ${{ matrix.target }}); done
181+
name: "WASI only: crates without feature toggle"
182+
if: endsWith(matrix.target, '-wasi')
180183
- run: set +x; for name in gix-actor gix-attributes gix-bitmap gix-chunk gix-command gix-commitgraph gix-config-value gix-date gix-glob gix-hash gix-hashtable gix-mailmap gix-object gix-packetline gix-path gix-pathspec gix-prompt gix-quote gix-refspec gix-revision gix-traverse gix-url gix-validate; do (cd $name && cargo build --target ${{ matrix.target }}); done
181184
name: crates without feature toggles
182185
- run: set +x; for feature in progress fs-walkdir-parallel parallel io-pipe crc32 zlib zlib-rust-backend fast-sha1 rustsha1 cache-efficiency-debug; do (cd gix-features && cargo build --features $feature --target ${{ matrix.target }}); done

gix-sec/src/identity.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ pub fn is_path_owned_by_current_user(path: &Path) -> std::io::Result<bool> {
1717
impl_::is_path_owned_by_current_user(path)
1818
}
1919

20-
#[cfg(not(windows))]
20+
// Wasi doesn't have a concept of a user, so this is implicitly true.
21+
#[cfg(target_os = "wasi")]
22+
mod impl_ {
23+
pub fn is_path_owned_by_current_user(_path: &std::path::Path) -> std::io::Result<bool> {
24+
Ok(true)
25+
}
26+
}
27+
28+
#[cfg(all(not(windows), not(target_os = "wasi")))]
2129
mod impl_ {
2230
use std::path::Path;
2331

0 commit comments

Comments
 (0)