Skip to content

tests: add --dump-module-paths debug option (Windows) - #23416

Closed
vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:w-dump-modules-for-tests
Closed

vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:w-dump-modules-for-tests

Conversation

@vszakats

@vszakats vszakats commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Extend this undocumented curl tool command-line option to test binaries.
Useful to debug what's actually loaded, e.g. before running tests.

Convert the existing tool_doswin.c function to a macro, move it to
curl_setup.h so that tests can access it. Also make the macro print the
lines directly with a printf function received as an argument. To avoid
code duplication, detect Unicode without the preprocessor to support
both dual Unicode/non-Unicode binaries such as the curl tool, and tests
which are always non-Unicode.

Also:

  • appveyor: show module paths for test binaries in verbose mode.
  • appveyor: fix tests to load the same OpenSSL DLLs as does the curl
    tool.
    Before this patch, they were loading:
    C:\Windows\SYSTEM32\libcrypto-3-x64.dll
    C:\Windows\SYSTEM32\libssl-3-x64.dll
    
    Which may be different from those they were built against, and which
    reside in C:/OpenSSL-v3*/*.dll. Copy the correct DLLs manually next
    to the test binaries, matching what the script is already doing for
    the curl tool.
  • appveyor: add -p option to cp.

Test run: https://ci.appveyor.com/project/curlorg/curl/builds/54903964

Cherry-picked from #23306

@vszakats vszakats added tests Windows Windows-specific labels Oct 15, 2026
@vszakats
vszakats marked this pull request as draft October 15, 2026 12:53
@github-actions github-actions Bot added cmdline tool CI Continuous Integration labels Oct 15, 2026
@vszakats vszakats mentioned this pull request Oct 15, 2026
9 of 10 tasks
@vszakats
vszakats force-pushed the w-dump-modules-for-tests branch from 9ad3d84 to 79fa763 Compare October 15, 2026 13:17
@vszakats
vszakats marked this pull request as ready for review October 15, 2026 13:29
@vszakats
vszakats force-pushed the w-dump-modules-for-tests branch from 34b2578 to 0da0679 Compare October 15, 2026 20:58
@vszakats vszakats closed this in 780405b Oct 16, 2026
@vszakats
vszakats deleted the w-dump-modules-for-tests branch October 16, 2026 00:22
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
vszakats added a commit that referenced this pull request Oct 20, 2026
…()` (Windows)

Seen in gcc-16 builds:
```
lib/curl_setup.h:1109:7: error: using dangling pointer 'path' to 'buffer' [-Werror=dangling-pointer=]
 1109 |       (printf_f)("%s\n", path);                                        \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
src/tool_main.c:165:5: note: in expansion of macro 'CURL_DUMP_MODULE_PATHS'
  165 |     CURL_DUMP_MODULE_PATHS(curl_mprintf);
      |     ^~~~~~~~~~~~~~~~~~~~~~
lib/curl_setup.h:1101:14: note: 'buffer' declared here
 1101 |         char buffer[sizeof(mod.szExePath) * 2];                        \
      |              ^~~~~~
```
Ref: https://github.com/curl/curl-for-win/actions/runs/39414254864/job/118599289585#step:3:6116

Passes in curl-for-win dev CI (combination not build-tested in curl CI):
https://github.com/curl/curl-for-win/actions/runs/39441902215/job/118693711790

Follow-up to 780405b #23416

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

Labels

CI Continuous Integration cmdline tool tests Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

1 participant