History

Merge pull request #1600 from Earthmark/earthmark/wasi_identity

Implemented `is_path_owned_by_current_user` for wasi.

Sebastian Thiel committed 2 years ago

Commit be2f0932 parents 5ef4d5d 67536a02 files · +12 −1Browse files

Unified · Split

2 files
  1. .github/workflows/ci.yml +3 −0
  2. gix-sec/src/identity.rs +9 −1
.github/workflows/ci.yml+3−0
@@ -177,6 +177,9 @@ jobs: · 176 unmodified lines
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
@@ -17,7 +17,15 @@ pub fn is_path_owned_by_current_user(path: &Path) -> std::io::Result<bool> { · 16 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t