Skip to content

GHA/windows: change openssh server, non-debug-enabled MSVC job, other improvements - #16672

Closed
vszakats wants to merge 12 commits into
curl:masterfrom
vszakats:ghamsys
Closed

vszakats wants to merge 12 commits into
curl:masterfrom
vszakats:ghamsys

Conversation

@vszakats

@vszakats vszakats commented Mar 11, 2025 •

Copy link
Copy Markdown
Member

MSVC:

  • switch jobs to standard openssh server. Reduce exceptions.
  • make the SCP/SFTP ignore list more specific and comment with details.
  • keep using OpenSSH-Windows for the OpenSSL job, and bump to the
    prerelease version.
  • disable ENABLE_DEBUG for BoringSSL to have such build tested. (This
    is the first Windows non-ENABLE_DEBUG build with test runs.)

Takeaways:

  • test 612 broken on Windows.
  • test 613 broken on Windows with the standard openssh server.
  • test 614 broken with libssh and OpenSSH-Windows.
  • test 3022 broken with libssh2 and OpenSSH-Windows.
  • tests broken with OpenSSH-Windows:
    601 603 617 619 621 641 665 2004.
  • vcpkg libssh2[core,zlib] broken due to:
    curl: (67) Authentication failure

MSVC prep steps:

msys/mingw:

  • install openssh later and only when necessary.
  • downgrade msys2 runtime later. (to follow other jobs)
  • disable CheckSpace earlier. Also to untie it from the runtime
    downgrade step, which we would hopefully drop.

@vszakats vszakats added Windows Windows-specific CI Continuous Integration labels Mar 11, 2025
@vszakats
vszakats force-pushed the ghamsys branch 3 times, most recently from 1b3e8f2 to ca1f49b Compare March 11, 2025 15:05
@github-actions github-actions Bot added the tests label Mar 11, 2025
@vszakats
vszakats force-pushed the ghamsys branch 2 times, most recently from c2fa583 to e825a6b Compare March 12, 2025 10:11
This reduces variety and make the chocolatey openssh no longer
tested in CI.

But, that OpenSSH package got its last update in 2019, which seems like
a long time for such package. Its version is 8.0.0.1.
Meanwhile openssh is at 9.9p2. There are beta/pre-release versions,
the latest being from a year ago (April 2024) v9.5.0. All in all, this
doesn't seem like a well tended package.

Let's test how the MSYS2 openssh server works.

https://community.chocolatey.org/packages/openssh/8.0.0.1
https://community.chocolatey.org/packages/openssh
https://github.com/PowerShell/Win32-OpenSSH
https://github.com/PowerShell/openssh-portable

drop choco openssh from path

update test exclusions

leave option to choose openssh server

support prerelease winssh

terminology

cleanups

more detailed exceptions
…elease

To make sure to test with the latest version and lessen the change of any
server side issues. Curl test results are the same as with the latest stable
version from 2019.
@vszakats vszakats changed the title GHA/windows: move openssh install to test prereq step GHA/windows: bump openssh server, non-debug-enabled MSVC job, other improvements Mar 12, 2025
@vszakats vszakats changed the title GHA/windows: bump openssh server, non-debug-enabled MSVC job, other improvements GHA/windows: change openssh server, non-debug-enabled MSVC job, other improvements Mar 12, 2025
@vszakats vszakats closed this in 0ec72c1 Mar 12, 2025
@vszakats
vszakats deleted the ghamsys branch March 12, 2025 11:45
vszakats added a commit to vszakats/curl that referenced this pull request Mar 13, 2025
It seems to be causing consistent hangs in the job it was used in, then
timing out.

Since we saw similar hangs before, with OpenSSH-Windows stable, in all
jobs, drop OpenSSH-Windows from CI, and use openssh from MSYS2 or Cygwin
in all Windows jobs.

Follow-up to 0ec72c1 curl#16672
vszakats added a commit that referenced this pull request Mar 13, 2025
After restricting OpenSSH-Windows to a single job, and bumping it to
the pre-release version, that job started hanging then timing out with
reasonable consistency.

Since we saw similar hangs before with OpenSSH-Windows stable, in all
jobs, drop OpenSSH-Windows from CI, and replace it with MSYS openssh.

After this patch, all Windows jobs use MSYS2 or Cygwin openssh.

Follow-up to 0ec72c1 #16672
Closes #16704
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
timeout-minutes: 5
run: |
/usr/bin/sed -i 's/^CheckSpace/#CheckSpace/' /etc/pacman.conf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks, I got it now. With setup-msys2 in all jobs now, we can drop all 3 of these.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR → #16739

vszakats added a commit to vszakats/curl that referenced this pull request Mar 16, 2025
vszakats added a commit that referenced this pull request Mar 17, 2025
It's done automatically by the `msys2/setup-msys2` action.

Suggested-by: Jeremy Drake
Ref: #16672 (comment)

Closes #16739
vszakats added a commit that referenced this pull request Mar 23, 2025
SFTP/SCP tests were failing in CI with WinCNG libssh2 since we first
added such job. With `curl: (67) Authentication failure`.

The reason is that the default `ssh-keygen` RSA private key format
changed to OpenSSH (RFC4716) in 2018. libssh2 does not support this
format with some of its crypto backends.

Fix it by generating keys explicitly in PEM format as necessary via
the `-m` option. This format is universally recognized for RSA keys.

2018-08-24: https://www.openssh.com/txt/release-7.8: OpenSSH format becomes default
2010-08-23: https://www.openssh.com/txt/release-5.6: `-m` option first supported

This fixed the auth issue, just to reveal a known flakiness issue in
libssh2 + WinCNG, causing:
```
curl: (2) Failure establishing ssh session: -8, Unable to exchange encryption keys
```
Ref: https://github.com/curl/curl/actions/runs/14000494428/job/39205633258?pr=16781#step:15:1796
Tracked here: libssh2/libssh2#804
Mitigated in libssh2 tests by retrying them.

Due to this, keep ignoring these test results.

Also:
- add an env to customize key format: `CURL_TEST_SSH_KEY_FORMAT`
- display the generated format in the log.
- GHA/linux: document the wolfSSH error code causing it to fail tests:
  ```
  curl: (79) wolfssh SFTP connect error -1051 / WS_MATCH_KEY_ALGO_E / cannot match key algo with peer
  ```

Follow-up to 4911e7a #16735
Follow-up to 0ec72c1 #16672
Follow-up to e53523f #14859
Follow-up to e26cbe2 #13979

Closes #16781
vszakats added a commit that referenced this pull request Mar 24, 2025
To have the current latest version, and to avoid the stale, misleading
versions installed by Chocolatey. It also installs transparently, faster,
and making the source of the binaries clear. Install on drive `D:` for
best performance.

After much detective work it turns out that the OpenSSH Windows versions
installed by Chocolatey aren't what they seem:

- The latest pre-release named 9.5.0-beta20240403:
  https://community.chocolatey.org/packages/openssh/9.5.0-beta20240403
  is in reality 8.6.0.0p1-Beta from 2021-05-27:
  https://github.com/PowerShell/Win32-OpenSSH/releases/download/V8.6.0.0p1-Beta/OpenSSH-Win64.zip

- The latest "stable" version 8.0.0.1 is in reality:
  https://community.chocolatey.org/packages/openssh/8.0.0.1
  is in reality 8.0.0.0p1-Beta:
  https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.0.0.0p1-Beta/OpenSSH-Win64.zip

Ref: #16803 (comment)
Follow-up to 67a7775 #16704
Follow-up to 0ec72c1 #16672

Closes #16811
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
… improvements

MSVC:

- switch jobs to standard openssh server. Reduce exceptions.
- make the SCP/SFTP ignore list more specific and comment with details.
- keep using OpenSSH-Windows for the OpenSSL job, and bump to the
  prerelease version.
- disable `ENABLE_DEBUG` for BoringSSL to have such build tested. (This
  is the first Windows non-ENABLE_DEBUG build with test runs.)

Takeaways:

- test 612 broken on Windows.
- test 613 broken on Windows with the standard openssh server.
- test 614 broken with libssh and OpenSSH-Windows.
- test 3022 broken with libssh2 and OpenSSH-Windows.
- tests broken with OpenSSH-Windows:
  601 603 617 619 621 641 665 2004.
- vcpkg `libssh2[core,zlib]` broken due to:
  curl: (67) Authentication failure

MSVC prep steps:

- install base msys2 package to simplify configuration, align with other
  jobs and allow to use msys2 packages for tests.
- add support for msys2 openssh server. Keep OpenSSH-Windows as per-job
  option. Add support for OpenSSH prerelease versions.
  Prerelease does not make a difference in test results, but, stable was
  last updated in 2019 (v8.0.0.1) and it seems better to use maintained
  release track, with its latest from April 2024 (v9.5.0).
  https://community.chocolatey.org/packages/openssh/8.0.0.1
  https://community.chocolatey.org/packages/openssh
  https://github.com/PowerShell/Win32-OpenSSH
  https://github.com/PowerShell/openssh-portable
- add 'libssh' to its job name.
- make `ENABLE_DEBUG` a per-job option.

msys/mingw:

- install `openssh` later and only when necessary.
- downgrade msys2 runtime later. (to follow other jobs)
- disable `CheckSpace` earlier. Also to untie it from the runtime
  downgrade step, which we would hopefully drop.

Closes curl#16672
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
After restricting OpenSSH-Windows to a single job, and bumping it to
the pre-release version, that job started hanging then timing out with
reasonable consistency.

Since we saw similar hangs before with OpenSSH-Windows stable, in all
jobs, drop OpenSSH-Windows from CI, and replace it with MSYS openssh.

After this patch, all Windows jobs use MSYS2 or Cygwin openssh.

Follow-up to 0ec72c1 curl#16672
Closes curl#16704
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
It's done automatically by the `msys2/setup-msys2` action.

Suggested-by: Jeremy Drake
Ref: curl#16672 (comment)

Closes curl#16739
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
SFTP/SCP tests were failing in CI with WinCNG libssh2 since we first
added such job. With `curl: (67) Authentication failure`.

The reason is that the default `ssh-keygen` RSA private key format
changed to OpenSSH (RFC4716) in 2018. libssh2 does not support this
format with some of its crypto backends.

Fix it by generating keys explicitly in PEM format as necessary via
the `-m` option. This format is universally recognized for RSA keys.

2018-08-24: https://www.openssh.com/txt/release-7.8: OpenSSH format becomes default
2010-08-23: https://www.openssh.com/txt/release-5.6: `-m` option first supported

This fixed the auth issue, just to reveal a known flakiness issue in
libssh2 + WinCNG, causing:
```
curl: (2) Failure establishing ssh session: -8, Unable to exchange encryption keys
```
Ref: https://github.com/curl/curl/actions/runs/14000494428/job/39205633258?pr=16781#step:15:1796
Tracked here: libssh2/libssh2#804
Mitigated in libssh2 tests by retrying them.

Due to this, keep ignoring these test results.

Also:
- add an env to customize key format: `CURL_TEST_SSH_KEY_FORMAT`
- display the generated format in the log.
- GHA/linux: document the wolfSSH error code causing it to fail tests:
  ```
  curl: (79) wolfssh SFTP connect error -1051 / WS_MATCH_KEY_ALGO_E / cannot match key algo with peer
  ```

Follow-up to 4911e7a curl#16735
Follow-up to 0ec72c1 curl#16672
Follow-up to e53523f curl#14859
Follow-up to e26cbe2 curl#13979

Closes curl#16781
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
To have the current latest version, and to avoid the stale, misleading
versions installed by Chocolatey. It also installs transparently, faster,
and making the source of the binaries clear. Install on drive `D:` for
best performance.

After much detective work it turns out that the OpenSSH Windows versions
installed by Chocolatey aren't what they seem:

- The latest pre-release named 9.5.0-beta20240403:
  https://community.chocolatey.org/packages/openssh/9.5.0-beta20240403
  is in reality 8.6.0.0p1-Beta from 2021-05-27:
  https://github.com/PowerShell/Win32-OpenSSH/releases/download/V8.6.0.0p1-Beta/OpenSSH-Win64.zip

- The latest "stable" version 8.0.0.1 is in reality:
  https://community.chocolatey.org/packages/openssh/8.0.0.1
  is in reality 8.0.0.0p1-Beta:
  https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.0.0.0p1-Beta/OpenSSH-Win64.zip

Ref: curl#16803 (comment)
Follow-up to 67a7775 curl#16704
Follow-up to 0ec72c1 curl#16672

Closes curl#16811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration SCP/SFTP tests Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants