diff options
Diffstat (limited to '')
| -rw-r--r-- | .github/actions/build-boost/action.yml | 5 | ||||
| -rw-r--r-- | .github/actions/build-example/action.yml | 9 | ||||
| -rw-r--r-- | .github/actions/check-boost-bootstrapped/action.yml | 4 | ||||
| -rw-r--r-- | .github/actions/check-runtime-library/action.yml | 9 | ||||
| -rw-r--r-- | .github/actions/common-variables/action.yml | 17 | ||||
| -rw-r--r-- | .github/actions/download-boost/action.yml | 5 | ||||
| -rw-r--r-- | .github/actions/run-example-boost/action.yml | 13 | ||||
| -rw-r--r-- | .github/actions/software-environment/action.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/cygwin_static_libstdc++.yml | 81 | ||||
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | common.cmake | 3 | ||||
| -rw-r--r-- | project/os.py | 11 | ||||
| -rw-r--r-- | project/toolset.py | 5 | ||||
| -rw-r--r-- | project/utils.py | 11 |
14 files changed, 16 insertions, 177 deletions
diff --git a/.github/actions/build-boost/action.yml b/.github/actions/build-boost/action.yml index 2a47ea4..fdd4fdc 100644 --- a/.github/actions/build-boost/action.yml +++ b/.github/actions/build-boost/action.yml @@ -36,11 +36,6 @@ runs: Remove-Variable libraries } - if ($env:CI_HOST_CYGWIN) { - $python = 'python3' - $boost_dir = cygpath.exe -ua $boost_dir - } - & $python ` -m project.boost.build ` --toolset '${{ inputs.toolset }}' ` diff --git a/.github/actions/build-example/action.yml b/.github/actions/build-example/action.yml index 8d684c1..7a77582 100644 --- a/.github/actions/build-example/action.yml +++ b/.github/actions/build-example/action.yml @@ -42,15 +42,6 @@ runs: $install_dir = '${{ steps.install-dir.outputs.path }}' $boost_dir = '${{ inputs.boost-dir }}' - if ($env:CI_HOST_CYGWIN) { - $python = 'python3' - $src_dir = cygpath.exe -ua $src_dir - $install_dir = cygpath.exe -ua $install_dir - if ($boost_dir) { - $boost_dir = cygpath.exe -ua $boost_dir - } - } - $args = @( '--install', $install_dir, diff --git a/.github/actions/check-boost-bootstrapped/action.yml b/.github/actions/check-boost-bootstrapped/action.yml index cd901cc..fa96575 100644 --- a/.github/actions/check-boost-bootstrapped/action.yml +++ b/.github/actions/check-boost-bootstrapped/action.yml @@ -32,9 +32,7 @@ runs: $exists_plain = Test-Path $path -Type Leaf $exists_exe = Test-Path "${path}.exe" -Type Leaf - $exists = if ($env:CI_HOST_CYGWIN) { - $exists_plain -or $exists_exe - } elseif ($env:CI_HOST_WINDOWS) { + $exists = if ($env:CI_HOST_WINDOWS) { $exists_exe } else { $exists_plain diff --git a/.github/actions/check-runtime-library/action.yml b/.github/actions/check-runtime-library/action.yml index 32d2246..a112687 100644 --- a/.github/actions/check-runtime-library/action.yml +++ b/.github/actions/check-runtime-library/action.yml @@ -130,16 +130,9 @@ runs: $windows_forbidden = @() } } - # Linking libstdc++ statically on Cygwin is broken, see the - # cygwin_static_libstdc++.yml workflow. - $cygwin_forbidden = @('msvcrt.dll') $linux_forbidden = @() - if ($env:CI_TARGET_CYGWIN) { - Do-ValidateLinkedLibraries ` - -Actual $Actual ` - -Forbidden $cygwin_forbidden - } elseif ($env:CI_TARGET_WINDOWS) { + if ($env:CI_TARGET_WINDOWS) { Do-ValidateLinkedLibraries ` -Actual $Actual ` -Forbidden $windows_forbidden diff --git a/.github/actions/common-variables/action.yml b/.github/actions/common-variables/action.yml index 3d40cdd..3b197da 100644 --- a/.github/actions/common-variables/action.yml +++ b/.github/actions/common-variables/action.yml @@ -4,30 +4,23 @@ inputs: toolset: description: Toolset used required: true - cygwin: - description: Targeting Cygwin - required: false - default: 0 runs: using: composite steps: - run: | New-Variable toolset -Value '${{ inputs.toolset }}' -Option Constant - New-Variable cygwin -Value ('${{ inputs.cygwin }}' -eq '1') -Option Constant New-Variable os -Value '${{ runner.os }}' -Option Constant New-Variable host_linux -Value ($os -eq 'Linux') -Option Constant - New-Variable host_cygwin -Value $cygwin -Option Constant - New-Variable host_windows -Value ($os -eq 'Windows' -and !$host_cygwin) -Option Constant + New-Variable host_windows -Value ($os -eq 'Windows') -Option Constant New-Variable mingw -Value ($toolset -eq 'mingw' -or ($host_windows -and $toolset -eq 'gcc')) -Option Constant New-Variable target_linux -Value ($host_linux -and !$mingw) -Option Constant - New-Variable target_cygwin -Value ($host_cygwin -and !$mingw) -Option Constant New-Variable target_windows -Value ($mingw -or $host_windows) -Option Constant - New-Variable target_pe -Value ($target_windows -or $target_cygwin) -Option Constant + New-Variable target_pe -Value $target_windows -Option Constant New-Variable target_elf -Value $target_linux -Option Constant function Set-BoolVar { @@ -57,11 +50,9 @@ runs: } Set-BoolVar 'CI_HOST_LINUX' $host_linux - Set-BoolVar 'CI_HOST_CYGWIN' $host_cygwin Set-BoolVar 'CI_HOST_WINDOWS' $host_windows Set-BoolVar 'CI_MINGW' $mingw Set-BoolVar 'CI_TARGET_LINUX' $target_linux - Set-BoolVar 'CI_TARGET_CYGWIN' $target_cygwin Set-BoolVar 'CI_TARGET_WINDOWS' $target_windows Set-BoolVar 'CI_TARGET_PE' $target_pe @@ -70,8 +61,8 @@ runs: $lib_prefix = 'lib' $lib_ext = if ($target_windows -and -not $mingw) { '.lib' } else { '.a' } - $dll_prefix = if ($target_windows -and -not $mingw) { '' } elseif ($target_cygwin) { 'cyg' } else { 'lib' } - $dll_ext = if ($target_windows -or $target_cygwin) { '.dll' } else { '.so' } + $dll_prefix = if ($target_windows -and -not $mingw) { '' } else { 'lib' } + $dll_ext = if ($target_windows) { '.dll' } else { '.so' } $exe_ext = if ($target_pe) { '.exe' } else { '' } diff --git a/.github/actions/download-boost/action.yml b/.github/actions/download-boost/action.yml index 7e15075..05f6bf3 100644 --- a/.github/actions/download-boost/action.yml +++ b/.github/actions/download-boost/action.yml @@ -42,10 +42,5 @@ runs: $args += '--no-retry' } - if ($env:CI_HOST_CYGWIN) { - $python = 'python3' - $cache_dir = cygpath.exe -ua $cache_dir - } - & $python -m project.boost.download --cache $cache_dir $args -- $env:BOOST_VERSION shell: pwsh diff --git a/.github/actions/run-example-boost/action.yml b/.github/actions/run-example-boost/action.yml index 0dd9f44..0fd05ed 100644 --- a/.github/actions/run-example-boost/action.yml +++ b/.github/actions/run-example-boost/action.yml @@ -19,23 +19,14 @@ runs: $absolute_test = Join-Path (Get-Location).Path 'test.txt' $exe_path = (Join-Path $path 'bin' 'foo') - if (-not $env:CI_TARGET_CYGWIN) { - $exe_path += $env:CI_EXE_EXT - } - - $argv0 = $exe_path - if ($env:CI_TARGET_CYGWIN) { - # Apparently, Cygwin programs convert argv[0] when executing native - # programs or being executed by them. - $argv0 = cygpath.exe -ua $argv0 - } + $exe_path += $env:CI_EXE_EXT $actual = & $exe_path $relative_test echo 'Actual output:' echo $actual - $expected = $argv0,$absolute_test + $expected = $exe_path,$absolute_test echo 'Expected output:' echo $expected diff --git a/.github/actions/software-environment/action.yml b/.github/actions/software-environment/action.yml index 872449d..9dd1486 100644 --- a/.github/actions/software-environment/action.yml +++ b/.github/actions/software-environment/action.yml @@ -26,9 +26,7 @@ runs: function Print-Info { param( [Parameter(Mandatory=$true)] - [string] $name, - [Parameter()] - [string] $exe + [string] $name ) echo '' @@ -36,11 +34,7 @@ runs: echo $name echo '------------------------------------------------------------' - if (!$exe) { - $exe = $name - } - - $full_path = Get-Command $exe -ErrorAction SilentlyContinue + $full_path = Get-Command $name -ErrorAction SilentlyContinue if ($full_path) { $full_path = $full_path.Path echo "Location: $full_path" @@ -51,12 +45,7 @@ runs: } } - $python = 'python' - if ($env:CI_HOST_CYGWIN) { - $python = 'python3' - } - - Print-Info 'python' $python + Print-Info 'python' Print-Info 'cmake' Print-Info 'make' Print-Info 'mingw32-make' diff --git a/.github/workflows/cygwin_static_libstdc++.yml b/.github/workflows/cygwin_static_libstdc++.yml deleted file mode 100644 index aa5631d..0000000 --- a/.github/workflows/cygwin_static_libstdc++.yml +++ /dev/null @@ -1,81 +0,0 @@ -# -static-libstdc++ is broken on Cygwin for some reason, as this workflow tries -# to demonstrate. I don't know why exactly, but I'm not the only one with this -# problem: -# -# * https://stackoverflow.com/q/46854365/514684 -# * https://sourceforge.net/p/stlplus/discussion/345536/thread/48c7fc9c17/?limit=25 - -name: Cygwin & -static-libstdc++ - -on: - #push: - #pull_request: - schedule: - # Weekly, at 5:30 AM on Saturday (somewhat randomly chosen). - - cron: '30 5 * * 6' - workflow_dispatch: - -jobs: - test: - runs-on: windows-latest - - name: Test - - defaults: - run: - shell: pwsh - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Clean up PATH - uses: egor-tensin/cleanup-path@v3 - if: runner.os == 'Windows' - - - name: Set common variables - uses: ./.github/actions/common-variables - with: - toolset: gcc - cygwin: 1 - - - name: Install Cygwin - uses: egor-tensin/setup-cygwin@v3 - - - name: Install GCC - uses: egor-tensin/setup-gcc@v1 - with: - cygwin: 1 - - - name: Set up software environment - uses: ./.github/actions/software-environment - with: - toolset: gcc - - - name: test.cpp - run: | - $src = @" - #include <stdexcept> - - int main() { - std::runtime_error x{"x"}; - std::runtime_error y{x}; - return 0; - } - "@ - - echo $src > test.cpp - - - name: Build w/ -static-libstdc++ - run: C:\tools\cygwin\bin\g++.exe -static-libstdc++ -o test test.cpp - continue-on-error: true - - - name: Should fail - run: $(Test-Path test.exe -Type Leaf) -and $(throw "test.exe shouldn't have been built") - - - name: Build w/ --allow-multiple-definition - run: C:\tools\cygwin\bin\g++.exe '-Wl,--allow-multiple-definition' -static-libstdc++ -o test test.cpp - continue-on-error: true - - - name: Should succeed - run: $(Test-Path test.exe -Type Leaf) -or $(throw "test.exe should have been built") @@ -50,9 +50,6 @@ limited to: | Windows | make \[1\] | Clang \[2\] | | | | MinGW-w64 | | | msbuild | MSVC | -| Cygwin | make | Clang | -| | | GCC | -| | | MinGW-w64 | 1. Both GNU make and MinGW mingw32-make. 2. clang-cl is supported by Boost 1.69.0 or higher only. diff --git a/common.cmake b/common.cmake index 57f4e83..36f232b 100644 --- a/common.cmake +++ b/common.cmake @@ -210,9 +210,6 @@ function(_cc_static_runtime_gcc target) #target_link_libraries("${target}" PRIVATE -static) set(flags -static-libstdc++ -static-libgcc) - if(CYGWIN) - set(flags -static-libgcc) - endif() if(CMAKE_VERSION VERSION_LESS "3.13") _cc_join(flags_str " " ${flags}) diff --git a/project/os.py b/project/os.py index cb5bd44..db489ce 100644 --- a/project/os.py +++ b/project/os.py @@ -10,7 +10,6 @@ import platform class OS(Enum): WINDOWS = 'Windows' LINUX = 'Linux' - CYGWIN = 'Cygwin' MACOS = 'macOS' def __str__(self): @@ -25,8 +24,6 @@ class OS(Enum): return OS.LINUX if system == 'Darwin': return OS.MACOS - if system.startswith('CYGWIN_NT'): - return OS.CYGWIN raise NotImplementedError(f'unsupported OS: {system}') @@ -36,7 +33,7 @@ def on_windows(): def on_windows_like(): os = OS.current() - return os is OS.WINDOWS or os is OS.CYGWIN + return os is OS.WINDOWS def on_linux(): @@ -45,8 +42,4 @@ def on_linux(): def on_linux_like(): os = OS.current() - return os is OS.LINUX or os is OS.CYGWIN or os is OS.MACOS - - -def on_cygwin(): - return OS.current() is OS.CYGWIN + return os is OS.LINUX or os is OS.MACOS diff --git a/project/toolset.py b/project/toolset.py index 35d5192..73e0852 100644 --- a/project/toolset.py +++ b/project/toolset.py @@ -14,9 +14,6 @@ limited to: | Windows | make [1] | Clang [2] | | | | MinGW-w64 | | | msbuild | MSVC | -| Cygwin | make | Clang | -| | | GCC | -| | | MinGW-w64 | 1. Both GNU make and MinGW mingw32-make. 2. clang-cl is supported by Boost 1.69.0 or higher only. @@ -472,7 +469,7 @@ class CMakeCustom(Toolset): if shutil.which('mingw32-make'): return 'MinGW Makefiles' return 'Unix Makefiles' - # On Linux/Cygwin, make all the way: + # On Linux, make all the way: return 'Unix Makefiles' @staticmethod diff --git a/project/utils.py b/project/utils.py index 6697ff7..1be2b55 100644 --- a/project/utils.py +++ b/project/utils.py @@ -28,19 +28,12 @@ def full_exe_name(exe): if not project.os.on_windows_like(): # There's no PATHEXT on Linux. return exe - # b2 on Windows/Cygwin doesn't like it when the executable name doesn't - # include the extension. + # b2 on Windows doesn't like it when the executable name doesn't include + # the extension. dir_path = os.path.dirname(exe) or None path = shutil.which(exe, path=dir_path) if not path: raise RuntimeError(f"executable '{exe}' could not be found") - if project.os.on_cygwin(): - # On Cygwin, shutil.which('gcc') == '/usr/bin/gcc' and shutil.which('gcc.exe') - # == '/usr/bin/gcc.exe'; we want the latter version. shutil.which('clang++') - # == '/usr/bin/clang++' is fine though, since it _is_ the complete path - # (clang++ is a symlink). - if os.path.exists(path) and os.path.exists(path + '.exe'): - path += '.exe' if dir_path: # If it was found in a specific directory, include the directory in the # result. shutil.which returns the executable name prefixed with the |
