From 1aac2d17ecdd3a794f3fa6ccd0487f7e626e2bc0 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Mon, 10 Jun 2024 09:55:14 +0200 Subject: [PATCH] fix: build on arm64 --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ c_src/main.c | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54d374f..0e94075 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,3 +115,41 @@ jobs: "status": "done" } }' + + macos: + strategy: + matrix: + otp-version: ['25', '26'] + fdb-version: ['7.3.27'] + runs-on: macos-14 + env: + FDB_VERSION: ${{ matrix.fdb-version }} + # Set to 1 for verbose rebar3 logging + DEBUG: 0 + # Set to 1 for even more verbose rebar3 logging + DIAGNOSTIC: 0 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Setup Erlang + run: | + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + brew install erlang@${{ matrix.otp-version }} + echo "$(brew --prefix erlang@${{ matrix.otp-version }})/bin" >> $GITHUB_PATH + wget https://s3.amazonaws.com/rebar3/rebar3 + sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3 + export "PATH=$(brew --prefix erlang@${{ matrix.otp-version }})/bin:$PATH" + erl -eval 'erlang:display(erlang:system_info(system_version)),halt()' + - name: Install FoundationDB + run: | + wget -q https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/FoundationDB-${FDB_VERSION}_arm64.pkg + sudo installer -pkg FoundationDB-${FDB_VERSION}_arm64.pkg -target / + fdbcli --exec "configure new single ssd tenant_mode=optional_experimental; status" --timeout 60 + - name: Initialize FDB database + run: fdbcli --exec "configure new single ssd tenant_mode=optional_experimental; status" --timeout 60 + - name: Compile + run: rebar3 compile + - name: EUnit tests + run: rebar3 eunit diff --git a/c_src/main.c b/c_src/main.c index 3a68009..a8c1be2 100644 --- a/c_src/main.c +++ b/c_src/main.c @@ -1240,7 +1240,7 @@ erlfdb_transaction_get_range_split_points( ErlFDBTransaction* t; ErlNifBinary begin; ErlNifBinary end; - int64_t chunkSize; + ErlNifSInt64 chunkSize; FDBFuture* future; void* res;