From 6be758b9e3a10d3ff00e63dac7cecb9f4d4f65c3 Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Wed, 22 Jan 2025 18:05:40 -0500 Subject: [PATCH 1/2] chore: add macOS-specific Rust flags for dynamic linking --- rust/Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index d0cee4c..cbfb325 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -33,3 +33,9 @@ opt-level = "z" lto = true codegen-units = 1 panic = "abort" + +[target.'cfg(target_os = "macos")'] +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] \ No newline at end of file From d7ef3bb24ec4ae31ef4ca0402d88fd96de2e97b0 Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Wed, 22 Jan 2025 18:06:42 -0500 Subject: [PATCH 2/2] chore: update GitHub Actions workflow for precompiling all binaries --- .github/workflows/precompiled_binaries.yml | 37 +++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/precompiled_binaries.yml b/.github/workflows/precompiled_binaries.yml index 1950f9c..3862a45 100644 --- a/.github/workflows/precompiled_binaries.yml +++ b/.github/workflows/precompiled_binaries.yml @@ -1,6 +1,6 @@ on: push: - branches: [ main ] + branches: [ develop ] name: Precompile Binaries jobs: @@ -17,18 +17,33 @@ jobs: - uses: actions/checkout@v4 - uses: dart-lang/setup-dart@v1 - - name: Install GTK - if: (matrix.os == 'ubuntu-latest') - run: sudo apt-get update && sudo apt-get install libgtk-3-dev + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + + - name: Set RUSTFLAGS for macOS + if: (matrix.os == 'macOS-latest') + run: | + echo "RUSTFLAGS=-C link-arg=-undefined -C link-arg=dynamic_lookup" >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=17.5" >> $GITHUB_ENV + echo "IPHONEOS_DEPLOYMENT_TARGET=17.5" >> $GITHUB_ENV + + - name: Install Xcode Tools + if: (matrix.os == 'macOS-latest') + run: xcode-select --install || echo "Xcode tools already installed" + - name: Set up Android SDK if: (matrix.os == 'ubuntu-20.04') - uses: android-actions/setup-android@v2 - + uses: android-actions/setup-android@v2 + - name: Install Specific NDK if: (matrix.os == 'ubuntu-20.04') - run: sdkmanager --install "ndk;24.0.8215888" - - name: Precompile - if: (matrix.os == 'macOS-latest') || (matrix.os == 'windows-latest') + run: sdkmanager --install "ndk;25.1.8937393" + - name: Precompile (with iOS) + if: (matrix.os == 'macOS-latest') run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=SatoshiPortal/lwk-dart working-directory: cargokit/build_tool env: @@ -36,8 +51,8 @@ jobs: PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }} - name: Precompile (with Android) - if: (matrix.os == 'ubuntu-latest') - run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=SatoshiPortal/lwk-dart --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23 + if: (matrix.os == 'ubuntu-20.04') + run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=SatoshiPortal/lwk-dart --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23 working-directory: cargokit/build_tool env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}