From f85bde195c56cd7b1b7ab5c70e1e4f07680b3f0f Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Thu, 20 Feb 2025 10:34:45 -0800 Subject: [PATCH 1/9] Set upstream bindings version to 0.0.125 This does not require any generated file changes. --- .github/actions/install-dependencies/action.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 2748162a..cc2bcb84 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -22,8 +22,8 @@ runs: run: | echo `pwd` mkdir -p ${{ inputs.destination }}/bin - git clone --branch 0.0.124-bindings https://github.com/lightningdevkit/rust-lightning ${{ inputs.destination }}/rust-lightning - git clone --branch main https://github.com/lightningdevkit/ldk-c-bindings ${{ inputs.destination }}/ldk-c-bindings + git clone --branch 0.0.125-bindings https://github.com/lightningdevkit/rust-lightning ${{ inputs.destination }}/rust-lightning + git clone --branch 0.0.125 https://github.com/lightningdevkit/ldk-c-bindings ${{ inputs.destination }}/ldk-c-bindings - name: Install Rust, required targets if: ${{ inputs.configureRustNightly == 'true' }} shell: bash diff --git a/README.md b/README.md index e4ea5afb..dacb7edf 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ In order to generate these bindings from scratch, you will need to clone two dep **[rust-lightning](https://github.com/lightningdevkit/rust-lightning)**, (a specific branch built for bindings compatibility): ```shell -git clone --branch 0.0.124-bindings https://github.com/lightningdevkit/rust-lightning /path/to/rust-lightning +git clone --branch 0.0.125-bindings https://github.com/lightningdevkit/rust-lightning /path/to/rust-lightning ``` **[ldk-c-bindings](https://github.com/lightningdevkit/ldk-c-bindings)**: From 81ff9eb36f64dcc6609cccccbcf1b07fd4681a65 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:37:18 -0800 Subject: [PATCH 2/9] Force nightly-2022-06-24 and clang macabi triplet --- scripts/build_individual_libldk.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/build_individual_libldk.py b/scripts/build_individual_libldk.py index 180bcd9e..a1f74f90 100644 --- a/scripts/build_individual_libldk.py +++ b/scripts/build_individual_libldk.py @@ -6,8 +6,12 @@ from script_config import ScriptConfig, BuildConfig RUSTUP_PATH = os.getenv('HOME') + '/.cargo/bin/rustup' +RUSTC_PATH = os.getenv('HOME') + '/.cargo/bin/rustc' CARGO_PATH = os.getenv('HOME') + '/.cargo/bin/cargo' +# 1.62: nightly-2022-05-13 +NIGHTLY_TOOLCHAIN = 'nightly-2022-06-24' # 1.63 + def run(config: ScriptConfig): if len(config.LIBLDK_BUILD_CONFIGURATIONS) != 1: @@ -55,7 +59,10 @@ def run(config: ScriptConfig): child_environment['RUSTFLAGS'] = '--cfg=c_bindings' child_environment['PATH'] = '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' - subprocess.check_call([RUSTUP_PATH, 'override', 'set', 'nightly-2022-05-13'], cwd=config.LDK_C_BINDINGS_DIRECTORY) + # stop cargo's obsession with x86_64-apple-ios13.0-macabi when nobody asked for it + child_environment['CFLAGS_x86_64_apple_ios_macabi'] = '--target=x86_64-apple-ios-macabi' + + subprocess.check_call([RUSTUP_PATH, 'override', 'set', NIGHTLY_TOOLCHAIN], cwd=config.LDK_C_BINDINGS_DIRECTORY) lipo_executables_input: [str] = [] @@ -95,8 +102,16 @@ def run(config: ScriptConfig): shutil.rmtree(cargo_target_directory, ignore_errors=True) subprocess.check_call([CARGO_PATH, 'clean'], cwd=config.LDK_C_BINDINGS_DIRECTORY) + rust_target_triplet = f'{rust_architecture}-apple-{rust_target_os}' + + print('Rust architecture:', rust_architecture) + print('Rust target OS:', rust_target_os) + print('Target:', rust_target_triplet) + + subprocess.check_call([RUSTC_PATH, f'+{NIGHTLY_TOOLCHAIN}', '-Z', 'unstable-options', '--print', 'target-spec-json', '--target', rust_target_triplet]) + # cargo build -Z build-std=panic_abort,std --features "std" --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}" $RUST_CONFIGURATION_FLAG - build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', f'{rust_architecture}-apple-{rust_target_os}'] + build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', rust_target_triplet] if config.RUST_CONFIGURATION_FLAG: build_arguments.append(config.RUST_CONFIGURATION_FLAG) subprocess.check_call( From 7fe5e098b8e1d5ddce091d25dccacc09e6f8c887 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:39:32 -0800 Subject: [PATCH 3/9] Force gsed use on Mac --- .github/actions/install-dependencies/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index cc2bcb84..19a55f8d 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -17,6 +17,8 @@ runs: if: ${{ runner.os == 'macOS' }} run: | brew install gnu-sed + mkdir -p /tmp/gnu-bin + ln -s "$(command -v gsed)" /tmp/gnu-bin/sed - name: Checkout Rust-Lightning and LDK-C-Bindings git shell: bash run: | @@ -49,7 +51,9 @@ runs: - name: Generate C Bindings shell: bash run: | - export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" + # Alias sed as gsed, if applicable + export PATH="/tmp/gnu-bin:$PATH" + pushd ${{ inputs.destination }}/ldk-c-bindings if [ "$RUNNER_OS" == "macOS" ]; then ./genbindings.sh ../rust-lightning true skip-tests From 979193c396d7027482eb932dceb886aaec1d5b88 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:39:53 -0800 Subject: [PATCH 4/9] Force cbindgen reinstall --- .github/actions/install-dependencies/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 19a55f8d..731ced55 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -47,7 +47,9 @@ runs: - name: Pin cbindgen v24 shell: bash run: | - cargo install --version 0.24.5 cbindgen + echo "DEVELOPER_DIR:" + echo $DEVELOPER_DIR + cargo install --force --version 0.24.5 cbindgen - name: Generate C Bindings shell: bash run: | From 5012b9703eda698493e861e953f405610c78652f Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:40:11 -0800 Subject: [PATCH 5/9] Update default and nightly rust toolchains --- .github/actions/install-dependencies/action.yml | 9 +++++++-- .github/workflows/swift.yml | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 731ced55..f3b19b96 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -26,13 +26,18 @@ runs: mkdir -p ${{ inputs.destination }}/bin git clone --branch 0.0.125-bindings https://github.com/lightningdevkit/rust-lightning ${{ inputs.destination }}/rust-lightning git clone --branch 0.0.125 https://github.com/lightningdevkit/ldk-c-bindings ${{ inputs.destination }}/ldk-c-bindings + - name: Configure default Rust toolchain + shell: bash + run: | + rustup install 1.73.0 + rustup default 1.73.0 - name: Install Rust, required targets if: ${{ inputs.configureRustNightly == 'true' }} shell: bash run: | - rustup toolchain install nightly-2022-05-13 + rustup toolchain install nightly-2022-06-24 rustup target add aarch64-apple-darwin aarch64-apple-ios x86_64-apple-ios - rustup component add rust-src --toolchain nightly-2022-05-13-x86_64-apple-darwin + rustup component add rust-src --toolchain nightly-2022-06-24-aarch64-apple-darwin - name: Load Cache if: ${{ inputs.configureRustNightly == 'true' }} uses: actions/cache@v3 diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index a1eab14a..6863eaf5 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -33,6 +33,16 @@ jobs: sudo apt-get update # sudo apt-get -y upgrade sudo apt-get -y install cargo lld git g++ clang curl + rustup install 1.73.0 + rustup default 1.73.0 + - name: Print updated environment details + run: | + set -x + rustup --version + clang --version + clang --print-resource-dir + ls -ll "$(clang -print-resource-dir)" + ls -ll "$(clang -print-resource-dir)/lib/linux" - name: Install Dependencies uses: ./.github/actions/install-dependencies with: From c6a573d22cf0aff036c936ba53f3a798add7f951 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:43:27 -0800 Subject: [PATCH 6/9] Use latest Mac instances --- .github/workflows/build-xcframework-parallel-archives.yml | 4 ++-- .github/workflows/build-xcframework-parallel-libldk.yml | 4 ++-- .github/workflows/build-xcframework-sequential.yml | 2 +- .github/workflows/direct-bindings-app-tests.yml | 2 +- .github/workflows/release-framework.yml | 2 +- .github/workflows/test-artifacts.yml | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-xcframework-parallel-archives.yml b/.github/workflows/build-xcframework-parallel-archives.yml index d2eb0ab7..eef08011 100644 --- a/.github/workflows/build-xcframework-parallel-archives.yml +++ b/.github/workflows/build-xcframework-parallel-archives.yml @@ -20,7 +20,7 @@ concurrency: jobs: build-xcarchives: name: Build xcarchive for ${{ matrix.configuration['human_readable_platform'] }} - runs-on: macos-12 + runs-on: macos-latest strategy: fail-fast: false matrix: @@ -64,7 +64,7 @@ jobs: generate: name: Combine xcarchives into xcframework - runs-on: macos-12 + runs-on: macos-latest needs: [ build-xcarchives ] env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer diff --git a/.github/workflows/build-xcframework-parallel-libldk.yml b/.github/workflows/build-xcframework-parallel-libldk.yml index ade74b15..59028532 100644 --- a/.github/workflows/build-xcframework-parallel-libldk.yml +++ b/.github/workflows/build-xcframework-parallel-libldk.yml @@ -20,7 +20,7 @@ concurrency: jobs: build-libldks: name: Build & lipo libldk.a for ${{ matrix.configuration['human_readable_platform'] }} - runs-on: macos-12 + runs-on: macos-latest env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings @@ -75,7 +75,7 @@ jobs: generate-parallel: name: Build xcarchives and generate xcframework needs: [ build-libldks ] - runs-on: macos-12 + runs-on: macos-latest env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings diff --git a/.github/workflows/build-xcframework-sequential.yml b/.github/workflows/build-xcframework-sequential.yml index bcb1e932..4aa891ed 100644 --- a/.github/workflows/build-xcframework-sequential.yml +++ b/.github/workflows/build-xcframework-sequential.yml @@ -20,7 +20,7 @@ concurrency: jobs: generate-sequential: name: Build libldks, build xcarchives, and combine into xcframework - runs-on: macos-12 + runs-on: macos-latest env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings diff --git a/.github/workflows/direct-bindings-app-tests.yml b/.github/workflows/direct-bindings-app-tests.yml index 7e8b8650..9c855838 100644 --- a/.github/workflows/direct-bindings-app-tests.yml +++ b/.github/workflows/direct-bindings-app-tests.yml @@ -20,7 +20,7 @@ concurrency: jobs: build: name: Build (${{ matrix.configuration['scheme'] }} - ${{ matrix.configuration['platform'] }}) - runs-on: macos-12 + runs-on: macos-latest continue-on-error: true strategy: fail-fast: false diff --git a/.github/workflows/release-framework.yml b/.github/workflows/release-framework.yml index 0c34358a..6c518e80 100644 --- a/.github/workflows/release-framework.yml +++ b/.github/workflows/release-framework.yml @@ -16,7 +16,7 @@ on: jobs: generate-xcframework: name: Generate XCFramework - runs-on: macos-12 + runs-on: macos-latest env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings diff --git a/.github/workflows/test-artifacts.yml b/.github/workflows/test-artifacts.yml index 6b43b409..58f27572 100644 --- a/.github/workflows/test-artifacts.yml +++ b/.github/workflows/test-artifacts.yml @@ -11,7 +11,7 @@ on: jobs: create-artifact: name: Add ${{ matrix.configuration['human_readable_platform'] }} to artifact - runs-on: macos-12 + runs-on: macos-latest strategy: fail-fast: false matrix: @@ -39,7 +39,7 @@ jobs: download-artifact: name: Download artifact - runs-on: macos-12 + runs-on: macos-latest needs: [ create-artifact ] steps: - name: Checkout From 1c4ba432a14f5d401ade7bdc7b21e8e63f33b72c Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:44:40 -0800 Subject: [PATCH 7/9] Use latest artifact upload/download action versions --- .../upload-xcframework-artifact/action.yml | 2 +- .../build-xcframework-parallel-archives.yml | 16 +++++++++++++--- .../build-xcframework-parallel-libldk.yml | 16 +++++++++++++--- .github/workflows/test-artifacts.yml | 2 +- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/actions/upload-xcframework-artifact/action.yml b/.github/actions/upload-xcframework-artifact/action.yml index 464d19fc..cc1c6936 100644 --- a/.github/actions/upload-xcframework-artifact/action.yml +++ b/.github/actions/upload-xcframework-artifact/action.yml @@ -14,7 +14,7 @@ runs: python3 ./scripts/symlink_resolver.py /Users/runner/work/ldk-swift/ldk-swift/bindings/bin/release/LightningDevKit-no-symlinks.xcframework ditto -c -k --sequesterRsrc --keepParent /Users/runner/work/ldk-swift/ldk-swift/bindings/bin/release/LightningDevKit-no-symlinks.xcframework LightningDevKit-no-symlinks.xcframework.zip - name: Upload Framework Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: LightningDevKit path: | diff --git a/.github/workflows/build-xcframework-parallel-archives.yml b/.github/workflows/build-xcframework-parallel-archives.yml index eef08011..d6f3effb 100644 --- a/.github/workflows/build-xcframework-parallel-archives.yml +++ b/.github/workflows/build-xcframework-parallel-archives.yml @@ -57,9 +57,9 @@ jobs: - name: Xcarchive hack run: touch ./bindings_root.txt - name: Upload xcarchive - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: bindings + name: bindings-${{ matrix.configuration['human_readable_platform'] }} path: ./bindings/**/bin/release/${{ matrix.configuration['human_readable_platform'] }}/${{ matrix.configuration['human_readable_platform'] }}.xcarchive generate: @@ -77,7 +77,17 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Download xcarchives - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: ./bindings + - name: Print post-artifact-download directory structure + shell: bash + run: | + echo "Current path:" + pwd + echo "Recursive enumeration" + find "$PWD" - name: Generate xcframework shell: bash run: diff --git a/.github/workflows/build-xcframework-parallel-libldk.yml b/.github/workflows/build-xcframework-parallel-libldk.yml index 59028532..93124f55 100644 --- a/.github/workflows/build-xcframework-parallel-libldk.yml +++ b/.github/workflows/build-xcframework-parallel-libldk.yml @@ -65,9 +65,9 @@ jobs: LLVM_TARGET_TRIPLE_SUFFIX: ${{ matrix.configuration['llvm_target_triple_suffix'] }} ARCHS: ${{ matrix.configuration['architectures'] }} - name: Upload binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: bindings + name: bindings-${{ matrix.configuration['human_readable_platform'] }} path: | ./bindings/**/artifacts/ldk-c-bindings/lightning-c-bindings/include/*.h ./bindings/**/artifacts/ldk-c-bindings/ldk-net/ldk_net.* @@ -87,7 +87,17 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Download libldks - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: ./bindings + - name: Print post-artifact-download directory structure + shell: bash + run: | + echo "Current path:" + pwd + echo "Recursive enumeration" + find "$PWD" - name: Generate Swift Bindings shell: bash run: | diff --git a/.github/workflows/test-artifacts.yml b/.github/workflows/test-artifacts.yml index 58f27572..bfab679d 100644 --- a/.github/workflows/test-artifacts.yml +++ b/.github/workflows/test-artifacts.yml @@ -32,7 +32,7 @@ jobs: mkdir -p ./bindings/bin/release/${{ matrix.configuration['human_readable_platform'] }} touch ./bindings/bin/release/${{ matrix.configuration['human_readable_platform'] }}/${{ matrix.configuration['human_readable_platform'] }}.xcarchive - name: Upload emulated xcarchive - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: uploaded-artifact-name path: ./bindings/**/bin/release/${{ matrix.configuration['human_readable_platform'] }}/${{ matrix.configuration['human_readable_platform'] }}.xcarchive From 108f6d11375ffc89331fff1e3f537c16dd2686d6 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:46:04 -0800 Subject: [PATCH 8/9] Use Xcode 15.4 --- .../build-xcframework-parallel-archives.yml | 12 ++++++++---- .../workflows/build-xcframework-parallel-libldk.yml | 8 ++++---- .github/workflows/build-xcframework-sequential.yml | 9 +++++++-- .github/workflows/direct-bindings-app-tests.yml | 2 +- .github/workflows/release-framework.yml | 4 ++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-xcframework-parallel-archives.yml b/.github/workflows/build-xcframework-parallel-archives.yml index d6f3effb..c10fc09e 100644 --- a/.github/workflows/build-xcframework-parallel-archives.yml +++ b/.github/workflows/build-xcframework-parallel-archives.yml @@ -34,14 +34,18 @@ jobs: - destination: 'macOS,variant=Mac Catalyst' human_readable_platform: 'catalyst' env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings LDK_C_BINDINGS_BINARY_DIRECTORY: ${{ github.workspace }}/bindings/artifacts/bin steps: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 + - name: Print Xcode SDK availability + shell: bash + run: + xcodebuild -showsdks - name: Checkout uses: actions/checkout@v3 - name: Install Dependencies @@ -67,13 +71,13 @@ jobs: runs-on: macos-latest needs: [ build-xcarchives ] env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings steps: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 - name: Checkout uses: actions/checkout@v3 - name: Download xcarchives diff --git a/.github/workflows/build-xcframework-parallel-libldk.yml b/.github/workflows/build-xcframework-parallel-libldk.yml index 93124f55..f35befcc 100644 --- a/.github/workflows/build-xcframework-parallel-libldk.yml +++ b/.github/workflows/build-xcframework-parallel-libldk.yml @@ -22,7 +22,7 @@ jobs: name: Build & lipo libldk.a for ${{ matrix.configuration['human_readable_platform'] }} runs-on: macos-latest env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings strategy: fail-fast: true @@ -49,7 +49,7 @@ jobs: if: matrix.configuration['human_readable_platform'] == 'catalyst' uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 - name: Checkout uses: actions/checkout@v3 - name: Install Dependencies @@ -77,13 +77,13 @@ jobs: needs: [ build-libldks ] runs-on: macos-latest env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings steps: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 - name: Checkout uses: actions/checkout@v3 - name: Download libldks diff --git a/.github/workflows/build-xcframework-sequential.yml b/.github/workflows/build-xcframework-sequential.yml index 4aa891ed..7deb0872 100644 --- a/.github/workflows/build-xcframework-sequential.yml +++ b/.github/workflows/build-xcframework-sequential.yml @@ -22,13 +22,18 @@ jobs: name: Build libldks, build xcarchives, and combine into xcframework runs-on: macos-latest env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings steps: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 + - name: Print Xcode SDK availability + shell: bash + run: | + xcodebuild -showsdks + ls /Applications/ - name: Checkout uses: actions/checkout@v3 - name: Install Dependencies diff --git a/.github/workflows/direct-bindings-app-tests.yml b/.github/workflows/direct-bindings-app-tests.yml index 9c855838..a785a52f 100644 --- a/.github/workflows/direct-bindings-app-tests.yml +++ b/.github/workflows/direct-bindings-app-tests.yml @@ -41,7 +41,7 @@ jobs: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 - name: Checkout uses: actions/checkout@v2 - name: Install Dependencies diff --git a/.github/workflows/release-framework.yml b/.github/workflows/release-framework.yml index 6c518e80..874f4b65 100644 --- a/.github/workflows/release-framework.yml +++ b/.github/workflows/release-framework.yml @@ -18,13 +18,13 @@ jobs: name: Generate XCFramework runs-on: macos-latest env: - DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.0.app/Contents/Developer LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings steps: - name: Configure Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest + xcode-version: 15.4.0 - name: Checkout uses: actions/checkout@v3 - name: Update Package.swift tag to ${{ github.event.inputs.tag }} From c5cd72ba6279066f896f879a6d014d139e4fb461 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 26 Feb 2025 09:46:57 -0800 Subject: [PATCH 9/9] Test bindings with address sanitizer first --- .github/workflows/swift.yml | 38 +++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 6863eaf5..912b5a2d 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -94,27 +94,53 @@ jobs: - name: Verify generated output recency run: | git diff --exit-code out/ ':(exclude)out/VersionDescriptor.swift' - - name: Build Swift bindings package + - name: Build Swift bindings package with address sanitizer run: | cd ci/LDKSwift + # should be /usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.asan-x86_64.a + export LLVM_CLANG_ASAN_PATH="$(clang -print-resource-dir)/lib/linux/libclang_rt.asan-x86_64.a" ../../swift-5.7.2-RELEASE-ubuntu22.04/usr/bin/swift build env: LDK_C_BINDINGS_BASE: ${{ github.workspace }}/ci/ldk-c-bindings - LLVM_CLANG_ASAN_PATH: /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a RUST_BACKTRACE: 1 - - name: Test Swift bindings package without address sanitizer + - name: Test Swift bindings package with address sanitizer + continue-on-error: true run: | cd ci/LDKSwift + # should be /usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.asan-x86_64.a + export LLVM_CLANG_ASAN_PATH="$(clang -print-resource-dir)/lib/linux/libclang_rt.asan-x86_64.a" ../../swift-5.7.2-RELEASE-ubuntu22.04/usr/bin/swift test -v env: LDK_C_BINDINGS_BASE: ${{ github.workspace }}/ci/ldk-c-bindings RUST_BACKTRACE: 1 - - name: Test Swift bindings package with address sanitizer - continue-on-error: true + - name: Prepare release-optimized rust binaries + run: | + env + pushd ${{ github.workspace }}/ci/ldk-c-bindings/lightning-c-bindings + cargo clean + cargo build --release --features std + + # debug the target + find ./target + env: + RUST_BACKTRACE: 1 + RUSTFLAGS: --cfg=c_bindings -C embed-bitcode=yes -C lto + CARGO_PROFILE_RELEASE_LTO: true + - name: Build Swift bindings package without address sanitizer + run: | + env + cd ci/LDKSwift + ../../swift-5.7.2-RELEASE-ubuntu22.04/usr/bin/swift build + env: + LDK_C_BINDINGS_BASE: ${{ github.workspace }}/ci/ldk-c-bindings + LDK_C_BINDINGS_BINARY_DIRECTORY: ${{ github.workspace }}/ci/ldk-c-bindings/lightning-c-bindings/target/release + RUST_BACKTRACE: 1 + - name: Test Swift bindings package without address sanitizer run: | + env cd ci/LDKSwift ../../swift-5.7.2-RELEASE-ubuntu22.04/usr/bin/swift test -v env: LDK_C_BINDINGS_BASE: ${{ github.workspace }}/ci/ldk-c-bindings - LLVM_CLANG_ASAN_PATH: /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a + LDK_C_BINDINGS_BINARY_DIRECTORY: ${{ github.workspace }}/ci/ldk-c-bindings/lightning-c-bindings/target/release RUST_BACKTRACE: 1