Skip to content

Commit

Permalink
Try to simplify native build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Apr 11, 2024
1 parent 5c53573 commit 9cd3345
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 49 deletions.
54 changes: 5 additions & 49 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,54 +90,10 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install packages (macOS)
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV
brew install ninja
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: choco install ninja cmake

- name: Install packages (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ninja-build -y
- name: Set up Clang (Ubuntu)
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
with:
version: 17

- name: Set Env (non-Windows)
if: runner.os != 'Windows'
# Cannot set dynamic link path from build.rs
# So cargo test --lib works, but cargo test --doc fails to load shared library
# xref: https://github.com/rust-lang/cargo/issues/4895
run: |
echo "BLOSC2_INSTALL_PREFIX=$(pwd)/build" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$(pwd)/build/lib64:$(pwd)/build/lib" >> $GITHUB_ENV
echo "DYLD_FALLBACK_LIBRARY_PATH=$(pwd)/build/lib64:$(pwd)/build/lib" >> $GITHUB_ENV
- name: Set Env (Windows)
if: runner.os == 'Windows'
# Cannot set dynamic link path from build.rs
# So cargo test --lib works, but cargo test --doc fails to load shared library
# xref: https://github.com/rust-lang/cargo/issues/4895
run: |
echo "BLOSC2_INSTALL_PREFIX=${{ github.workspace }}\build" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$Env:PATH += ";${{ github.workspace }}\build\lib;${{ github.workspace }}\build\lib64;${{ github.workspace }}\build\bin"
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$Env:LIBPATH += ";${{ github.workspace }}\build\lib;${{ github.workspace }}\build\lib64;${{ github.workspace }}\build\bin"
echo "LIBPATH=$Env:LIBPATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$Env:LIB += ";${{ github.workspace }}\build\lib;${{ github.workspace }}\build\lib64;${{ github.workspace }}\build\bin"
echo "LIB=$Env:LIB" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Test
if: matrix.os != "macos-13"
run: cargo test

- name: Test (macos-13)
if: matrix.os == "macos-13"
run: cargo test --no-default-features # turn of static linking, fails w/ 'Undefined symbols: __cpu_model'
9 changes: 9 additions & 0 deletions blosc2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ edition = "2021"
description = "Bindings to C Blosc2"
license = "MIT"
links = "blosc2"
exclude = [
"c-blosc2/compat/**",
"c-blosc2/tests/**",
"c-blosc2/bench/**",
"c-blosc2/internal-complibs/zlib-ng-2.0.7/contrib/**",
"c-blosc2/internal-complibs/zlib-ng-2.0.7/examples/**",
"c-blosc2/internal-complibs/zlib-ng-2.0.7/doc/**",
"c-blosc2/internal-complibs/zstd-1.5.5/legacy/**",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down

0 comments on commit 9cd3345

Please sign in to comment.