Skip to content

Commit

Permalink
Clang 16 is now the installed version, install clang only if we need …
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 29, 2024
1 parent 227a702 commit 62191c0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
cc: "clang-16",
cxx: "clang++-16",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -46,7 +46,7 @@ jobs:
cc: "clang-16",
cxx: "clang++-16",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -56,7 +56,7 @@ jobs:
cc: "clang-17",
cxx: "clang++-17",
clang_version: 17,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -66,7 +66,7 @@ jobs:
cc: "clang-18",
cxx: "clang++-18",
clang_version: 18,
installed_clang_version: 14
installed_clang_version: 16
}
- {
name: "Ubuntu Clang-18 Sanitizer",
Expand All @@ -75,7 +75,7 @@ jobs:
cc: "clang-18",
cxx: "clang++-18",
clang_version: 18,
installed_clang_version: 14
installed_clang_version: 16
}


Expand All @@ -86,7 +86,7 @@ jobs:
cc: "clang-19",
cxx: "clang++-19",
clang_version: 19,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -96,7 +96,7 @@ jobs:
cc: "gcc-13",
cxx: "g++-13",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

# Clang doesn't have good enough C++20 support to compile this library
Expand All @@ -116,7 +116,7 @@ jobs:
submodules: 'true'

- name: Install LLVM+Clang
if: startsWith(matrix.config.os, 'ubuntu-')
if: startsWith(matrix.config.os, 'ubuntu-') && matrix.config.clang_version != matrix.config.installed_clang_version
run: |
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \
lldb-${{matrix.config.installed_clang_version}} \
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/clang-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
# Is disabled.
if: false && (github.repository == 'chromium/subspace')
runs-on: ubuntu-latest
env:
clang_version: 16
installed_clang_version: 16

steps:
- uses: actions/checkout@v4
Expand All @@ -21,16 +24,17 @@ jobs:
ssh-private-key: ${{ secrets.DOCS_SSH_PRIVATE_KEY }}

- name: Install LLVM+Clang
if: env.clang_version != env.installed_clang_version
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16 all
sudo ./llvm.sh ${clang_version} all
- name: Configure
run: |
# Path to LLVM+Clang nightly that we have installed.
export LLVM_DIR="/usr/lib/llvm-16/lib/cmake/llvm"
export Clang_DIR="/usr/lib/llvm-16/lib/cmake/clang"
export LLVM_DIR="/usr/lib/llvm-${clang_version}/lib/cmake/llvm"
export Clang_DIR="/usr/lib/llvm-${clang_version}/lib/cmake/clang"
sudo apt install build-essential cmake ninja-build
cmake -G Ninja -B out -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DSUBSPACE_BUILD_SUBDOC=OFF
Expand All @@ -44,14 +48,14 @@ jobs:
# Work around https://github.com/llvm/llvm-project/issues/59815 as the
# default stylesheet and index.js are not included in the debian
# package, which leads to an error when running the tool.
sudo mkdir -p /usr/lib/llvm-16/share/clang/
sudo cp tools/clang-doc/clang-doc-default-stylesheet.css /usr/lib/llvm-16/share/clang/
sudo cp tools/clang-doc/index.js /usr/lib/llvm-16/share/clang/
sudo mkdir -p /usr/lib/llvm-${clang_version}/share/clang/
sudo cp tools/clang-doc/clang-doc-default-stylesheet.css /usr/lib/llvm-${clang_version}/share/clang/
sudo cp tools/clang-doc/index.js /usr/lib/llvm-${clang_version}/share/clang/
# For crash dumps.
export LLVM_SYMBOLIZER_PATH="/usr/lib/llvm-16/bin/llvm-symbolizer"
export LLVM_SYMBOLIZER_PATH="/usr/lib/llvm-${clang_version}/bin/llvm-symbolizer"
clang-doc-16 \
clang-doc-${clang_version} \
--executor=all-TUs \
--format=html \
--public \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/hdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
runs-on: ubuntu-latest
env:
clang_version: 16
installed_clang_version: 14
installed_clang_version: 16

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install LLVM+Clang
if: env.clang_version != env.installed_clang_version
run: |
sudo apt-get remove clang-${installed_clang_version} \
lldb-${installed_clang_version} \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/subdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
env:
clang_version: 18
installed_clang_version: 14
installed_clang_version: 16
source_url: "https://github.com/chromium/subspace/blob/main"

steps:
Expand All @@ -29,6 +29,7 @@ jobs:
ssh-private-key: ${{ secrets.DOCS_SSH_PRIVATE_KEY }}

- name: Install LLVM+Clang
if: env.clang_version != env.installed_clang_version
run: |
sudo apt-get remove clang-${installed_clang_version} \
lldb-${installed_clang_version} \
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/try.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
cc: "clang-16",
cxx: "clang++-16",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -48,7 +48,7 @@ jobs:
cc: "clang-16",
cxx: "clang++-16",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -58,7 +58,7 @@ jobs:
cc: "clang-17",
cxx: "clang++-17",
clang_version: 17,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -68,7 +68,7 @@ jobs:
cc: "clang-18",
cxx: "clang++-18",
clang_version: 18,
installed_clang_version: 14
installed_clang_version: 16
}
- {
name: "Ubuntu Clang-18 Sanitizer",
Expand All @@ -77,7 +77,7 @@ jobs:
cc: "clang-18",
cxx: "clang++-18",
clang_version: 18,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -87,7 +87,7 @@ jobs:
cc: "clang-19",
cxx: "clang++-19",
clang_version: 19,
installed_clang_version: 14
installed_clang_version: 16
}

- {
Expand All @@ -97,7 +97,7 @@ jobs:
cc: "gcc-13",
cxx: "g++-13",
clang_version: 16,
installed_clang_version: 14
installed_clang_version: 16
}

# Clang doesn't have good enough C++20 support to compile this library
Expand All @@ -117,7 +117,7 @@ jobs:
submodules: 'true'

- name: Install LLVM+Clang
if: startsWith(matrix.config.os, 'ubuntu-')
if: startsWith(matrix.config.os, 'ubuntu-') && matrix.config.clang_version != matrix.config.installed_clang_version
run: |
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \
lldb-${{matrix.config.installed_clang_version}} \
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
runs-on: ubuntu-latest
env:
clang_version: 18
installed_clang_version: 14
installed_clang_version: 16
source_url: "https://github.com/chromium/subspace/blob/main"

steps:
Expand All @@ -286,6 +286,7 @@ jobs:
submodules: 'true'

- name: Install LLVM+Clang
if: env.clang_version != env.installed_clang_version
run: |
sudo apt-get remove clang-${installed_clang_version} \
lldb-${installed_clang_version} \
Expand Down Expand Up @@ -437,14 +438,15 @@ jobs:
runs-on: ubuntu-latest
env:
clang_version: 17
installed_clang_version: 14
installed_clang_version: 16

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install LLVM+Clang
if: env.clang_version != env.installed_clang_version
run: |
sudo apt-get remove clang-${installed_clang_version} \
lldb-${installed_clang_version} \
Expand Down

0 comments on commit 62191c0

Please sign in to comment.