Skip to content

Commit

Permalink
Fix compilation on x86_64-unknown-illumos (#54)
Browse files Browse the repository at this point in the history
* Fix compilation on `x86_64-unknown-illumos`

Fixed #53

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* CI: Add regression check for `x86_64-unknown-illumos`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* CI: Fix job `cross-check-unsupported-platform`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* CI: Fix job `cross-check-unsupported-platform`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu authored Dec 6, 2023
1 parent 7dffdcc commit 833deca
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,24 @@ jobs:
- uses: Swatinem/rust-cache@v2

- run: cargo check --all-features

cross-check-unsupported-platform:
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-illumos]

env:
CARGO_BUILD_TARGET: ${{ matrix.target }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rustup target
run: |
rustup toolchain install nightly --profile minimal --component rust-src
- uses: Swatinem/rust-cache@v2

- name: Cross check
run: cargo +nightly check --target ${{ matrix.target }} -Zbuild-std
4 changes: 2 additions & 2 deletions src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ cfg_if! {
mod windows_impl;
pub use self::windows_impl::reflink;
} else {
use self::reflink_not_supported as reflink;
pub use self::reflink_not_supported as reflink;
}
}

#[allow(dead_code)]
fn reflink_not_supported(_from: &Path, _to: &Path) -> std::io::Result<()> {
pub fn reflink_not_supported(_from: &Path, _to: &Path) -> std::io::Result<()> {
Err(std::io::ErrorKind::Unsupported.into())
}
2 changes: 1 addition & 1 deletion src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cfg_if! {
mod macos;
pub use macos::reflink;
} else {
use super::reflink_not_supported as reflink;
pub use super::reflink_not_supported as reflink;
}
}

0 comments on commit 833deca

Please # to comment.