From 780d715dfb7b3dca0637d552f8e016f7b525e853 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 22 Dec 2022 14:46:56 +0100 Subject: [PATCH 1/2] ci: issue with linking unixodbc when building OTP on macos arm64 --- .github/actions/package-macos/action.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/package-macos/action.yaml b/.github/actions/package-macos/action.yaml index a96187040..95915dd7d 100644 --- a/.github/actions/package-macos/action.yaml +++ b/.github/actions/package-macos/action.yaml @@ -59,11 +59,19 @@ runs: fi git clone --depth 1 --branch OTP-${{ inputs.otp }} https://github.com/emqx/otp.git "$OTP_SOURCE_PATH" cd "$OTP_SOURCE_PATH" + if [ "$(arch)" = arm64 ]; then + export LDFLAGS="-L$(brew --prefix unixodbc)/lib" + export CC="/usr/bin/gcc -I$(brew --prefix unixodbc)/include" + fi ./configure --disable-dynamic-ssl-lib --with-ssl=$(brew --prefix openssl@1.1) --disable-hipe --disable-jit --prefix="$OTP_INSTALL_PATH" make -j$(nproc) rm -rf "$OTP_INSTALL_PATH" make install - - name: build ${{ inputs.profile }} + if [ "$(arch)" = arm64 ]; then + unset LDFLAGS + unset CC + fi + - name: build env: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_UPGRADE: 1 From a1af5742e2a9ae27351374776924f0e8decf9dda Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 22 Dec 2022 14:48:56 +0100 Subject: [PATCH 2/2] chore: use unique name for temp macos keychain --- scripts/macos-sign-binaries.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/macos-sign-binaries.sh b/scripts/macos-sign-binaries.sh index 68a0216fa..5f933349e 100755 --- a/scripts/macos-sign-binaries.sh +++ b/scripts/macos-sign-binaries.sh @@ -21,10 +21,16 @@ REL_DIR="${1}" PKSC12_FILE="$HOME/developer-id-application.p12" base64 --decode > "${PKSC12_FILE}" <<<"${APPLE_DEVELOPER_ID_BUNDLE}" -KEYCHAIN='emqx.keychain-db' +KEYCHAIN="emqx-$(date +%s).keychain-db" KEYCHAIN_PASSWORD="$(openssl rand -base64 32)" -security delete-keychain "${KEYCHAIN}" 2>/dev/null || true +trap cleanup EXIT + +function cleanup { + set +e + security delete-keychain "${KEYCHAIN}" 2>/dev/null +} + security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN}" security set-keychain-settings -lut 21600 "${KEYCHAIN}" security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN}" @@ -69,3 +75,5 @@ for f in \ ; do find "${REL_DIR}"/lib/ -name "$f" -exec codesign -s "${APPLE_DEVELOPER_IDENTITY}" -f --verbose=4 --timestamp --options=runtime {} \; done + +cleanup