From 429c5f1ea3b466d8a18d2b65b0c9b114e729825d Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 19:26:33 +0200 Subject: [PATCH 01/19] ci: try universal binaries --- .github/workflows/build.yml | 54 ++++++++++++-------------- .github/workflows/create-installer.yml | 7 ++-- .github/workflows/test.yml | 1 + 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8f14f35951..da30f41d0f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,30 +110,21 @@ jobs: path: build/Chatterino-${{ matrix.os }}-x86_64.deb build: - name: "Build ${{ matrix.os }}${{ matrix.arch && format(' ({0})', matrix.arch) || ''}}, Qt ${{ matrix.qt-version }} (LTO:${{ matrix.force-lto }}, crashpad:${{ matrix.skip-crashpad && 'off' || 'on' }})" + name: "Build ${{ matrix.os }}, Qt ${{ matrix.qt-version }} (LTO:${{ matrix.force-lto }}, crashpad:${{ matrix.skip-crashpad && 'off' || 'on' }})" runs-on: ${{ matrix.os }} strategy: matrix: include: # Windows - os: windows-latest - qt-version: 6.7.1 + qt-version: 6.7.3 force-lto: false plugins: true skip-artifact: false skip-crashpad: false # macOS (ARM) - os: macos-latest - qt-version: 6.7.1 - arch: arm64 - force-lto: false - plugins: true - skip-artifact: false - skip-crashpad: false - # macOS (x86) - - os: macos-13 - qt-version: 6.7.1 - arch: x86_64 + qt-version: 6.7.3 force-lto: false plugins: true skip-artifact: false @@ -306,7 +297,7 @@ jobs: -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ -DCHATTERINO_NO_AVIF_PLUGIN=On \ - -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \ + -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 \ .. make -j"$(sysctl -n hw.logicalcpu)" shell: bash @@ -314,7 +305,7 @@ jobs: - name: Package (MacOS) if: startsWith(matrix.os, 'macos') env: - OUTPUT_DMG_PATH: chatterino-macos-Qt-${{ matrix.qt-version}}-${{ matrix.arch }}.dmg + OUTPUT_DMG_PATH: chatterino-macos-Qt-${{ matrix.qt-version}}-universal.dmg run: | ls -la pwd @@ -334,8 +325,18 @@ jobs: if: startsWith(matrix.os, 'macos') uses: actions/upload-artifact@v4 with: - name: chatterino-macos-Qt-${{ matrix.qt-version }}-${{ matrix.arch }}.dmg - path: build/chatterino-macos-Qt-${{ matrix.qt-version }}-${{ matrix.arch }}.dmg + name: chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg + path: build/chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 15 + + - if: failure() + name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 15 + create-release: needs: [build-ubuntu-docker, build] runs-on: ubuntu-latest @@ -348,15 +349,15 @@ jobs: # Windows - uses: actions/download-artifact@v4 - name: Windows Qt6.7.1 + name: Windows Qt6.7.3 with: - name: chatterino-windows-x86-64-Qt-6.7.1.zip + name: chatterino-windows-x86-64-Qt-6.7.3.zip path: release-artifacts/ - uses: actions/download-artifact@v4 - name: Windows Qt6.7.1 symbols + name: Windows Qt6.7.3 symbols with: - name: chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z + name: chatterino-windows-x86-64-Qt-6.7.3-symbols.pdb.7z path: release-artifacts/ # Linux @@ -380,23 +381,16 @@ jobs: # macOS - uses: actions/download-artifact@v4 - name: macOS x86_64 Qt6.7.1 x86 dmg - with: - name: chatterino-macos-Qt-6.7.1-x86_64.dmg - path: release-artifacts/ - - - uses: actions/download-artifact@v4 - name: macOS x86_64 Qt6.7.1 ARM dmg + name: macOS Qt6.7.3 dmg with: - name: chatterino-macos-Qt-6.7.1-arm64.dmg + name: chatterino-macos-Qt-6.7.3-universal.dmg path: release-artifacts/ - name: Rename artifacts run: | ls -l # Rename the macos build to indicate that it's for macOS 12.0 users - mv chatterino-macos-Qt-6.7.1-x86_64.dmg Chatterino-macOS-12.0-x86_64.dmg - mv chatterino-macos-Qt-6.7.1-arm64.dmg Chatterino-macOS-12.0-arm64.dmg + mv chatterino-macos-Qt-6.7.3-x86_64.dmg Chatterino-macOS-12.0-universal.dmg working-directory: release-artifacts shell: bash diff --git a/.github/workflows/create-installer.yml b/.github/workflows/create-installer.yml index 2b79ee151ed..a746d3c8e31 100644 --- a/.github/workflows/create-installer.yml +++ b/.github/workflows/create-installer.yml @@ -20,7 +20,7 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} strategy: matrix: - qt-version: ["6.7.1"] + qt-version: ["6.7.3"] steps: - uses: actions/checkout@v4 with: @@ -148,10 +148,9 @@ jobs: mv Chatterino-x86_64-Qt-6.7.2.AppImage Chatterino-x86_64-Qt6.AppImage - mv chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z + mv chatterino-windows-x86-64-Qt-6.7.3-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z - mv chatterino-macos-Qt-6.7.1-x86_64.dmg Chatterino-x86_64.dmg - mv chatterino-macos-Qt-6.7.1-arm64.dmg Chatterino-arm64.dmg + mv chatterino-macos-Qt-6.7.3-universal.dmg Chatterino.dmg - name: Hash files working-directory: build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0451c605fda..03a88ade61a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,3 +98,4 @@ jobs: plugin: gcov fail_ci_if_error: true verbose: true + if: false From 20604d9f085ca9bafa2b7abb4a161405cfd5a186 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 19:37:28 +0200 Subject: [PATCH 02/19] fix: semi --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da30f41d0f9..4cf5a3d2548 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -297,7 +297,7 @@ jobs: -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ -DCHATTERINO_NO_AVIF_PLUGIN=On \ - -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 \ + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ .. make -j"$(sysctl -n hw.logicalcpu)" shell: bash From 9ea7a8daff519338951837176853a0e5248fa92c Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 20:24:05 +0200 Subject: [PATCH 03/19] asgra --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cf5a3d2548..210281851fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -283,6 +283,11 @@ jobs: brew install boost openssl rapidjson p7zip create-dmg cmake tree shell: bash + - if: startsWith(matrix.os, 'macos') + name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 15 + - name: Build (MacOS) if: startsWith(matrix.os, 'macos') run: | @@ -328,11 +333,12 @@ jobs: name: chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg path: build/chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg - - name: Setup tmate session + - if: startsWith(matrix.os, 'macos') + name: Setup tmate session uses: mxschmitt/action-tmate@v3 timeout-minutes: 15 - - if: failure() + - if: failure() && startsWith(matrix.os, 'macos') name: Setup tmate session uses: mxschmitt/action-tmate@v3 timeout-minutes: 15 From acd3aaf717ae09c65ccd0a6a3700f83d92805049 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:02:08 +0200 Subject: [PATCH 04/19] ci: more --- .CI/SetupHomebrewDeps.sh | 98 +++++++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 36 +++++++++++--- 2 files changed, 127 insertions(+), 7 deletions(-) create mode 100755 .CI/SetupHomebrewDeps.sh diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh new file mode 100755 index 00000000000..1ee2a1d4b69 --- /dev/null +++ b/.CI/SetupHomebrewDeps.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +set -e + +# c-v-pasted from .zsh_commands +c2-make-universal-dylib() { + # Prefix for where to find the ARM64 library + local _arm64_homebrew="/opt/homebrew" + + # Prefix for where to find the x86 library + local _x86_64_homebrew="/opt/homebrew-x86_64" + + # Prefix we use to override the library (should be the base systems directory) + local _override_homebrew="${_arm64_homebrew}" + + # Directory where we place the finished universal library + local _universal_lib="/opt/universal-lib" + + local _input_lib="$1" + if [ -z "${_input_lib}" ]; then + echo "usage: $0 [lib-path-relative-to-homebrew] (e.g. $0 lib/libboost_random-mt.dylib)" + return + fi + + if [ ! -d "${_arm64_homebrew}" ]; then + echo "error: The ARM64 homebrew directory (${_arm64_homebrew}) does not exist" + return + fi + if [ ! -d "${_x86_64_homebrew}" ]; then + echo "error: The x86_64 homebrew directory (${_x86_64_homebrew}) does not exist" + return + fi + if [ ! -d "${_universal_lib}" ]; then + echo "error: The universal lib directory (${_universal_lib}) does not exist" + return + fi + + if [ ! -w "${_universal_lib}" ]; then + echo "error: The current user does not have write permission in the universal lib directory (${_universal_lib})" + return + fi + + local _input_lib_filename="$(basename "${_input_lib}")" + + local _arm64_lib="${_arm64_homebrew}/${_input_lib}" + local _x86_64_lib="${_x86_64_homebrew}/${_input_lib}" + local _override_lib="${_override_homebrew}/${_input_lib}" + + local _universal_lib="${_universal_lib}/${_input_lib_filename}" + + if [ -f "${_universal_lib}" ]; then + echo "warning: The final output path (${_universal_lib}) already exists, you might run into errors" + echo "Some of these errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost), or re-installing them (e.g. brew reinstall openssl@1.1)" + echo "" + fi + + if [ ! -f "${_arm64_lib}" ]; then + echo "error: The ARM64 library cannot be found at '${_arm64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" + return + fi + + if [ ! -f "${_x86_64_lib}" ]; then + echo "error: The x86_64 library cannot be found at '${_x86_64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" + return + fi + + # Create the combined library + if ! lipo "${_arm64_lib}" "${_x86_64_lib}" -create -output "${_universal_lib}"; then + echo "error: Something went wrong creating the combined library" + echo "Some errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost)" + return + fi + + echo "Created the combined library at '${_universal_lib}" + + # Override + rm -v "${_override_lib}" + ln -v -s "${_universal_lib}" "${_override_lib}" +} + +echo "Installing x86_64 brew" +mkdir /opt/homebrew-x86_64 +curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew-x86_64 + +echo "Installing ARM dependencies" +brew install "$@" + +echo "Installing x86_64 dependencies" +arch -x86_64 /opt/homebrew-x86_64/bin/brew install "$@" + +# Relink universal libraries +echo "Relink boost libraries" +c2-make-universal-dylib lib/libboost_random-mt.dylib + +echo "Relink OpenSSL 3 libcrypto" +c2-make-universal-dylib lib/libcrypto.dylib +echo "Relink OpenSSL 3 libssl" +c2-make-universal-dylib lib/libssl.dylib diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 210281851fe..1b5bb3c9aa2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -280,14 +280,12 @@ jobs: - name: Install dependencies (MacOS) if: startsWith(matrix.os, 'macos') run: | - brew install boost openssl rapidjson p7zip create-dmg cmake tree + # binary dependencies + ./.CI/SetupHomebrewDeps.sh boost openssl + # build and header-only dependencies + brew install rapidjson p7zip create-dmg cmake tree shell: bash - - if: startsWith(matrix.os, 'macos') - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 15 - - name: Build (MacOS) if: startsWith(matrix.os, 'macos') run: | @@ -296,7 +294,6 @@ jobs: cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ - -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \ -DUSE_PRECOMPILED_HEADERS=OFF \ -DCHATTERINO_LTO="$C2_ENABLE_LTO" \ -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ @@ -323,6 +320,27 @@ jobs: curl -SsfLo kimg.zip "https://github.com/nerixyz/kimageformats-binaries/releases/download/cont/kimageformats-macos-13-${{ matrix.qt-version}}.zip" ./../.CI/MacDeploy.sh + + # Copy dynamic library dependencies into the Frameworks directory + cp /opt/universal-lib/libcrypto.dylib chatterino.app/Contents/Frameworks/libcrypto.3.dylib + cp /opt/universal-lib/libssl.dylib chatterino.app/Contents/Frameworks/libssl.3.dylib + + # Fix the library IDs to match their new location + install_name_tool -id @executable_path/../Frameworks/libssl.3.dylib chatterino.app/Contents/Frameworks/libssl.3.dylib + install_name_tool -id @executable_path/../Frameworks/libcrypto.3.dylib chatterino.app/Contents/Frameworks/libcrypto.3.dylib + + # Fix the search path for libcrypto in libssl + otool -L chatterino.app/Contents/Frameworks/libssl.3.dylib \ + | grep libcrypto.3.dylib \ + | cut -d" " -f1 \ + | cut -f2 \ + | while read input_crypto_dylib; do \ + install_name_tool -change \ + "$input_crypto_dylib" \ + @executable_path/../Frameworks/libcrypto.3.dylib \ + chatterino.app/Contents/Frameworks/libssl.3.dylib; \ + done + ./../.CI/CreateDMG.sh shell: bash @@ -333,6 +351,10 @@ jobs: name: chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg path: build/chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg + - if: startsWith(matrix.os, 'macos') + name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - if: startsWith(matrix.os, 'macos') name: Setup tmate session uses: mxschmitt/action-tmate@v3 From cbdb1190873b945040af2498b8eb07a4cda2a927 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:05:42 +0200 Subject: [PATCH 05/19] sudo --- .CI/SetupHomebrewDeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 1ee2a1d4b69..c0a2668aa66 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -79,7 +79,7 @@ c2-make-universal-dylib() { } echo "Installing x86_64 brew" -mkdir /opt/homebrew-x86_64 +sudo mkdir /opt/homebrew-x86_64 curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew-x86_64 echo "Installing ARM dependencies" From f109025fac7ff3ef03937888c593dba7f217f9f7 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:09:15 +0200 Subject: [PATCH 06/19] sudo2 --- .CI/SetupHomebrewDeps.sh | 2 +- .github/workflows/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index c0a2668aa66..1ee2a1d4b69 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -79,7 +79,7 @@ c2-make-universal-dylib() { } echo "Installing x86_64 brew" -sudo mkdir /opt/homebrew-x86_64 +mkdir /opt/homebrew-x86_64 curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew-x86_64 echo "Installing ARM dependencies" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b5bb3c9aa2..04a3f7922de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -281,7 +281,7 @@ jobs: if: startsWith(matrix.os, 'macos') run: | # binary dependencies - ./.CI/SetupHomebrewDeps.sh boost openssl + sudo ./.CI/SetupHomebrewDeps.sh boost openssl # build and header-only dependencies brew install rapidjson p7zip create-dmg cmake tree shell: bash From 393081d00c6180ee6e202e953506835d4be9492f Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:12:08 +0200 Subject: [PATCH 07/19] sudo3 --- .CI/SetupHomebrewDeps.sh | 2 +- .github/workflows/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 1ee2a1d4b69..a28c978c4e6 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -80,7 +80,7 @@ c2-make-universal-dylib() { echo "Installing x86_64 brew" mkdir /opt/homebrew-x86_64 -curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew-x86_64 +sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 echo "Installing ARM dependencies" brew install "$@" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04a3f7922de..1b5bb3c9aa2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -281,7 +281,7 @@ jobs: if: startsWith(matrix.os, 'macos') run: | # binary dependencies - sudo ./.CI/SetupHomebrewDeps.sh boost openssl + ./.CI/SetupHomebrewDeps.sh boost openssl # build and header-only dependencies brew install rapidjson p7zip create-dmg cmake tree shell: bash From 06e92fc3e06a23ef4576f747ea1bef6ee1dabd7b Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:15:07 +0200 Subject: [PATCH 08/19] sudo4 --- .CI/SetupHomebrewDeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index a28c978c4e6..114d03a2065 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -79,7 +79,7 @@ c2-make-universal-dylib() { } echo "Installing x86_64 brew" -mkdir /opt/homebrew-x86_64 +sudo mkdir /opt/homebrew-x86_64 sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 echo "Installing ARM dependencies" From 3a1bf02aa88b1a85fbf7cdb007a144ab04725934 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:28:57 +0200 Subject: [PATCH 09/19] sudo5 and deps --- .CI/SetupHomebrewDeps.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 114d03a2065..f3844d90b04 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -82,11 +82,20 @@ echo "Installing x86_64 brew" sudo mkdir /opt/homebrew-x86_64 sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 +sudo chown -R $USER /opt/homebrew-x86_64 + echo "Installing ARM dependencies" brew install "$@" +alias brew_x86="arch -x86_64 /opt/homebrew-x86_64/bin/brew" + echo "Installing x86_64 dependencies" -arch -x86_64 /opt/homebrew-x86_64/bin/brew install "$@" +for dep in "$@" +do + brew_x86 fetch --force --bottle-tag=x86_64_monterey "$dep" + brew_x86 install $(brew --cache --bottle-tag=x86_64_monterey "$dep") +done + # Relink universal libraries echo "Relink boost libraries" From e623f7364f0aeb76dfcdec439765d07e44a0c5ce Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:33:31 +0200 Subject: [PATCH 10/19] alias???? --- .CI/SetupHomebrewDeps.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index f3844d90b04..bea4242d8f1 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -87,13 +87,11 @@ sudo chown -R $USER /opt/homebrew-x86_64 echo "Installing ARM dependencies" brew install "$@" -alias brew_x86="arch -x86_64 /opt/homebrew-x86_64/bin/brew" - echo "Installing x86_64 dependencies" for dep in "$@" do - brew_x86 fetch --force --bottle-tag=x86_64_monterey "$dep" - brew_x86 install $(brew --cache --bottle-tag=x86_64_monterey "$dep") + arch -x86_64 /opt/homebrew-x86_64/bin/brew fetch --force --bottle-tag=x86_64_monterey "$dep" + arch -x86_64 /opt/homebrew-x86_64/bin/brew install $(arch -x86_64 /opt/homebrew-x86_64/bin/brew --cache --bottle-tag=x86_64_monterey "$dep") done From 983b638e5f8863c93f72294c698217a4a6d8a2a9 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:41:46 +0200 Subject: [PATCH 11/19] fix: deps again !! --- .CI/SetupHomebrewDeps.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index bea4242d8f1..0422b39fac2 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -78,11 +78,14 @@ c2-make-universal-dylib() { ln -v -s "${_universal_lib}" "${_override_lib}" } -echo "Installing x86_64 brew" sudo mkdir /opt/homebrew-x86_64 -sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 +sudo mkdir /opt/universal-lib sudo chown -R $USER /opt/homebrew-x86_64 +sudo chown -R $USER /opt/universal-lib + +echo "Installing x86_64 brew" +sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 echo "Installing ARM dependencies" brew install "$@" @@ -94,12 +97,10 @@ do arch -x86_64 /opt/homebrew-x86_64/bin/brew install $(arch -x86_64 /opt/homebrew-x86_64/bin/brew --cache --bottle-tag=x86_64_monterey "$dep") done - -# Relink universal libraries -echo "Relink boost libraries" +echo "Relinking boost libraries" c2-make-universal-dylib lib/libboost_random-mt.dylib -echo "Relink OpenSSL 3 libcrypto" +echo "Relinking OpenSSL 3 libcrypto" c2-make-universal-dylib lib/libcrypto.dylib -echo "Relink OpenSSL 3 libssl" +echo "Relinking OpenSSL 3 libssl" c2-make-universal-dylib lib/libssl.dylib From bc34c49967bbaca4d9e032454a0ac602daa95156 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 21:46:53 +0200 Subject: [PATCH 12/19] fix: chown --- .CI/SetupHomebrewDeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 0422b39fac2..be9d28593f9 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -81,11 +81,11 @@ c2-make-universal-dylib() { sudo mkdir /opt/homebrew-x86_64 sudo mkdir /opt/universal-lib -sudo chown -R $USER /opt/homebrew-x86_64 sudo chown -R $USER /opt/universal-lib echo "Installing x86_64 brew" sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 +sudo chown -R $USER /opt/homebrew-x86_64 echo "Installing ARM dependencies" brew install "$@" From 521a3e680e24fdebff5c0e496cc91abb8a4941d6 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 22:03:08 +0200 Subject: [PATCH 13/19] try linking --- .CI/SetupHomebrewDeps.sh | 8 ++++++++ .github/workflows/build.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index be9d28593f9..c762b8fe8ce 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -97,6 +97,14 @@ do arch -x86_64 /opt/homebrew-x86_64/bin/brew install $(arch -x86_64 /opt/homebrew-x86_64/bin/brew --cache --bottle-tag=x86_64_monterey "$dep") done +echo "Unlink & link libraries" +brew unlink "$@" || true +brew link --overwrite "$@" + +echo "Unlink & link x86_64" +arch -x86_64 /opt/homebrew-x86_64/bin/brew unlink "$@" || true +arch -x86_64 /opt/homebrew-x86_64/bin/brew link --overwrite "$@" + echo "Relinking boost libraries" c2-make-universal-dylib lib/libboost_random-mt.dylib diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b5bb3c9aa2..fafdc6031d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -281,7 +281,7 @@ jobs: if: startsWith(matrix.os, 'macos') run: | # binary dependencies - ./.CI/SetupHomebrewDeps.sh boost openssl + ./.CI/SetupHomebrewDeps.sh boost openssl@3 # build and header-only dependencies brew install rapidjson p7zip create-dmg cmake tree shell: bash From d3e5132616c8129cc33862344cb15cc3e63218f2 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 22:29:27 +0200 Subject: [PATCH 14/19] fix: try links and stuff --- .CI/SetupHomebrewDeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index c762b8fe8ce..9d3ae39ec81 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -44,7 +44,7 @@ c2-make-universal-dylib() { local _arm64_lib="${_arm64_homebrew}/${_input_lib}" local _x86_64_lib="${_x86_64_homebrew}/${_input_lib}" - local _override_lib="${_override_homebrew}/${_input_lib}" + local _override_lib=$(readlink "${_override_homebrew}/${_input_lib}") local _universal_lib="${_universal_lib}/${_input_lib_filename}" From a1a27ceae5dd47df64daadeb8949fac3a366e030 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 22:37:26 +0200 Subject: [PATCH 15/19] fix: realpath lol --- .CI/SetupHomebrewDeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 9d3ae39ec81..98786ab6007 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -44,7 +44,7 @@ c2-make-universal-dylib() { local _arm64_lib="${_arm64_homebrew}/${_input_lib}" local _x86_64_lib="${_x86_64_homebrew}/${_input_lib}" - local _override_lib=$(readlink "${_override_homebrew}/${_input_lib}") + local _override_lib=$(realpath "${_override_homebrew}/${_input_lib}") local _universal_lib="${_universal_lib}/${_input_lib_filename}" From 5292f54523a55ad87da878f2a15b8af7d1c2c250 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 27 Sep 2024 22:53:18 +0200 Subject: [PATCH 16/19] last build for the day --- .github/workflows/build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fafdc6031d9..fd1b4e33142 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,7 +124,7 @@ jobs: skip-crashpad: false # macOS (ARM) - os: macos-latest - qt-version: 6.7.3 + qt-version: 6.7.1 force-lto: false plugins: true skip-artifact: false @@ -355,15 +355,10 @@ jobs: name: Setup tmate session uses: mxschmitt/action-tmate@v3 - - if: startsWith(matrix.os, 'macos') - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 15 - - - if: failure() && startsWith(matrix.os, 'macos') - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 15 + # - if: failure() && startsWith(matrix.os, 'macos') + # name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + # timeout-minutes: 15 create-release: needs: [build-ubuntu-docker, build] From 885994eb05b3faaa63e341cf8edcb99f2912086f Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 28 Sep 2024 18:56:35 +0200 Subject: [PATCH 17/19] tryy --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd1b4e33142..1d594b31ca4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -355,11 +355,6 @@ jobs: name: Setup tmate session uses: mxschmitt/action-tmate@v3 - # - if: failure() && startsWith(matrix.os, 'macos') - # name: Setup tmate session - # uses: mxschmitt/action-tmate@v3 - # timeout-minutes: 15 - create-release: needs: [build-ubuntu-docker, build] runs-on: ubuntu-latest From 96adea0927a8351f9f16e46e9c8e51f0b021c0d6 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 28 Sep 2024 20:18:18 +0200 Subject: [PATCH 18/19] last --- .CI/SetupHomebrewDeps.sh | 88 ++++++++------------------ .github/workflows/build.yml | 6 +- .github/workflows/create-installer.yml | 2 +- CHANGELOG.c7.md | 1 + 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 98786ab6007..0119eaa7c67 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -2,73 +2,49 @@ set -e -# c-v-pasted from .zsh_commands +# Prefix for where to find the ARM64 library +arm64_homebrew_dir="/opt/homebrew" +# Prefix for where to find the x86 library +x86_64_homebrew_dir="/opt/homebrew-x86_64" + # Directory where we place the finished universal library +universal_lib_dir="/opt/universal-lib" + +# args: path-to-library (in homebrew dir) c2-make-universal-dylib() { - # Prefix for where to find the ARM64 library - local _arm64_homebrew="/opt/homebrew" - - # Prefix for where to find the x86 library - local _x86_64_homebrew="/opt/homebrew-x86_64" - - # Prefix we use to override the library (should be the base systems directory) - local _override_homebrew="${_arm64_homebrew}" - - # Directory where we place the finished universal library - local _universal_lib="/opt/universal-lib" - local _input_lib="$1" if [ -z "${_input_lib}" ]; then echo "usage: $0 [lib-path-relative-to-homebrew] (e.g. $0 lib/libboost_random-mt.dylib)" - return - fi - - if [ ! -d "${_arm64_homebrew}" ]; then - echo "error: The ARM64 homebrew directory (${_arm64_homebrew}) does not exist" - return - fi - if [ ! -d "${_x86_64_homebrew}" ]; then - echo "error: The x86_64 homebrew directory (${_x86_64_homebrew}) does not exist" - return - fi - if [ ! -d "${_universal_lib}" ]; then - echo "error: The universal lib directory (${_universal_lib}) does not exist" - return + exit 1 fi - if [ ! -w "${_universal_lib}" ]; then - echo "error: The current user does not have write permission in the universal lib directory (${_universal_lib})" - return + if [ ! -w "${universal_lib_dir}" ]; then + echo "error: The current user does not have write permission in the universal lib directory (${universal_lib_dir})" + exit 1 fi local _input_lib_filename="$(basename "${_input_lib}")" - local _arm64_lib="${_arm64_homebrew}/${_input_lib}" - local _x86_64_lib="${_x86_64_homebrew}/${_input_lib}" - local _override_lib=$(realpath "${_override_homebrew}/${_input_lib}") - - local _universal_lib="${_universal_lib}/${_input_lib_filename}" + local _arm64_lib="${arm64_homebrew_dir}/${_input_lib}" + local _x86_64_lib="${x86_64_homebrew_dir}/${_input_lib}" + local _override_lib=$(realpath "${arm64_homebrew_dir}/${_input_lib}") - if [ -f "${_universal_lib}" ]; then - echo "warning: The final output path (${_universal_lib}) already exists, you might run into errors" - echo "Some of these errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost), or re-installing them (e.g. brew reinstall openssl@1.1)" - echo "" - fi + local _universal_lib="${universal_lib_dir}/${_input_lib_filename}" if [ ! -f "${_arm64_lib}" ]; then - echo "error: The ARM64 library cannot be found at '${_arm64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" - return + echo "error: The ARM64 library '${_input_lib}' cannot be found at '${_arm64_lib}'" + exit 1 fi if [ ! -f "${_x86_64_lib}" ]; then - echo "error: The x86_64 library cannot be found at '${_x86_64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" - return + echo "error: The x86_64 library '${_input_lib}' cannot be found at '${_x86_64_lib}'" + exit 1 fi # Create the combined library if ! lipo "${_arm64_lib}" "${_x86_64_lib}" -create -output "${_universal_lib}"; then echo "error: Something went wrong creating the combined library" echo "Some errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost)" - return + exit 1 fi echo "Created the combined library at '${_universal_lib}" @@ -78,14 +54,14 @@ c2-make-universal-dylib() { ln -v -s "${_universal_lib}" "${_override_lib}" } -sudo mkdir /opt/homebrew-x86_64 -sudo mkdir /opt/universal-lib +sudo mkdir "$x86_64_homebrew_dir" +sudo mkdir "$universal_lib_dir" -sudo chown -R $USER /opt/universal-lib +sudo chown -R $USER "$universal_lib_dir" echo "Installing x86_64 brew" -sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 -sudo chown -R $USER /opt/homebrew-x86_64 +sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C "$x86_64_homebrew_dir" +sudo chown -R $USER "$x86_64_homebrew_dir" echo "Installing ARM dependencies" brew install "$@" @@ -93,18 +69,10 @@ brew install "$@" echo "Installing x86_64 dependencies" for dep in "$@" do - arch -x86_64 /opt/homebrew-x86_64/bin/brew fetch --force --bottle-tag=x86_64_monterey "$dep" - arch -x86_64 /opt/homebrew-x86_64/bin/brew install $(arch -x86_64 /opt/homebrew-x86_64/bin/brew --cache --bottle-tag=x86_64_monterey "$dep") + arch -x86_64 "$x86_64_homebrew_dir/bin/brew" fetch --force --bottle-tag=x86_64_monterey "$dep" + arch -x86_64 "$x86_64_homebrew_dir/bin/brew" install $(arch -x86_64 "$x86_64_homebrew_dir/bin/brew" --cache --bottle-tag=x86_64_monterey "$dep") done -echo "Unlink & link libraries" -brew unlink "$@" || true -brew link --overwrite "$@" - -echo "Unlink & link x86_64" -arch -x86_64 /opt/homebrew-x86_64/bin/brew unlink "$@" || true -arch -x86_64 /opt/homebrew-x86_64/bin/brew link --overwrite "$@" - echo "Relinking boost libraries" c2-make-universal-dylib lib/libboost_random-mt.dylib diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d594b31ca4..ca6abf475d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -399,16 +399,16 @@ jobs: # macOS - uses: actions/download-artifact@v4 - name: macOS Qt6.7.3 dmg + name: macOS Qt6.7.1 dmg with: - name: chatterino-macos-Qt-6.7.3-universal.dmg + name: chatterino-macos-Qt-6.7.1-universal.dmg path: release-artifacts/ - name: Rename artifacts run: | ls -l # Rename the macos build to indicate that it's for macOS 12.0 users - mv chatterino-macos-Qt-6.7.3-x86_64.dmg Chatterino-macOS-12.0-universal.dmg + mv chatterino-macos-Qt-6.7.1-universal.dmg Chatterino-macOS-12.0-universal.dmg working-directory: release-artifacts shell: bash diff --git a/.github/workflows/create-installer.yml b/.github/workflows/create-installer.yml index a746d3c8e31..12df9f50259 100644 --- a/.github/workflows/create-installer.yml +++ b/.github/workflows/create-installer.yml @@ -150,7 +150,7 @@ jobs: mv chatterino-windows-x86-64-Qt-6.7.3-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z - mv chatterino-macos-Qt-6.7.3-universal.dmg Chatterino.dmg + mv chatterino-macos-Qt-6.7.1-universal.dmg Chatterino.dmg - name: Hash files working-directory: build diff --git a/CHANGELOG.c7.md b/CHANGELOG.c7.md index d64964a74f4..f9287c48714 100644 --- a/CHANGELOG.c7.md +++ b/CHANGELOG.c7.md @@ -6,3 +6,4 @@ - Dev(macOS): Changed CFBundleIdentifier from `com.chatterino` to `app.7tv.chatterino7` (fec0dbdf558b1e6e358971a256f5540d34bb6a8d) - Dev: Updated Conan version used in CI to 2.4 (330d05d50ffd296b34744dbcc97290534e8cf704) - Dev(Windows): Updated `libavif` to 1.0.4, `boost` to 1.85, and `openssl` to 3.2.2 (330d05d50ffd296b34744dbcc97290534e8cf704) +- Dev(macOS): A single universal app is now released for macOS (#274) From 23cc4dcda3046e7853cfcff5f281e77272283d43 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 28 Sep 2024 20:53:05 +0200 Subject: [PATCH 19/19] -ssh --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca6abf475d3..aecc10f45c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -351,10 +351,6 @@ jobs: name: chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg path: build/chatterino-macos-Qt-${{ matrix.qt-version }}-universal.dmg - - if: startsWith(matrix.os, 'macos') - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - create-release: needs: [build-ubuntu-docker, build] runs-on: ubuntu-latest