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

musl build? #25

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 15 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: '🏦 Build'

env:
VERSION: 1.6.2
# PACKAGE_SUFFIX: '-pre.1'
PACKAGE_SUFFIX: ''
VERSION: 1.6.3
PACKAGE_SUFFIX: '-pre.1'
# PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
BUILD_TYPE: Release
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
Expand All @@ -27,18 +27,28 @@ jobs:
matrix:
include:
- os: ubuntu-20.04
name: Linux x64
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-x64
- os: ubuntu-22.04
name: Linux x64 musl
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-musl-x64
cmake_options: -D CMAKE_C_FLAGS="-static -Os"
- os: ubuntu-20.04
name: Linux ARM
arch: arm64
vcpkg_triplet: arm64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-arm64
no_native_tests: true
cmake_options: -D CMAKE_SYSTEM_PROCESSOR=aarch64 -D CMAKE_C_COMPILER=$(which aarch64-linux-gnu-gcc) -D CMAKE_CXX_COMPILER=$(which aarch64-linux-gnu-g++)
- os: windows-latest
name: Windows x64
arch: x64
vcpkg_triplet: x64-windows-static
vcpkg_config: Release
Expand All @@ -51,14 +61,15 @@ jobs:
# dotnet_rid: win-x86
# cmake_options: -D CMAKE_GENERATOR_PLATFORM=x86
- os: macos-latest
name: MacOS ARM
arch: arm64
vcpkg_triplet: arm64-osx
vcpkg_config: RelWithDebInfo
dotnet_rid: osx-arm64
cmake_options: -D CMAKE_OSX_ARCHITECTURES=arm64

fail-fast: false
name: 'build: ${{ matrix.os }} (${{ matrix.arch }})'
name: 'build: ${{ matrix.name }}'

env:
VCPKG_DEFAULT_VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.6.3

- Native build for Linux [musl](https://wiki.musl-libc.org/projects-using-musl.html) runtime.
- Fixed regression - when native library cannot be loaded, the entire compression fails.

## 1.6.2

- Improvement: native library can return it's version.
Expand Down
7 changes: 5 additions & 2 deletions managed/IronCompress/Iron.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ public static bool SupportsManaged(Codec c) {
}

public static bool SupportsNative(Codec c) {
if(!IsNativeLibraryAvailable) {
return false;
}
return Native.iron_is_supported((int)c);
}

public static string GetNativeVersion() {
public static string? GetNativeVersion() {
IntPtr ptr = Native.iron_version();
string version = Marshal.PtrToStringAnsi(ptr);
string? version = Marshal.PtrToStringAnsi(ptr);
return version;
}

Expand Down