Skip to content

Commit 5743cbf

Browse files
committed
Meta: Bump CI LLVM version to 20
1 parent ec3f4d3 commit 5743cbf

8 files changed

Lines changed: 39 additions & 17 deletions

File tree

.github/actions/clang-windows/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ inputs:
66
llvm_version:
77
description: 'Version of LLVM to build and cache'
88
required: false
9-
default: 16.0.6
9+
default: 20.1.8
1010
llvm_branch:
1111
description: 'Specific LLVM branch to build'
1212
required: false
13-
default: "llvmorg-16.0.6"
13+
default: "llvmorg-20.1.8"
1414

1515
runs:
1616
using: composite
@@ -36,7 +36,7 @@ runs:
3636
shell: cmd
3737
run: |
3838
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 &^
39-
cmake -GNinja -S llvm-project-${{ inputs.llvm_version }}\llvm -B llvm-build -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="/machine:x64" -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%/llvm-install-${{ inputs.llvm_version }}/"
39+
cmake -GNinja -S llvm-project-${{ inputs.llvm_version }}\llvm -B llvm-build -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=compiler-rt -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="/machine:x64" -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%/llvm-install-${{ inputs.llvm_version }}/"
4040
4141
- name: Build
4242
shell: cmd

.github/workflows/ci.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
fail-fast: true
2828
matrix:
2929
platform: [ubuntu-22.04]
30-
cxx_compiler: [clang++-18]
30+
cxx_compiler: [clang++-20]
3131
include:
3232
- platform: macos-latest
33-
cxx_compiler: "$(brew --prefix llvm@18)/bin/clang++"
33+
cxx_compiler: "$(brew --prefix llvm@20)/bin/clang++"
3434

3535
runs-on: ${{ matrix.platform }}
3636

@@ -49,17 +49,17 @@ jobs:
4949
. /etc/lsb-release
5050
wget -O /usr/share/keyrings/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key
5151
sudo echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME} main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
52-
sudo echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
52+
sudo echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-20 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
5353
sudo apt-get update
54-
sudo apt-get install -y clang-18 libclang-18-dev
54+
sudo apt-get install -y clang-20 libclang-20-dev
5555
5656
- name: Install macOS dependencies
5757
if: ${{ matrix.platform == 'macos-latest' }}
58-
run: brew install coreutils llvm@18
58+
run: brew install coreutils llvm@20
5959

6060
- name: Build Jakt Stage 1
6161
run: |
62-
export "CMAKE_PREFIX_PATH=$(brew --prefix llvm@18)"
62+
export "CMAKE_PREFIX_PATH=$(brew --prefix llvm@20)"
6363
cmake -GNinja -B build -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_BUILD_TYPE=Release -DFINAL_STAGE=1 -DCMAKE_INSTALL_PREFIX=jakt-install
6464
cmake --build build
6565
@@ -107,7 +107,7 @@ jobs:
107107
108108
selfhost-windows:
109109
env:
110-
LLVM_VER: 18.1.6
110+
LLVM_VER: 20.1.8
111111

112112
strategy:
113113
fail-fast: true
@@ -125,6 +125,20 @@ jobs:
125125
version: 1.10.0
126126
dest: ${{ github.workspace }}/ninja_bin
127127

128+
- name: Cache Clang
129+
uses: actions/cache@v3
130+
id: cache-clang
131+
with:
132+
path: 'llvm-install-${{ env.LLVM_VER }}/'
133+
key: 'libclang-${{ runner.os }}-${{ env.LLVM_VER }}'
134+
135+
- name: Build clang if cache miss
136+
uses: ./.github/actions/clang-windows
137+
if: steps.cache-clang.outputs.cache-hit != 'true'
138+
with:
139+
llvm_version: "${{ env.LLVM_VER }}"
140+
llvm_branch: "llvmorg-${{ env.LLVM_VER }}"
141+
128142
- name: Configure CMake
129143
env:
130144
CMAKE_PREFIX_PATH: ${{ github.workspace }}/llvm-install-${{ env.LLVM_VER }}

.github/workflows/populate-windows-clang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44

55
env:
6-
LLVM_VER: 16.0.6
6+
LLVM_VER: 20.1.8
77

88
jobs:
99
build:

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ if (JAKT_BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING)
321321
INCLUDES
322322
"${CMAKE_CURRENT_SOURCE_DIR}/jakttest"
323323
RUNTIME_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/runtime"
324+
STDLIB_SOURCES
325+
jakt__platform.cpp
324326
)
325327
add_jakt_compiler_flags(jakttest)
326328
target_sources(jakttest PRIVATE

bootstrap/stage0/runtime/lib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ inline ErrorOr<ByteString> target_triple_string()
449449
return ByteString("x86_64-unknown-bsd-unknown"sv);
450450
# elif defined(__APPLE__)
451451
# if defined(__arm64__)
452-
return ByteString("arm64-unknown-darwin-unknown"sv);
452+
return ByteString("arm64-apple-darwin-unknown"sv);
453453
# else
454-
return ByteString("x86_64-unknown-darwin-unknown"sv);
454+
return ByteString("x86_64-apple-darwin-unknown"sv);
455455
# endif
456456
# elif defined(__serenity__)
457457
# if defined(__i686__)

cmake/jakt-executable.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
#
55

66
# FIXME: Should this live in a toolchain file?
7-
set(JAKT_TARGET_TRIPLE_IN "${CMAKE_SYSTEM_PROCESSOR}-unknown-${CMAKE_SYSTEM_NAME}-unknown")
7+
if(APPLE)
8+
set(triple_vendor "apple")
9+
else()
10+
set(triple_vendor "unknown")
11+
endif()
12+
set(JAKT_TARGET_TRIPLE_IN "${CMAKE_SYSTEM_PROCESSOR}-${triple_vendor}-${CMAKE_SYSTEM_NAME}-unknown")
813
string(TOLOWER ${JAKT_TARGET_TRIPLE_IN} JAKT_DEFAULT_TARGET_TRIPLE)
914
set(JAKT_TARGET_TRIPLE "${JAKT_DEFAULT_TARGET_TRIPLE}" CACHE STRING "Target triple for jakt compiler")
1015

jakttest/jakttest.jakt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import error { JaktError, print_error }
99
import parser { Parser }
1010
import utility { join, panic }
1111
import jakt::compiler { target_triple_string }
12+
import jakt::platform { Target }
1213

1314
// needed for sigaction() stuff
1415
// FIXME: See #1015, needs to be OS-specific
@@ -648,7 +649,7 @@ struct TestScheduler {
648649
"--jakt-lib-dir"
649650
format("{}/lib", build_dir)
650651
"--target-triple"
651-
target_triple_string()
652+
Target::from_triple(target_triple_string()).name(abbreviate: true)
652653
"--cpp-compiler"
653654
cpp_compiler_path ?? default_compiler_path
654655
"--cpp-export"

runtime/lib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ inline ErrorOr<ByteString> target_triple_string()
449449
return ByteString("x86_64-unknown-bsd-unknown"sv);
450450
# elif defined(__APPLE__)
451451
# if defined(__arm64__)
452-
return ByteString("arm64-unknown-darwin-unknown"sv);
452+
return ByteString("arm64-apple-darwin-unknown"sv);
453453
# else
454-
return ByteString("x86_64-unknown-darwin-unknown"sv);
454+
return ByteString("x86_64-apple-darwin-unknown"sv);
455455
# endif
456456
# elif defined(__serenity__)
457457
# if defined(__i686__)

0 commit comments

Comments
 (0)