@@ -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
2618outputs :
2719 clang :
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
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-
248188branding :
249189 icon : star
250190 color : green
0 commit comments