Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use clang 18 from Homebrew on aarch64 #6153

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ libnimbus_lc.a: | build deps
echo -e $(BUILD_END_MSG) "build/$@"

# `-Wno-maybe-uninitialized` in Linux: https://github.com/nim-lang/Nim/issues/22246
# `-Wno-unsafe-buffer-usage` Support llvm@18 on macOS: https://github.com/status-im/nimbus-eth2/pull/6153
# `-Wl,--stack,0x0000000000800000` in Windows: MinGW default of 2 MB leads to `SIGSEGV` in `___chkstk_ms` in Nim 2.0
test_libnimbus_lc: libnimbus_lc.a
+ echo -e $(BUILD_MSG) "build/$@" && \
Expand All @@ -723,19 +724,45 @@ test_libnimbus_lc: libnimbus_lc.a
if (( $${WITH_UBSAN:-0} )); then \
EXTRA_FLAGS+=('-fsanitize=undefined'); \
fi; \
clang -D__DIR__="\"beacon_chain/libnimbus_lc\"" --std=c17 -Weverything -Werror -Wno-declaration-after-statement -Wno-nullability-extension -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o build/test_libnimbus_lc beacon_chain/libnimbus_lc/test_libnimbus_lc.c build/libnimbus_lc.a -framework Security "$${EXTRA_FLAGS[@]}"; \
clang -D__DIR__="\"beacon_chain/libnimbus_lc\"" \
--std=c17 \
-Weverything -Werror \
-Wno-declaration-after-statement -Wno-nullability-extension \
-Wno-unsafe-buffer-usage -Wno-unknown-warning-option \
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
-o build/test_libnimbus_lc \
beacon_chain/libnimbus_lc/test_libnimbus_lc.c build/libnimbus_lc.a \
-framework Security "$${EXTRA_FLAGS[@]}"; \
;; \
MINGW64_*) \
if (( $${WITH_UBSAN:-0} )); then \
EXTRA_FLAGS+=('-fsanitize=undefined'); \
fi; \
gcc -D__DIR__="\"beacon_chain/libnimbus_lc\"" --std=c17 -Wall -Wextra -pedantic -Werror -pedantic-errors -flto -Wno-nullability-extension -Wl,--stack,0x0000000000800000 -o build/test_libnimbus_lc -D_CRT_SECURE_NO_WARNINGS beacon_chain/libnimbus_lc/test_libnimbus_lc.c build/libnimbus_lc.a "$${EXTRA_FLAGS[@]}"; \
gcc -D__DIR__="\"beacon_chain/libnimbus_lc\"" \
--std=c17 -flto \
-pedantic -pedantic-errors \
-Wall -Wextra -Werror -Wno-nullability-extension \
-Wno-unsafe-buffer-usage -Wno-unknown-warning-option \
-Wl,--stack,0x0000000000800000 \
-o build/test_libnimbus_lc \
-D_CRT_SECURE_NO_WARNINGS \
beacon_chain/libnimbus_lc/test_libnimbus_lc.c \
build/libnimbus_lc.a \
"$${EXTRA_FLAGS[@]}"; \
;; \
*) \
if (( $${WITH_UBSAN:-0} )); then \
EXTRA_FLAGS+=('-fsanitize=undefined'); \
fi; \
gcc -D__DIR__="\"beacon_chain/libnimbus_lc\"" --std=c17 -Wall -Wextra -pedantic -Werror -pedantic-errors -Wno-maybe-uninitialized -flto -o build/test_libnimbus_lc beacon_chain/libnimbus_lc/test_libnimbus_lc.c build/libnimbus_lc.a "$${EXTRA_FLAGS[@]}"; \
gcc -D__DIR__="\"beacon_chain/libnimbus_lc\"" \
--std=c17 -flto \
-pedantic -pedantic-errors \
-Wall -Wextra -Werror -Wno-maybe-uninitialized \
-Wno-unsafe-buffer-usage -Wno-unknown-warning-option \
-o build/test_libnimbus_lc \
beacon_chain/libnimbus_lc/test_libnimbus_lc.c \
build/libnimbus_lc.a \
"$${EXTRA_FLAGS[@]}"; \
;; \
esac && \
echo -e $(BUILD_END_MSG) "build/$@"
Expand Down
18 changes: 18 additions & 0 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env groovy
/* beacon_chain
* Copyright (c) 2019-2024 Status Research & Development GmbH
* Licensed and distributed under either of
* * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
* * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
* at your option. This file may not be copied, modified, or distributed except according to those terms.
*/
library 'status-jenkins-lib@v1.8.14'

pipeline {
/* This way we run the same Jenkinsfile on different platforms. */
Expand Down Expand Up @@ -59,6 +61,22 @@ pipeline {
}

stages {
stage('Setup') {
when { expression { NODE_LABELS.contains("macos") } }
steps { script {
def brew_prefix = brew.prefix()
/* Explicit PATH to avoid using HomeBrew LLVM. */
env.PATH = "/usr/local/bin:/usr/sbin:/usr/bin:/bin:${brew_prefix}/bin"
/* Newer Clang 18.0 from Homebrew on macOS, XCode provides 15.0.
* Temp fix for BLST issue: https://github.com/supranational/blst/issues/209 */
if (utils.arch() == 'arm64') {
env.PATH = "${brew_prefix}/opt/llvm/bin:$PATH"
env.LDFLAGS = "-L${brew_prefix}/opt/llvm/lib"
env.CPPFLAGS = "-I${brew_prefix}/opt/llvm/include"
}
} }
}

stage('Deps') {
steps { timeout(20) {
/* To allow the following parallel stages. */
Expand Down
Loading