Skip to content

test428: skip when running on older MSYS2 versions - #23345

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:old-msys2
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:old-msys2

Conversation

@vszakats

@vszakats vszakats commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

The root cause for unexplained test428 failures was older MSYS2/Cygwin
runtimes filtering out set but empty environment variables when a Cygwin
process launches a non-Cygwin one. In curl this happens when runtests
launches the native Windows curl tool. MSYS2 3.4.2+ (2022-12-16) no
longer does this filtering by default. In CI the affected environments
are AppVeyor CI's Visual Studio 2015/2017/2019 images, which use MSYS2
3.0.7 (newer images have 3.6.5 and 3.6.9).

Detect this condition in runtests and skip the test when unsupported.

Fixing:

=== Start of file stderr428
 curl: Variable 'BLANK' import fail, not set
 curl: log/17/cmd:3 config file option '--variable' variable expansion failure
 curl: option -K: variable expansion failure
 curl: try 'curl --help' or 'curl --manual' for more information
=== End of file stderr428

Refs:

2022-09-24 - Changed behavior for empty env vars
Empty environment variables are no longer removed when starting a new non-cygwin process.

https://www.msys2.org/news/#2022-09-24-changed-behavior-for-empty-env-vars
msys2/msys2-runtime@59b6d44
msys2/msys2-runtime#125

Notes:

  • I did my best to figure out the cutoff version, but could only actually
    test that 3.6.5+ and 3.0.7. Please adjust if inaccurate.
  • MSYS2 allows setting MSYS=noemptyenvvalues to disable the new
    behavior and breaking test428. This patch does not address this
    exception.
  • Cygwin and MSYS2 are considered interchangable in the codebase,
    this patch included. However, AFAICT Cygwin did not receive this
    particular fix as of today's Cygwin master. Let us know if this causes
    an issue.

Follow-up to 0774051 #17991
Follow-up to 7cf8414
Cherry-picked from #23306


Tested OK here: https://ci.appveyor.com/project/curlorg/curl/builds/54872648

@github-actions github-actions Bot added the tests label Oct 10, 2026
@vszakats vszakats added cmdline tool Windows Windows-specific labels Oct 10, 2026
[WIP text below]

The root cause is older MSYS2/Cygwin runtimes filtering out set but
empty environment variables when a Cygwin process launches a non-Cygwin
one. In curl this happens when runtests launches the native Windows curl
tool. MSYS2 3.6.5+ (~2025-10-09) fixed it by no longer filtering. In CI
the affected environments are AppVeyor CI's Visual Studio 2015/2017/2019
images, which use MSYS2 3.0.7 (newer images use 3.6.5 and 3.6.9).

Detect this condition in runtests and skip the test when unsupported.

Fixing:
```
=== Start of file stderr428
 curl: Variable 'BLANK' import fail, not set
 curl: log/17/cmd:3 config file option '--variable' variable expansion failure
 curl: option -K: variable expansion failure
 curl: try 'curl --help' or 'curl --manual' for more information
=== End of file stderr428
```

Refs:
 ```
2022-09-24 - Changed behavior for empty env vars
Empty environment variables are no longer removed when starting a new non-cygwin process.
```
https://www.msys2.org/news/#2022-09-24-changed-behavior-for-empty-env-vars
msys2/msys2-runtime@2bda763

Follow-up to 0774051 curl#17991
Follow-up to 7cf8414

Raw notes:

It's a test that sets `BLANK` env to empty and curl expects it to find
it set, and empty. old MSYS2 does not pass empty envs, apparently.

```
2022-09-24 - Changed behavior for empty env vars
Empty environment variables are no longer removed when starting a new non-cygwin process.
```
https://www.msys2.org/news/#2022-09-24-changed-behavior-for-empty-env-vars

Hard to say which MSYS2 version this appeared in, my estimate, based
on tag dates is: 3.6.5 2025-10-09:
```
2025-10-09 cygwin-3.6.5
```
(commit below is not contained in any tags when checked with `git tag --containes`)

```
commit 2bda763e12ce736ffc65a07039d4c1aa138adb0c
Author:     Johannes Schindelin <johannes.schindelin@gmx.de>
AuthorDate: 2015-02-18 12:32:17 +0000
Commit:     Christoph Reiter <reiter.christoph@gmail.com>
CommitDate: 2026-07-16 08:08:03 +0200

Pass environment variables with empty values

There is a difference between an empty value and an unset environment
variable. We should not confuse both; If the user wants to unset an
environment variable, they can certainly do so (unsetenv(3), or in the
shell: 'unset ABC').

This fixes Git's t3301-notes.sh, which overrides environment variables
with empty values.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
```
msys2/msys2-runtime@2bda763
@vszakats vszakats closed this in b8f71d6 Oct 10, 2026
@vszakats
vszakats deleted the old-msys2 branch October 10, 2026 22:10
@vszakats vszakats mentioned this pull request Oct 16, 2026
9 of 10 tasks
vszakats added a commit that referenced this pull request Oct 18, 2026
- in jobs building tests, also run them.
- to maintain CI cycle times, only run unit tests by default, and run
  all (supported) tests in just one job, carefully selected to be the
  one running them the fastest.
  Per job, it takes ~15 seconds to run ~80 unit tests.
  It takes 5 minutes to run all (~1600) tests. Total job time 5.5-6
  minutes.
  If the full test run turns out to be annoying or grow slow, we disable
  or limit it to a subset of tests.
- run tests with `-j10` parallelism. It results in the fastest runs,
  based on tests.
- to avoid the MSBuild test breaker heuristics, and to improve
  performance, run tests by directly invoking `runtests.pl` (not via
  CMake -> MSBuild -> `runtests.pl`).
  It saves 10-40 seconds per full test run.
- when running directly via `runtests.pl`, exclude test 1119 and 1167.
  It's not compatible with Visual Studio generator builds.
- run the artifact upload in parallel with running tests.

Running Windows tests in multiple environments makes it more likely they
can run on local machines, too, also making them easier to debug.
AppVeyor also supports remote access via RDP, which may help debugging
notorious Windows issues live, with some luck of reproducing it in a run
with RDP access explicitly enabled beforehand.

Fixes/improvements via this PR, merged separately:

dc99e12 #23467 processhelp.pm: improve task info in trace output (Windows)
70f3f85 #23471 test1488: drop unused C preprocessor logic
af9d2dd #23336 cmake: fix preconditions for option `CURL_STATIC_CRT=ON`
adf8b78 #23428 setopt: fix setting `CURLWS_NOAUTOPONG` with compilers lacking C99 bool type
780405b #23416 tests: add `--dump-module-paths` debug option (Windows)
bc22977 #23400 msvc: replace debug CRT GUI popups with stderr output
87a1dc7 #23396 appveyor: minor improvements
67f3510 #23381 runtests: add `-S` option to show success logs
e9af987 #23378 tests/server: fix crashing with VS2013 and earlier
8cdee8a #23377 lib557: exclude three floating point test cases for VS2013 and earlier
1aac64a #23375 test1119, 1167: disable MSYS2 argument conversion narrowly
49f003f #23337 unit1664: add workaround for VS2019 16.3 - VS2022 17.4 x64 miscompile
b8f71d6 #23345 test428: skip when running on older MSYS2 versions
2f3f99d #23339 test1119, 1167: disable MSYS2 argument conversion
098d3a0 #23332 runtests: unset `CURL_MEMDEBUG` for curl requests made to the CI API
d3e7caf #23335 GHA/windows: drop unused `-ac` runtests options
2874cc6 #23317 mqttd: work around bogus VS2019 32-bit compiler warning
e8adc72 #23315 schannel: fix guard for old MSVC workaround

Follow-up to 41198e0 #20390

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

Labels

Development

Successfully merging this pull request may close these issues.

1 participant