Skip to content

Commit eee1040

Browse files
committed
drop Cygwin, it's obsolete
1 parent 1b94e0a commit eee1040

5 files changed

Lines changed: 5 additions & 151 deletions

File tree

.github/actions/build-foo-cygwin/action.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/actions/check-cc-cygwin/action.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -61,40 +61,3 @@ jobs:
6161
uses: ./.github/actions/check-cc
6262
with:
6363
version: '${{ matrix.version }}'
64-
65-
cygwin:
66-
strategy:
67-
matrix:
68-
hardlinks: [0, 1]
69-
runs-on: windows-latest
70-
name: 'Cygwin: hardlinks${{ matrix.hardlinks }}'
71-
# As of January 2023, clang simply doesn't work on Cygwin.
72-
# It's also marked "Unmaintained" in the installer.
73-
continue-on-error: true
74-
steps:
75-
- name: Checkout
76-
uses: actions/checkout@v6
77-
- name: Clean up PATH
78-
uses: egor-tensin/cleanup-path@v4
79-
- name: Install Cygwin
80-
uses: egor-tensin/setup-cygwin@v4
81-
- name: Set up Clang
82-
uses: ./
83-
with:
84-
cygwin: 1
85-
cc: 1
86-
hardlinks: '${{ matrix.hardlinks }}'
87-
- name: Build foo.exe
88-
uses: ./.github/actions/build-foo
89-
if: matrix.hardlinks
90-
- name: Build foo.exe
91-
uses: ./.github/actions/build-foo-cygwin
92-
if: '!matrix.hardlinks'
93-
- name: Run foo.exe
94-
uses: ./.github/actions/run-foo
95-
- name: Check symlinks
96-
uses: ./.github/actions/check-cc
97-
if: matrix.hardlinks
98-
- name: Check symlinks
99-
uses: ./.github/actions/check-cc-cygwin
100-
if: '!matrix.hardlinks'

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Set up Clang
55

66
This GitHub action sets up Clang & LLVM in your workflow run.
77

8-
1. Installs either 32-bit or 64-bit Clang & LLVM on either Ubuntu, Windows or
9-
Cygwin.
8+
1. Installs either 32-bit or 64-bit Clang & LLVM on either Ubuntu or Windows.
109
2. Specify a version to install using the `version` parameter.
1110

1211
Use it in your workflow like this:
@@ -20,14 +19,10 @@ Use it in your workflow like this:
2019
* `latest` is the default value for the `version` parameter and can be omitted.
2120
* `x64` is the default value for the `platform` parameter and can be omitted.
2221
Use `x86` if you want to build 32-bit binaries.
23-
* Set the `cygwin` parameter to `1` to set up Clang inside an existing Cygwin
24-
installation (you can set up Cygwin itself using my action [setup-cygwin]).
2522
* `cc` and `c++` executables are set up, pointing to the `clang` and `clang++`
2623
executables.
2724
Disable this by setting the `cc` parameter to `0`.
2825

29-
[setup-cygwin]: https://github.com/egor-tensin/setup-cygwin
30-
3126
API
3227
---
3328

@@ -37,12 +32,8 @@ API
3732
| | *any* | | Install a specific version if it's available (see below).
3833
| platform | x64 | ✓ | Install the x86_64 toolchain.
3934
| | *any* | | Install the i686 toolchain.
40-
| cygwin | *any* | ✓ | Install native binaries.
41-
| | 1 | | Install Cygwin packages.
4235
| cc | 1 | ✓ | Set up `cc`/`clang`/`c++`/`clang++` executables.
4336
| | *any* | | Don't set up the executables.
44-
| hardlinks | *any* | ✓ | Cygwin: don't convert any symlinks.
45-
| | 1 | | Cygwin: convert symlinks in /usr/bin to hardlinks.
4637

4738
| Output | Example | Description
4839
| ------- | --------- | -----------
@@ -82,7 +73,7 @@ below.
8273

8374
This table should be updated periodically; it's a work-in-progress.
8475

85-
On Windows and Cygwin, the `version` parameter is ignored.
76+
On Windows, the `version` parameter is ignored.
8677

8778
License
8879
-------

action.yml

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ inputs:
1010
description: Target platform
1111
required: false
1212
default: x64
13-
cygwin:
14-
description: Install Cygwin packages
15-
required: false
16-
default: 0
1713
cc:
1814
description: Set up cc/clang/c++/clang++ executables
1915
required: false
2016
default: 1
21-
hardlinks:
22-
description: On Cygwin, replace executable symlinks with hardlinks
23-
required: false
24-
default: 0
2517

2618
outputs:
2719
clang:
@@ -39,8 +31,7 @@ runs:
3931
New-Variable os -Value '${{ runner.os }}' -Option Constant
4032
4133
New-Variable linux_host -Value ($os -eq 'Linux') -Option Constant
42-
New-Variable cygwin_host -Value ('${{ inputs.cygwin }}' -eq '1') -Option Constant
43-
New-Variable windows_host -Value ($os -eq 'Windows' -and !$cygwin_host) -Option Constant
34+
New-Variable windows_host -Value ($os -eq 'Windows') -Option Constant
4435
4536
New-Variable version -Value ('${{ inputs.version }}') -Option Constant
4637
New-Variable latest -Value ($version -eq 'latest') -Option Constant
@@ -64,9 +55,6 @@ runs:
6455
if ($script:linux_host) {
6556
sudo apt-get update
6657
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends $Packages
67-
} elseif ($script:cygwin_host) {
68-
$choco = Locate-Choco
69-
& $choco install $Packages -y --no-progress --source=cygwin
7058
} elseif ($script:windows_host) {
7159
$choco = Locate-Choco
7260
& $choco upgrade $Packages -y --no-progress --allow-downgrade
@@ -141,21 +129,6 @@ runs:
141129
$packages = $pkg_clang,$pkg_llvm,$pkg_gxx
142130
143131
Install-Package $packages
144-
} elseif ($cygwin_host) {
145-
if (!$x64) {
146-
echo @'
147-
::warning ::
148-
32-bit-targeting Clang is unavailable on 64-bit Cygwin.
149-
Please use 32-bit Cygwin instead.
150-
If you _are_ using 32-bit Cygwin, please ignore this message.
151-
'@
152-
}
153-
154-
# IDK why, but without libiconv-devel, even a "Hello, world!"
155-
# C++ app cannot be compiled as of December 2020. Also, libstdc++
156-
# is required; it's simpler to install gcc-g++ for all the
157-
# dependencies.
158-
Install-Package clang gcc-g++ libiconv-devel llvm
159132
} elseif ($windows_host) {
160133
Install-Package llvm
161134
@@ -173,8 +146,7 @@ runs:
173146
New-Variable os -Value '${{ runner.os }}' -Option Constant
174147
175148
New-Variable linux_host -Value ($os -eq 'Linux') -Option Constant
176-
New-Variable cygwin_host -Value ('${{ inputs.cygwin }}' -eq '1') -Option Constant
177-
New-Variable windows_host -Value ($os -eq 'Windows' -and !$cygwin_host) -Option Constant
149+
New-Variable windows_host -Value ($os -eq 'Windows') -Option Constant
178150
179151
New-Variable cc -Value ('${{ inputs.cc }}' -eq '1') -Option Constant
180152
@@ -192,12 +164,10 @@ runs:
192164
$exe_path = (Get-Command $Exe).Path
193165
$link_dir = if ($script:windows_host) { Split-Path $exe_path } else { '/usr/local/bin' }
194166
$link_name = if ($script:windows_host) { "$LinkName.exe" } else { $LinkName }
195-
$link_path = if ($script:cygwin_host) { "$link_dir/$link_name" } else { Join-Path $link_dir $link_name }
167+
$link_path = Join-Path $link_dir $link_name
196168
echo "Creating link $link_path -> $exe_path"
197169
if ($script:linux_host) {
198170
sudo ln -f -s $exe_path $link_path
199-
} elseif ($script:cygwin_host) {
200-
ln.exe -f -s $exe_path $link_path
201171
} elseif ($script:windows_host) {
202172
New-Item -ItemType HardLink -Path $link_path -Value $exe_path -Force | Out-Null
203173
}
@@ -215,36 +185,6 @@ runs:
215185
}
216186
shell: pwsh
217187
218-
- run: |
219-
New-Variable cygwin_host -Value ('${{ inputs.cygwin }}' -eq '1') -Option Constant
220-
New-Variable hardlinks -Value ('${{ inputs.hardlinks }}' -eq '1') -Option Constant
221-
222-
if ($cygwin_host -and $hardlinks) {
223-
# clang/clang++ are Cygwin symlinks, pointing to clang-X.exe. It's
224-
# convenient to make proper executables instead so that they can be
225-
# called from Windows' command prompt.
226-
echo @'
227-
while IFS= read -d '' -r link_path; do
228-
dest_path="$( readlink --canonicalize-existing -- "$link_path" )"
229-
dest_ext=".${dest_path##*.}"
230-
[ "$dest_ext" == ".$dest_path" ] && dest_ext=
231-
link_ext=".${link_path##*.}"
232-
[ "$link_ext" == ".$link_path" ] && link_ext=
233-
echo "Removing symlink $link_path" && rm -f -- "$link_path"
234-
[ "$link_ext" != "$dest_ext" ] && echo "${PATHEXT//\;/
235-
}" | grep -q --ignore-case --line-regexp -F -- "$dest_ext" && link_path="$link_path$dest_ext"
236-
echo "Creating hardlink $link_path -> $dest_path" && ln -- "$dest_path" "$link_path"
237-
done < <( find /usr/local/bin /usr/bin \
238-
-type l '-(' \
239-
-path '/usr/bin/clang*' -o \
240-
-path '/usr/bin/llvm*' -o \
241-
-path /usr/local/bin/cc -o \
242-
-path /usr/local/bin/c++ \
243-
'-)' -print0 )
244-
'@ | & bash.exe --login -o errexit -o nounset -o pipefail -o igncr
245-
}
246-
shell: pwsh
247-
248188
branding:
249189
icon: star
250190
color: green

0 commit comments

Comments
 (0)