Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Draft: upgrade macos runner to use macos-12 on objective-c wrapper #83

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 8 additions & 8 deletions .github/workflows/ci-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cargo build --release
cp .\target\release\bbs.dll .\out\windows
# - run: yarn build:windows
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: windows
path: ./out/windows/*
Expand All @@ -40,7 +40,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: yarn build:linux
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: linux
path: ./out/linux/*
Expand All @@ -51,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: yarn build:macos
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: macos
path: ./out/macos/darwin-x86_64/*
Expand All @@ -62,7 +62,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: yarn build:ios
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ios
path: ./out/ios/*
Expand All @@ -73,15 +73,15 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Set up Android NDK
uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3 # pin@v1.3.1
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # pin@v1.5.0
id: setup-ndk
with:
ndk-version: r23
ndk-version: r27c

- run: yarn build:android
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: android
path: ./out/android/*
Expand All @@ -105,7 +105,7 @@ jobs:
- run: msbuild /t:restore,build /p:Configuration=Release ./wrappers/dotnet/
- run: dotnet test -c Release ./wrappers/dotnet/src/BbsSignatures.Tests/
- run: msbuild /t:restore,build,pack /p:Configuration=Release /p:Bbs_CopyLibsForProjectReference=false ./wrappers/dotnet/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: package-nuget
path: |
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/ci-obj-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ concurrency:
jobs:
build_test:
name: Build & Test Objective-C Wrapper
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-11
if: "! contains(github.event.head_commit.message, '[skip ci objective-c wrapper]')"
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Install Dependencies
run: yarn install --frozen-lockfile
Expand All @@ -30,7 +30,17 @@ jobs:
- name: Update binary for wrapper
run: yarn wrapper:obj-c:update-binary

- name: List Installed Xcode Versions
run: |
echo "Listing installed Xcode versions:"
ls -1 /Applications | grep Xcode

- name: Verify Xcode Path
run: |
echo "Checking Xcode Developer Directory..."
ls -ld /Applications/Xcode_14.2.app/Contents/Developer || echo "Path not found or inaccessible"

- name: Build and test wrapper
run: yarn wrapper:obj-c:build
env:
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
16 changes: 8 additions & 8 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cp .\target\release\bbs.dll .\out\windows
- if: "matrix.os != 'windows-latest'"
run: yarn build:${{matrix.plat-name-simple}}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.plat-name-simple}}
path: ${{matrix.target-path}}/*
Expand All @@ -73,16 +73,16 @@ jobs:
- os: windows-latest
plat-name-simple: windows
target-name: bbs.dll

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: ${{matrix.plat-name-simple}}
path: ./wrappers/python/ursa_bbs_signatures
Expand Down Expand Up @@ -126,11 +126,11 @@ jobs:
pip install setuptools wheel twine auditwheel

- name: Download library artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{matrix.plat-name-simple}}
path: ./wrappers/python/ursa_bbs_signatures

- name: Build python wheels
shell: sh
run: |
Expand All @@ -142,7 +142,7 @@ jobs:
run: auditwheel show ./wrappers/python/dist/*

- name: Upload python package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: python-${{ runner.os }}
path: ./wrappers/python/dist/*
Expand All @@ -158,4 +158,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*
working-directory: ./wrappers/python
working-directory: ./wrappers/python
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build_test:
name: Build & Test
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-latest
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -31,10 +31,10 @@ jobs:
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Set up Android NDK
uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3 # pin@v1.3.1
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # pin@v1.5.0
id: setup-ndk
with:
ndk-version: r23
ndk-version: r27c

- name: Build
run: yarn build
Expand Down
12 changes: 6 additions & 6 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

set -e

LANGUAGE=$1
PLATFORM=$2
LANGUAGE=$1 #C
PLATFORM=$2 #MACOS

if [ -z "$LANGUAGE" ]
then
Expand All @@ -20,13 +20,13 @@ fi

case $PLATFORM in
MACOS)
echo "Building for Apple Darwin x86_64"
rustup target add x86_64-apple-darwin
echo "Building for ARM Apple Darwin aarch64"
rustup target add aarch64-apple-darwin
case $LANGUAGE in
C)
echo "To be used with C"
cargo build --target x86_64-apple-darwin --release
export RUST_LIBRARY_DIRECTORY="${PWD}/target/x86_64-apple-darwin/release"
cargo build --target aarch64-apple-darwin --release
export RUST_LIBRARY_DIRECTORY="${PWD}/target/aarch64-apple-darwin/release"
cd $RUST_LIBRARY_DIRECTORY
cmake ../../../tests
cmake --build .
Expand Down
2 changes: 2 additions & 0 deletions src/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ use bbs::{ToVariableLengthBytes, FR_COMPRESSED_SIZE, G1_COMPRESSED_SIZE};
use std::cell::RefCell;

thread_local! {
#[allow(clippy::missing_const_for_thread_local)]
static LAST_ERROR: RefCell<Option<String>> = RefCell::new(None);
}

Expand All @@ -64,6 +65,7 @@ fn update_last_error(m: &str) {
pub extern "C" fn Java_bbs_signatures_Bbs_get_1last_1error<'a>(env: JNIEnv<'a>, _: JObject) -> JString<'a> {
let mut res = env.new_string("").unwrap();
LAST_ERROR.with(|prev| {
#[allow(clippy::single_match)]
match &*prev.borrow() {
Some(s) => res = env.new_string(s).unwrap(),
None => ()
Expand Down
Loading