-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
67: fix crosscompilations and support macos with zfs 2.0.1 r=jmesmon a=jmesmon Co-authored-by: Cody P Schafer <[email protected]>
- Loading branch information
Showing
8 changed files
with
245 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
on: | ||
push: | ||
branches-ignore: | ||
- '**.tmp' | ||
|
||
name: mac | ||
jobs: | ||
mac: | ||
runs-on: macos-10.15 | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
- 1.48.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
|
||
- name: Cache Rust dependencies | ||
uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Download openzfs-on-osx | ||
run: curl -o zfs.pkg https://openzfsonosx.org/forum/download/file.php?id=309&sid=f486243ccdc8e8e13894f14ce0b28d93 | ||
|
||
- name: Install openzfs-on-osx | ||
run: sudo installer -verbose -pkg zfs.pkg -target / | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --all-targets --all | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
fn var(s: &str) -> Result<String, std::env::VarError> { | ||
println!("cargo:rerun-if-env-changed={}", s); | ||
std::env::var(s) | ||
} | ||
|
||
fn main() { | ||
let target_os = var("CARGO_CFG_TARGET_OS").expect("Could not get env var CARGO_CFG_TARGET_OS"); | ||
|
||
// when using "openzfs on macos", zfs libs are installed outside the default link path. Add it | ||
// in | ||
// TODO: Provide a way to disable | ||
if target_os == "macos" { | ||
println!("cargo:rustc-link-search=native=/usr/local/zfs/lib"); | ||
} | ||
|
||
println!("cargo:rustc-link-lib=nvpair"); | ||
// FIXME: a bug exists in some versions of libnvpair causing it to depend on a symbol called | ||
// `aok`, which is in `libzfs`. | ||
println!("cargo:rustc-link-lib=zfs"); | ||
// nvpair uses functions from libspl on FreeBSD | ||
if cfg!(target_os = "freebsd") { | ||
if target_os == "freebsd" { | ||
println!("cargo:rustc-link-lib=spl"); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.