Repository navigation
Conversation
[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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Refs:
https://www.msys2.org/news/#2022-09-24-changed-behavior-for-empty-env-vars
msys2/msys2-runtime@59b6d44
msys2/msys2-runtime#125
Notes:
test that 3.6.5+ and 3.0.7. Please adjust if inaccurate.
MSYS=noemptyenvvaluesto disable the newbehavior and breaking test428. This patch does not address this
exception.
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
→ Also a weird combo, though I guess someone may want to use a Cygwin-built Perl interchangeably with MSYS2.
[IGNORE FOR NOW]
Does Cygwin-Cygwin app count as one? Is it only an MSYS2-process? [→ IGNORE, as weird combos]
MSYS=noemptyenvvalues.No, skip this as overkill, if someone is setting this for curl tests, test428 needs to be disabled manually.
FTR, this feature are MSYS2 patches over the MSYS2 Cygwin fork, implemented here:
https://github.com/msys2/MSYS2-packages/blob/c98a0dd857f83e3b78ddac86688ae64d262d57fb/msys2-runtime/0031-Optionally-disallow-empty-environment-values-again.patch
https://github.com/msys2/MSYS2-packages/blob/c98a0dd857f83e3b78ddac86688ae64d262d57fb/msys2-runtime/0032-build_env-respect-the-MSYS-environment-variable.patch