Skip to content

Commit aa43d49

Browse files
committed
Merge pull request #3 from whisperity/fix/alternatives
Fix install of `clang-tidy` conflicting with the alternatives system.
2 parents a052369 + 26b43fa commit aa43d49

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches:
99
- master
1010
- 'releases/*'
11+
- 'fix/*'
12+
- 'feat/*'
1113
paths-ignore:
1214
- '**.md'
1315

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ Please refer to earlier parts of the documentation for the configuration of thes
300300

301301
### Versions to install
302302

303-
| Variable | Default | Description |
304-
|------------------|------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
305-
| `llvm-version` | `latest` | The major version of LLVM to install and use. LLVM is installed from [PPA](http://apt.llvm.org/). If `latest`, automatically gather the latest version. If `ignore`, don't install anything. (Not recommended) |
306-
| `install-custom` | `false` | If set to `true`, opens the ability to locally clone and install CodeChecker from the specified `repository` and `version`. Otherwise, `version` is taken as a release version, and the [CodeChecker suite from PyPI](http://pypi.org/project/codechecker) is downloaded. |
307-
| `repository` | [`Ericsson/CodeChecker`](http://github.com/Ericsson/CodeChecker) | The CodeChecker repository to check out and build, if `install-custom` is `true`. |
308-
| `version` | `master` | If `install-custom` is `false`, the release version (e.g. `6.18.0`) to download from PyPI, or `master` to fetch the latest release. Otherwise, the branch (defaulting to `master`), tag, or commit SHA in the `repository` to check out. |
303+
| Variable | Default | Description |
304+
|------------------|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
305+
| `llvm-version` | `latest` | The major version of LLVM to install and use. LLVM is installed from the community [PPA](http://apt.llvm.org/). The value **MUST** be a major version (e.g. `13`) that is supported by the _PPA_ for the OS used! If `latest`, automatically gather the latest (yet unreleased) version. If `ignore`, don't install anything. (Not recommended.) |
306+
| `install-custom` | `false` | If set to `true`, opens the ability to locally clone and install CodeChecker from the specified `repository` and `version`. Otherwise, `version` is taken as a release version, and the [CodeChecker suite from PyPI](http://pypi.org/project/codechecker) is downloaded. |
307+
| `repository` | [`Ericsson/CodeChecker`](http://github.com/Ericsson/CodeChecker) | The CodeChecker repository to check out and build, if `install-custom` is `true`. |
308+
| `version` | `master` | If `install-custom` is `false`, the release version (e.g. `6.18.0`) to download from PyPI, or `master` to fetch the latest release. Otherwise, the branch (defaulting to `master`), tag, or commit SHA in the `repository` to check out. |
309309

310310
### Build log configuration
311311

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
required: true
2020
default: 'master'
2121
llvm-version:
22-
description: 'The major version of LLVM to install and use. LLVM is installed from PPA. If "latest", automatically gather the latest version. If "ignore", do not install anything. (Not recommended)'
22+
description: 'The major version of LLVM to install and use. LLVM is installed from the community PPA at http://apt.llvm.org. The value MUST be a major version (e.g. 13) that is supported by the PPA for the OS used! If "latest", automatically gather the latest version. If "ignore", do not install anything. (Not recommended.)'
2323
required: true
2424
default: 'latest'
2525

src/get-llvm.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ fi
66

77
echo "::group::Installing LLVM"
88

9+
update-alternatives --query clang
10+
update-alternatives --query clang-tidy
11+
912
export DISTRO_FANCYNAME="$(lsb_release -c | awk '{ print $2 }')"
1013
curl -sL http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
1114

@@ -21,12 +24,13 @@ fi
2124
sudo apt-get -y --no-install-recommends install \
2225
clang-$LLVM_VER \
2326
clang-tidy-$LLVM_VER
24-
sudo update-alternatives --install \
25-
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 1000 \
26-
--slave \
27-
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER
28-
echo "::endgroup::"
27+
sudo update-alternatives --install \
28+
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 10000
29+
sudo update-alternatives --install \
30+
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER 10000
2931

3032
update-alternatives --query clang
33+
update-alternatives --query clang-tidy
34+
echo "::endgroup::"
3135

3236
echo "::set-output name=REAL_VERSION::$(clang --version | head -n 1 | cut -d' ' -f4-)"

0 commit comments

Comments
 (0)