Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native builds, static feature and BLOSC2_INSTALL_PREFIX #8

Merged
merged 71 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1bd259f
Fix segfault in into_vec - bump version
milesgranger Mar 20, 2024
0842fa8
Fix double free
milesgranger Mar 22, 2024
d699c3e
Remove PIE setting in compilation
milesgranger Apr 2, 2024
d355d67
Add macos-latest to matrix
milesgranger Apr 2, 2024
4b5bf64
fixup
milesgranger Apr 2, 2024
2b67ea2
fixup
milesgranger Apr 2, 2024
2af6b42
fdixup
milesgranger Apr 2, 2024
89cceef
upgrade
milesgranger Apr 2, 2024
b2034f1
fixup
milesgranger Apr 2, 2024
160abfb
fixup
milesgranger Apr 2, 2024
4e25b76
fiuxp
milesgranger Apr 2, 2024
ac11577
fixup
milesgranger Apr 2, 2024
159f9f8
fixup
milesgranger Apr 2, 2024
0b36483
fixup
milesgranger Apr 2, 2024
6f6f6c7
fixup
milesgranger Apr 2, 2024
05a44d8
clang_osx conda
milesgranger Apr 2, 2024
2285d71
fixup
milesgranger Apr 2, 2024
6861a4e
fixup
milesgranger Apr 2, 2024
524fa56
fixup - use mold
milesgranger Apr 2, 2024
337a73a
static fixup
milesgranger Apr 2, 2024
ff75e45
fixup - explicit env
milesgranger Apr 3, 2024
cd24a97
try no conda env
milesgranger Apr 3, 2024
c684b58
fixup
milesgranger Apr 3, 2024
b96d333
chkpt - set out dir
milesgranger Apr 3, 2024
ac04682
fixup
milesgranger Apr 3, 2024
4dd1ceb
Remove all settings
milesgranger Apr 3, 2024
bbf599c
c compiler
milesgranger Apr 3, 2024
d4a2ce4
fixup
milesgranger Apr 3, 2024
73931aa
Initial refactor to use process cmake directly
milesgranger Apr 3, 2024
517b4bd
fixup
milesgranger Apr 3, 2024
2a8dd40
fixup
milesgranger Apr 3, 2024
67e557e
fixup
milesgranger Apr 4, 2024
f5724f3
fixup
milesgranger Apr 4, 2024
7484dd1
fixup
milesgranger Apr 4, 2024
7e7a448
another go
milesgranger Apr 4, 2024
44fa2ff
try only test lib
milesgranger Apr 4, 2024
8f0a16e
Remove header
milesgranger Apr 4, 2024
12bb7c9
chkpt - better build pass env var to blosc2 out
milesgranger Apr 4, 2024
e1eb75f
fixup
milesgranger Apr 4, 2024
f09b53b
Add PATH for windows build
milesgranger Apr 4, 2024
b6a8ccc
Use newer clang
milesgranger Apr 4, 2024
d67ff86
clang action
milesgranger Apr 5, 2024
de7ec70
fixup
milesgranger Apr 5, 2024
fafc2f8
fixup
milesgranger Apr 5, 2024
3f98f52
debug windows
milesgranger Apr 5, 2024
6cdc4c4
fixup
milesgranger Apr 6, 2024
9378116
non static link
milesgranger Apr 6, 2024
6193090
fixup
milesgranger Apr 6, 2024
2e384b7
Turn off static
milesgranger Apr 6, 2024
9a77e12
off ninja
milesgranger Apr 6, 2024
fd23026
ninja on use cl
milesgranger Apr 6, 2024
8911c6d
clang
milesgranger Apr 6, 2024
c4c335c
cl w/ -Ax86
milesgranger Apr 6, 2024
75187cc
fixup
milesgranger Apr 6, 2024
1f699fe
fixup
milesgranger Apr 6, 2024
a87cb90
try skipping string tests
milesgranger Apr 6, 2024
f4d550e
Working Windows w/ skipped tests
milesgranger Apr 6, 2024
f5dd6b6
Uncomment test_schunk_basic
milesgranger Apr 6, 2024
b0e2f58
try to skip bad test
milesgranger Apr 6, 2024
28d7bff
skip another
milesgranger Apr 6, 2024
6e85955
fixup
milesgranger Apr 6, 2024
fc61b73
fixup
milesgranger Apr 6, 2024
42df8aa
all os
milesgranger Apr 6, 2024
f5cbac6
fixup
milesgranger Apr 6, 2024
5511459
cleanup
milesgranger Apr 6, 2024
e88b55d
Extend w/ and w/o conda environment builds
milesgranger Apr 6, 2024
b89b939
fixup
milesgranger Apr 6, 2024
5acd5d0
fixup - add static feat and use cmake crate
milesgranger Apr 6, 2024
8b53e38
try static for all in conda
milesgranger Apr 6, 2024
be179fc
Add flags to test in conda env build/test
milesgranger Apr 6, 2024
bac247f
Bump c-blosc2 -> 2.14.3
milesgranger Apr 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- prereleased

jobs:
build-and-test:
test-conda-env:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -22,7 +22,7 @@ jobs:
- ubuntu-latest
flags:
- --features use-system-blosc2
- ''
- --features static
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -61,12 +61,83 @@ jobs:
- name: Build
shell: bash -el {0}
run: cargo build ${{ matrix.flags }}

- name: Test
# Running tests using shared library is ugly since conda doesn't
# update LD_LIBRARY_PATH type env vars, so would manually need to
# set the library to a currently discoverable place or update these
# env vars for each platform. Won't automatically locate the blosc2
# shared library within the conda environment.
if: ${{ matrix.flags == '' }}
if: ${{ matrix.flags == '--features static' }}
shell: bash -el {0}
run: cargo test ${{ matrix.flags }}

test-native:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-13 # x86_64
- macos-14 # M1
- windows-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- 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
run: cargo test
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blosc2-rs"
version = "0.2.1+2.13.2"
version = "0.2.3+2.14.3"
description = "Blosc2"
license = "MIT"
edition = "2021"
Expand All @@ -12,9 +12,10 @@ name = "blosc2"
[features]
defaults = []
use-system-blosc2 = ["blosc2-sys/use-system-blosc2"]
static = ["blosc2-sys/static"]

[dependencies]
blosc2-sys = { path = "blosc2-sys", version = "0.2.1+2.13.2" }
blosc2-sys = { path = "blosc2-sys", version = "0.2.3+2.14.3" }
parking_lot = "^0.12"

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion blosc2-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blosc2-sys"
version = "0.2.1+2.13.2"
version = "0.2.3+2.14.3"
edition = "2021"
description = "Bindings to C Blosc2"
license = "MIT"
Expand All @@ -13,6 +13,7 @@ links = "blosc2"
[features]
defaults = []
use-system-blosc2 = []
static = []

[build-dependencies]
cmake = "^0.1"
Expand Down
Loading
Loading