diff options
author | Wojtek Mach <wojtek@wojtekmach.pl> | 2021-07-08 17:24:52 +0200 |
---|---|---|
committer | Wojtek Mach <wojtek@wojtekmach.pl> | 2022-01-14 08:47:25 +0100 |
commit | c2a448049f8fab9371e87097e3a9057708581d72 (patch) | |
tree | 164e1ae0698d40abe5629989c39dfdd36c7f59be /.github/workflows | |
parent | f8e41f8553239fb02598ef6c019cdb8a174d4eea (diff) | |
download | erlang-c2a448049f8fab9371e87097e3a9057708581d72.tar.gz |
gh-actions: Add macOS builds
The build script can be conveniently executed locally:
% time MAKEFLAGS="-j8" .github/scripts/build-macos.sh
We statically link OpenSSL:
% otool -L otp/otp/lib/crypto-5.0.2/priv/lib/crypto.so
otp/otp/lib/crypto-5.0.2/priv/lib/crypto.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
See e.g.: https://rentzsch.tumblr.com/post/33696323211/wherein-i-write-apples-technote-about-openssl-on
We also statically link wxWidgets:
% otool -L lib/wx-2.1.1/priv/wxe_driver.so
lib/wx-2.1.1/priv/wxe_driver.so:
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 165.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/WebKit.framework/Versions/A/WebKit (compatibility version 1.0.0, current version 612.3.6)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60157.60.19)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
Worth remembering that when downloading the release from GitHub via Web
browser, macOS will put the file under quarantine:
% ~/Downloads% xattr -l otp_macos_25.0-rc0.tar
com.apple.quarantine: 0082;60e71fca;Safari;
and after unpacking the executables will be put under quarantine as
well, meaning they cannot be executed and you'll get a security warning.
Here's how we can remove the tarball from quarantine:
% xattr -d otp_macos_25.0-rc0.tar
This will not be a problem when downloading the tarball with curl, etc.
The proper solution is to codesign binaries.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/main.yaml | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 037ef6e253..e0db62c345 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Create initial pre-release tar + - name: Create initial pre-release tar run: .github/scripts/init-pre-release.sh - name: Upload source tar archive uses: actions/upload-artifact@v2 @@ -36,6 +36,53 @@ jobs: path: otp_src.tar.gz build-macos: + name: Build Erlang/OTP on macOS + runs-on: macos-10.15 + needs: pack + env: + WXWIDGETS_VERSION: 3.1.5 + steps: + - uses: actions/checkout@v2 + + - name: Download source archive + uses: actions/download-artifact@v2 + with: + name: otp_git_archive + + - name: Cache wxWidgets + id: wxwidgets-cache + uses: actions/cache@v2 + with: + path: wxWidgets + key: wxWidgets-${{ env.WXWIDGETS_VERSION }}-${{ runner.os }} + + - name: Compile wxWidgets + if: steps.wxwidgets-cache.outputs.cache-hit != 'true' + run: .github/scripts/build-macos-wxwidgets.sh + + - name: Compile Erlang + run: | + tar -xzf ./otp_src.tar.gz + export PATH=$PWD/wxWidgets/release/bin:$PATH + cd otp + $GITHUB_WORKSPACE/.github/scripts/build-macos.sh + tar -czf otp_macos_$(cat OTP_VERSION)_x86-64.tar.gz -C release . + + - name: Test Erlang + run: | + cd otp/release + ./Install -sasl $PWD + ./bin/erl -noshell -eval 'io:format("~s", [erlang:system_info(system_version)]), halt().' + ./bin/erl -noshell -eval 'ok = crypto:start(), io:format("crypto ok~n"), halt().' + ./bin/erl -noshell -eval '{wx_ref,_,_,_} = wx:new(), io:format("wx ok~n"), halt().' + + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: otp_prebuilt_macos_x86-64 + path: otp/otp_macos_*_x86-64.tar.gz + + build-ios: env: RELEASE_LIBBEAM: yes TARGET_ARCH: aarch64-apple-ios @@ -58,7 +105,7 @@ jobs: ./otp_build configure --xcomp-conf=./xcomp/erl-xcomp-arm64-ios.conf --without-ssl ./otp_build boot -a ./otp_build release -a - + - name: Package .xcframework run: | cd otp |