Compare commits
12 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6e80af98bd | ||
![]() |
ef434b41eb | ||
![]() |
7eeaf563e4 | ||
![]() |
5cc3e08645 | ||
![]() |
43ade2b388 | ||
![]() |
93f89834ca | ||
![]() |
4535330f96 | ||
![]() |
74a1183273 | ||
![]() |
190f39dc69 | ||
![]() |
4b8d6e7c31 | ||
![]() |
71d1a06d04 | ||
![]() |
95dbaa7ec8 |
4 changed files with 51 additions and 78 deletions
9
.github/actions/build-foo-cygwin/action.yml
vendored
9
.github/actions/build-foo-cygwin/action.yml
vendored
|
@ -1,9 +1,5 @@
|
||||||
name: Build foo.exe
|
name: Build foo.exe
|
||||||
description: Build foo.exe (on Cygwin)
|
description: Build foo.exe (on Cygwin)
|
||||||
inputs:
|
|
||||||
platform:
|
|
||||||
description: Target platform
|
|
||||||
required: true
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
@ -14,7 +10,6 @@ runs:
|
||||||
echo "$src_dir"
|
echo "$src_dir"
|
||||||
src_dir="$( cygpath -ua "$src_dir" )"
|
src_dir="$( cygpath -ua "$src_dir" )"
|
||||||
cd -- "$src_dir"
|
cd -- "$src_dir"
|
||||||
arch=
|
clang++ --version
|
||||||
[ '${{ matrix.platform }}' == 'x86' ] && arch=-m32
|
clang++ -std=c++14 -o foo.exe foo.cpp
|
||||||
clang++ $arch -std=c++14 -o foo.exe foo.cpp
|
|
||||||
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
|
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
|
||||||
|
|
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
|
@ -13,14 +13,14 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [x86, x64]
|
platform: [x86, x64]
|
||||||
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest, windows-2016, windows-2019, windows-latest]
|
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
|
||||||
runs-on: '${{ matrix.os }}'
|
runs-on: '${{ matrix.os }}'
|
||||||
name: 'Test: ${{ matrix.os }} / ${{ matrix.platform }}'
|
name: 'Test: ${{ matrix.os }} / ${{ matrix.platform }}'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Clean up PATH
|
- name: Clean up PATH
|
||||||
uses: egor-tensin/cleanup-path@v1
|
uses: egor-tensin/cleanup-path@v3
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
- name: Set up Clang
|
- name: Set up Clang
|
||||||
uses: ./
|
uses: ./
|
||||||
|
@ -37,19 +37,30 @@ jobs:
|
||||||
versions:
|
versions:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, ubuntu-20.04]
|
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
|
||||||
version: ['3.9', '4.0', 4, '5.0', 5, '6.0', 6, 7, 8, 9, 10, 11, 12, 13]
|
version: ['3.9', '4.0', 4, '5.0', 5, '6.0', 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||||
exclude:
|
exclude:
|
||||||
- {os: ubuntu-20.04, version: '3.9'}
|
- {os: ubuntu-20.04, version: '3.9'}
|
||||||
- {os: ubuntu-20.04, version: '4.0'}
|
- {os: ubuntu-20.04, version: '4.0'}
|
||||||
- {os: ubuntu-20.04, version: 4}
|
- {os: ubuntu-20.04, version: 4}
|
||||||
- {os: ubuntu-20.04, version: '5.0'}
|
- {os: ubuntu-20.04, version: '5.0'}
|
||||||
- {os: ubuntu-20.04, version: 5}
|
- {os: ubuntu-20.04, version: 5}
|
||||||
|
- {os: ubuntu-22.04, version: '3.9'}
|
||||||
|
- {os: ubuntu-22.04, version: '4.0'}
|
||||||
|
- {os: ubuntu-22.04, version: 4}
|
||||||
|
- {os: ubuntu-22.04, version: '5.0'}
|
||||||
|
- {os: ubuntu-22.04, version: 5}
|
||||||
|
- {os: ubuntu-22.04, version: '6.0'}
|
||||||
|
- {os: ubuntu-22.04, version: 6}
|
||||||
|
- {os: ubuntu-22.04, version: 7}
|
||||||
|
- {os: ubuntu-22.04, version: 8}
|
||||||
|
- {os: ubuntu-22.04, version: 9}
|
||||||
|
- {os: ubuntu-22.04, version: 10}
|
||||||
runs-on: '${{ matrix.os }}'
|
runs-on: '${{ matrix.os }}'
|
||||||
name: 'Version: ${{ matrix.os }} / ${{ matrix.version }}'
|
name: 'Version: ${{ matrix.os }} / ${{ matrix.version }}'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- id: setup
|
- id: setup
|
||||||
name: Set up Clang
|
name: Set up Clang
|
||||||
uses: ./
|
uses: ./
|
||||||
|
@ -71,23 +82,22 @@ jobs:
|
||||||
cygwin:
|
cygwin:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [x86, x64]
|
|
||||||
hardlinks: [0, 1]
|
hardlinks: [0, 1]
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
name: 'Cygwin: ${{ matrix.platform }} / hardlinks${{ matrix.hardlinks }}'
|
name: 'Cygwin: hardlinks${{ matrix.hardlinks }}'
|
||||||
|
# As of January 2023, clang simply doesn't work on Cygwin.
|
||||||
|
# It's also marked "Unmaintained" in the installer.
|
||||||
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Clean up PATH
|
- name: Clean up PATH
|
||||||
uses: egor-tensin/cleanup-path@v1
|
uses: egor-tensin/cleanup-path@v3
|
||||||
- name: Install Cygwin
|
- name: Install Cygwin
|
||||||
uses: egor-tensin/setup-cygwin@v3
|
uses: egor-tensin/setup-cygwin@v4
|
||||||
with:
|
|
||||||
platform: '${{ matrix.platform }}'
|
|
||||||
- name: Set up Clang
|
- name: Set up Clang
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
platform: '${{ matrix.platform }}'
|
|
||||||
cygwin: 1
|
cygwin: 1
|
||||||
cc: 1
|
cc: 1
|
||||||
hardlinks: '${{ matrix.hardlinks }}'
|
hardlinks: '${{ matrix.hardlinks }}'
|
||||||
|
|
35
README.md
35
README.md
|
@ -61,25 +61,26 @@ The `version` parameter value is not checked for being an available version for
|
||||||
the current distribution.
|
the current distribution.
|
||||||
The supported versions for a particular distribution are those found in that
|
The supported versions for a particular distribution are those found in that
|
||||||
distro's repositories & those in the LLVM repository.
|
distro's repositories & those in the LLVM repository.
|
||||||
For example, the supported versions for Bionic & Focal as of August 2021 are
|
For example, you can find the list of available versions as of January 2023
|
||||||
listed below.
|
below.
|
||||||
|
|
||||||
| `version` | Bionic | Focal
|
| `version` | Bionic | Focal | Jammy
|
||||||
| --------- | ------ | -----
|
| --------- | ------ | ----- | -----
|
||||||
| 3.9 | ✓ |
|
| 3.9 | ✓ | |
|
||||||
| 4.0 | ✓ |
|
| 4.0 | ✓ | |
|
||||||
| 5.0 | ✓ |
|
| 5.0 | ✓ | |
|
||||||
| 6.0 | ✓ | ✓
|
| 6.0 | ✓ | ✓ |
|
||||||
| 7 | ✓ | ✓
|
| 7 | ✓ | ✓ |
|
||||||
| 8 | ✓ | ✓
|
| 8 | ✓ | ✓ |
|
||||||
| 9 | ✓ | ✓
|
| 9 | ✓ | ✓ |
|
||||||
| 10 | ✓ | ✓
|
| 10 | ✓ | ✓ |
|
||||||
| 11 | ✓ | ✓
|
| 11 | ✓ | ✓ | ✓
|
||||||
| 12 | ✓ | ✓
|
| 12 | ✓ | ✓ | ✓
|
||||||
| 13 | ✓ | ✓
|
| 13 | ✓ | ✓ | ✓
|
||||||
|
| 14 | ✓ | ✓ | ✓
|
||||||
|
| 15 | ✓ | ✓ | ✓
|
||||||
|
|
||||||
This table is not definitive; I expect more future versions to be made
|
This table should be updated periodically; it's a work-in-progress.
|
||||||
available, especially for Focal.
|
|
||||||
|
|
||||||
On Windows and Cygwin, the `version` parameter is ignored.
|
On Windows and Cygwin, the `version` parameter is ignored.
|
||||||
|
|
||||||
|
|
47
action.yml
47
action.yml
|
@ -75,15 +75,6 @@ runs:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DistroVersion {
|
|
||||||
if (!(Get-Command lsb_release -ErrorAction SilentlyContinue)) {
|
|
||||||
throw "Couldn't find lsb_release; LLVM only provides repositories for Debian/Ubuntu"
|
|
||||||
}
|
|
||||||
$distro = lsb_release -is
|
|
||||||
$version = lsb_release -sr
|
|
||||||
"$distro-$version"
|
|
||||||
}
|
|
||||||
|
|
||||||
function Format-UpstreamVersion {
|
function Format-UpstreamVersion {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
|
@ -107,25 +98,12 @@ runs:
|
||||||
[string] $Version
|
[string] $Version
|
||||||
)
|
)
|
||||||
|
|
||||||
$distro = Get-DistroVersion
|
if (!(Get-Command lsb_release -ErrorAction SilentlyContinue)) {
|
||||||
|
throw "Couldn't find lsb_release; LLVM only provides repositories for Debian/Ubuntu"
|
||||||
switch -Wildcard -CaseSensitive ($distro) {
|
|
||||||
'Debian-9*' { "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-$Version main" }
|
|
||||||
'Debian-10*' { "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-$Version main" }
|
|
||||||
'Debian-11*' { "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-$Version main" }
|
|
||||||
'Debian-unstable' { "deb http://apt.llvm.org/unstable/ llvm-toolchain-$Version main" }
|
|
||||||
'Debian-testing' { "deb http://apt.llvm.org/unstable/ llvm-toolchain-$Version main" }
|
|
||||||
'Ubuntu-16.04' { "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$Version main" }
|
|
||||||
'Ubuntu-18.04' { "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$Version main" }
|
|
||||||
'Ubuntu-18.10' { "deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic-$Version main" }
|
|
||||||
'Ubuntu-19.04' { "deb http://apt.llvm.org/disco/ llvm-toolchain-disco-$Version main" }
|
|
||||||
'Ubuntu-19.10' { "deb http://apt.llvm.org/eoan/ llvm-toolchain-eoan-$Version main" }
|
|
||||||
'Ubuntu-20.04' { "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$Version main" }
|
|
||||||
'Ubuntu-20.10' { "deb http://apt.llvm.org/groovy/ llvm-toolchain-groovy-$Version main" }
|
|
||||||
'Ubuntu-21.04' { "deb http://apt.llvm.org/hirsute/ llvm-toolchain-hirsute-$Version main" }
|
|
||||||
|
|
||||||
default { throw "Unsupported distribution: $distro" }
|
|
||||||
}
|
}
|
||||||
|
$codename = lsb_release -sc
|
||||||
|
|
||||||
|
"deb http://apt.llvm.org/$codename/ llvm-toolchain-$codename-$Version main"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Add-UpstreamRepo {
|
function Add-UpstreamRepo {
|
||||||
|
@ -146,7 +124,6 @@ runs:
|
||||||
$pkg_clang = 'clang'
|
$pkg_clang = 'clang'
|
||||||
$pkg_llvm = 'llvm'
|
$pkg_llvm = 'llvm'
|
||||||
$pkg_gxx = 'g++'
|
$pkg_gxx = 'g++'
|
||||||
$additional_deps = @()
|
|
||||||
|
|
||||||
if (!$latest) {
|
if (!$latest) {
|
||||||
$pkg_version = Format-UpstreamVersion $version
|
$pkg_version = Format-UpstreamVersion $version
|
||||||
|
@ -157,21 +134,11 @@ runs:
|
||||||
|
|
||||||
$clang = "$clang-$pkg_version"
|
$clang = "$clang-$pkg_version"
|
||||||
$clangxx = "$clangxx-$pkg_version"
|
$clangxx = "$clangxx-$pkg_version"
|
||||||
|
|
||||||
if ($pkg_version -eq '13') {
|
|
||||||
# On both Bionic and Focal, the following error occurs otherwise:
|
|
||||||
#
|
|
||||||
# The following packages have unmet dependencies:
|
|
||||||
# llvm-13 : Depends: libomp5-13 (>= 8) but it is not going to be installed
|
|
||||||
# E: Unable to correct problems, you have held broken packages.
|
|
||||||
$additional_deps += 'libomp5-13'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!$x64) {
|
if (!$x64) {
|
||||||
$pkg_gxx = 'g++-multilib'
|
$pkg_gxx = 'g++-multilib'
|
||||||
}
|
}
|
||||||
$packages = $pkg_clang,$pkg_llvm,$pkg_gxx
|
$packages = $pkg_clang,$pkg_llvm,$pkg_gxx
|
||||||
$packages += $additional_deps
|
|
||||||
|
|
||||||
Install-Package $packages
|
Install-Package $packages
|
||||||
} elseif ($cygwin_host) {
|
} elseif ($cygwin_host) {
|
||||||
|
@ -198,8 +165,8 @@ runs:
|
||||||
throw "Sorry, installing Clang is unsupported on $os"
|
throw "Sorry, installing Clang is unsupported on $os"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "::set-output name=clang::$clang"
|
echo "clang=$clang" >> $env:GITHUB_OUTPUT
|
||||||
echo "::set-output name=clangxx::$clangxx"
|
echo "clangxx=$clangxx" >> $env:GITHUB_OUTPUT
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
|
|
Loading…
Add table
Reference in a new issue