Implemented `is_path_owned_by_current_user` for wasi.
Unified · Split
| @@ -177,6 +177,9 @@ jobs: · 176 unmodified lines | |||
| 177 | - name: Install Rust | 177 | - name: Install Rust |
| 178 | run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} | 178 | run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} |
| 179 | - uses: Swatinem/rust-cache@v2 | 179 | - 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') | ||
| 180 | - 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 | 183 | - 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 |
| 181 | name: crates without feature toggles | 184 | name: crates without feature toggles |
| 182 | - 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 | 185 | - 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 |
| @@ -17,7 +17,15 @@ pub fn is_path_owned_by_current_user(path: &Path) -> std::io::Result<bool> { · 16 unmodified lines | |||
| 17 | impl_::is_path_owned_by_current_user(path) | 17 | impl_::is_path_owned_by_current_user(path) |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 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")))] | ||
| 21 | mod impl_ { | 29 | mod impl_ { |
| 22 | use std::path::Path; | 30 | use std::path::Path; |
| 23 | 31 | ||