ci: use LLVM Clang on macOS

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2025-02-13 15:20:21 -05:00
parent b83d06e67f
commit bd3877103a

View File

@ -18,6 +18,17 @@ parameters:
type: boolean type: boolean
default: false default: false
job-macos-executor: &job-macos-executor
macos:
xcode: 16.2.0
resource_class: macos.m1.medium.gen1
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
job-macos-install-deps: &job-macos-install-deps
name: Install common macOS dependencies
command: brew install ccache llvm wget
jobs: jobs:
# work around CircleCI-Public/path-filtering-orb#20 # work around CircleCI-Public/path-filtering-orb#20
noop: noop:
@ -34,8 +45,7 @@ jobs:
name: Verify that commit is on the main branch name: Verify that commit is on the main branch
command: git merge-base --is-ancestor HEAD main command: git merge-base --is-ancestor HEAD main
build-offline-chat-installer-macos: build-offline-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- run: - run:
@ -46,12 +56,11 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- ccache-gpt4all-macos- - ccache-gpt4all-macos-
- run:
<<: *job-macos-install-deps
- run: - run:
name: Install Rosetta name: Install Rosetta
command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW
- run:
name: Install dependencies
command: brew install ccache wget
- run: - run:
name: Installing Qt name: Installing Qt
command: | command: |
@ -86,6 +95,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \ -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \
-DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \ -DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_UNIVERSAL=ON \ -DBUILD_UNIVERSAL=ON \
@ -128,8 +139,7 @@ jobs:
- upload - upload
sign-offline-chat-installer-macos: sign-offline-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
# attach to a workspace containing unsigned dmg # attach to a workspace containing unsigned dmg
@ -163,8 +173,7 @@ jobs:
- upload - upload
notarize-offline-chat-installer-macos: notarize-offline-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -203,8 +212,7 @@ jobs:
hdiutil detach /Volumes/gpt4all-installer-darwin hdiutil detach /Volumes/gpt4all-installer-darwin
build-online-chat-installer-macos: build-online-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- run: - run:
@ -215,12 +223,11 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- ccache-gpt4all-macos- - ccache-gpt4all-macos-
- run:
<<: *job-macos-install-deps
- run: - run:
name: Install Rosetta name: Install Rosetta
command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW
- run:
name: Install dependencies
command: brew install ccache wget
- run: - run:
name: Installing Qt name: Installing Qt
command: | command: |
@ -255,6 +262,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \ -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \
-DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \ -DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_UNIVERSAL=ON \ -DBUILD_UNIVERSAL=ON \
@ -290,8 +299,7 @@ jobs:
- upload - upload
sign-online-chat-installer-macos: sign-online-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
# attach to a workspace containing unsigned dmg # attach to a workspace containing unsigned dmg
@ -325,8 +333,7 @@ jobs:
- upload - upload
notarize-online-chat-installer-macos: notarize-online-chat-installer-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -1227,8 +1234,7 @@ jobs:
- ..\.ccache - ..\.ccache
build-gpt4all-chat-macos: build-gpt4all-chat-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- run: - run:
@ -1239,12 +1245,11 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- ccache-gpt4all-macos- - ccache-gpt4all-macos-
- run:
<<: *job-macos-install-deps
- run: - run:
name: Install Rosetta name: Install Rosetta
command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW command: softwareupdate --install-rosetta --agree-to-license # needed for QtIFW
- run:
name: Install dependencies
command: brew install ccache wget
- run: - run:
name: Installing Qt name: Installing Qt
command: | command: |
@ -1267,6 +1272,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \ -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.8.2/macos/lib/cmake \
-DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \ -DCMAKE_MAKE_PROGRAM:FILEPATH=~/Qt/Tools/Ninja/ninja \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_UNIVERSAL=ON \ -DBUILD_UNIVERSAL=ON \
@ -1387,18 +1394,17 @@ jobs:
- "*.whl" - "*.whl"
build-py-macos: build-py-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
resource_class: macos.m1.large.gen1
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- ccache-gpt4all-macos- - ccache-gpt4all-macos-
- run:
<<: *job-macos-install-deps
- run: - run:
name: Install dependencies name: Install dependencies
command: | command: |
brew install ccache cmake
pip install setuptools wheel cmake pip install setuptools wheel cmake
- run: - run:
name: Build C library name: Build C library
@ -1409,6 +1415,8 @@ jobs:
cd gpt4all-backend cd gpt4all-backend
cmake -B build \ cmake -B build \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_UNIVERSAL=ON \ -DBUILD_UNIVERSAL=ON \
@ -1582,8 +1590,7 @@ jobs:
- runtimes/linux-x64/*.so - runtimes/linux-x64/*.so
build-bindings-backend-macos: build-bindings-backend-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- run: - run:
@ -1595,9 +1602,7 @@ jobs:
keys: keys:
- ccache-gpt4all-macos- - ccache-gpt4all-macos-
- run: - run:
name: Install dependencies <<: *job-macos-install-deps
command: |
brew install ccache cmake
- run: - run:
name: Build Libraries name: Build Libraries
no_output_timeout: 30m no_output_timeout: 30m
@ -1608,6 +1613,8 @@ jobs:
cd runtimes/build cd runtimes/build
cmake ../.. \ cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_UNIVERSAL=ON \ -DBUILD_UNIVERSAL=ON \
@ -1725,8 +1732,7 @@ jobs:
- runtimes/linux-x64/*-*.so - runtimes/linux-x64/*-*.so
build-nodejs-macos: build-nodejs-macos:
macos: <<: *job-macos-executor
xcode: 15.4.0
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace: