Commit Graph

33989 Commits

Author SHA1 Message Date
Daniel Stenberg
d78e129d50
WebSockets: make support official (non-experimental)
Inverts the configure/cmake options to instead provide options that
disable WebSockets and have them (ws + wss) enabled by default.

Closes #14936
2024-09-27 13:20:25 +02:00
Viktor Szakats
cfae354a9a
codespell: extend checks to more subdirs
- fix issues found.
- fix a few more found locally.

Closes #15072
2024-09-27 10:27:08 +02:00
Viktor Szakats
6b2824dae1
GHA/torture: prefer pip --break-system-packages for speed
Follow-up to c5e3d8ba94 #14972

Closes #15071
2024-09-27 10:27:08 +02:00
Viktor Szakats
fcc89619d9
singleuse: make git grep faster, add Apple nm support
- avoid regexp in grep to make it run faster.
- add support for parsing Apple `nm` output:
  - skip leading underscore from function names.
  - pick object name from output.

Closes #15070
2024-09-27 10:27:08 +02:00
Viktor Szakats
f0f9e2c61f
GHA/http3-linux: add name to align with other Linux workflows
Closes #15069
2024-09-27 10:27:08 +02:00
Daniel Stenberg
1b0da9cfc7
RELEASE-NOTES: synced 2024-09-26 23:52:59 +02:00
Viktor Szakats
44505adb36
GHA/linux: improve cmake use, switch to Ninja
- cmake: allow easy switching of generator (= make tool).
- merge autotools/cmake job steps.
- cmake: switch to Ninja.
  (build was already fast, Ninja doesn't make it noticeably faster)

Closes #15023
2024-09-26 23:43:45 +02:00
Daniel Stenberg
d08d16cac3
multi: avoid reading whole struct pointer from pointer
The proper alignment is not guaranteed. This function now instead uses
only the first and last byte of the key since they are the ones likely
to change most (one of them, depending on CPU endian) and the hash is
tiny anyway.

Closes #15063
2024-09-26 23:37:15 +02:00
Stefan Eissing
6f2a1666a1
tests: use '-4' where needed
Our test servers run either on ipv4 *or* on ipv6, as requested.
A test case using 'localhost' or '*.local' in the url needs to
run with the specific version of the server started.

Otherwise, curl's "happy eyeball"ing will connect to another
server that may be running due to parallel testing or for some
other reasons.

Note that port reuse here depends on the OS strategy and it
seems netbsd is especially likely to hit this.

Closes #15060
2024-09-26 23:36:09 +02:00
Stefan Eissing
841fbdb63c
tests: improve mqtt server handling
Check that the mqtt server process actually is running.
Handle its port number similar to other servers.

Closes #15059
2024-09-26 23:35:13 +02:00
Stefan Eissing
e61c5eb417
tests: check http/2 and http/3 server responsiveness
Check responsiveness of http/3 server when running.

Also, a test case with http/2 or http/3 server requirement
now implicitly drags in a 'http' server and we need no longer
mention that in testdata.

Closes #15058
2024-09-26 23:34:16 +02:00
Stefan Eissing
ef400f4f38
test190: replace %FTPTIME2 with a fixed value
The variable FTPTIME2 may, on a loaded test server, become so
large that the timeout does not happen before the fixed 60 seconds
the server waits.

Closes #15056
2024-09-26 23:33:18 +02:00
Daniel Stenberg
dc284be4cc
tests: remove the %FTPTIME3 variable
Nothing uses it.

Ref: #15056
Closes #15064
2024-09-26 23:25:47 +02:00
Daniel Stenberg
af60bdf4ec
socks_gssapi: switch to dynbuf from buffer with strcpy
Closes #15057
2024-09-26 23:24:14 +02:00
Dan Fandrich
8e9a8dd978 tests: add file: tests with existing files
Windows sometimes has issues when opening the same file twice, so these
test two situations where that could potentially occur.

Reported-by: ralfjunker on github
Ref: #15043
Closes #15045
2024-09-26 10:10:36 -07:00
Daniel Stenberg
dd0405c909
test518: restore valgrind disable
Follow-up to c91c37b6e8

The test does not work well when run with valgrind

Closes #15062
2024-09-26 17:02:09 +02:00
Daniel Stenberg
5d7275d5df
openssl: convert a memcpy to dynbuf use
and avoid an alloc for CN handling unless necessary

Closes #15049
2024-09-26 17:00:43 +02:00
Stefan Eissing
b2dc95540a
test1540: add debug logging
Closes #15055
2024-09-26 16:58:42 +02:00
Stefan Eissing
cbbf4d8ed2
test504: fix handling on pending connect
Test expected a connect to a port no one is listening to immediately
fail. But Windows has its internal retry logic that may fail this.

As fix, multi_perform()/multi_wait() until transfer is done.

Closes #15054
2024-09-26 16:57:51 +02:00
Stefan Eissing
17a7e12e1b
test2502: add libtest debug tracing
Closes #15053
2024-09-26 16:57:13 +02:00
Stefan Eissing
f518982775
testrun: explicitly set proper IP address for stunnel listen/connect
Closes #15051
2024-09-26 16:55:52 +02:00
Gabriel Marin
8289ac1be6
lib/cw-out: initialize 'flush_all' directly
Closes #15044
2024-09-26 16:55:01 +02:00
Stefan Eissing
21fb30b5d1
test1035: convert host name back to utf8 as should be
Follow-up to 0b70b23ef4

Closes #15050
2024-09-26 16:54:03 +02:00
Daniel Stenberg
4e22d7c56a
openssl: remove two strcpy() calls
Closes #15052
2024-09-26 15:51:47 +02:00
Daniel Stenberg
f383a17617
tool_doswin: simplify; remove unused options and strncpy calls
SANITIZE_ALLOW_TRUNCATE and SANITIZE_ALLOW_COLONS were never used by
code, thus only making the code complicated for no good use.

Since nothing should truncate, using strncpy() is wrong.

Two cases of malloc + copy replaced with proper strdup() calls.

Fixup unit test 1604 accordingly.

Closes #15047
2024-09-26 10:45:08 +02:00
Daniel Stenberg
0b70b23ef4
tests: add codeset-utf8 as a feature
To avoid having to use <precheck> for tests that require UTF-8 support.

Closes #15039
2024-09-26 08:44:59 +02:00
Daniel Stenberg
5fb1b64fdd
tests: introduce %CLIENT6IP-NB
This is the %CLIENT6IP variable - but without outmost brackets since
some commmand lines need the address without the brackets. With this
variable we can run three more tests without prechecks.

Closes #15039
2024-09-26 08:44:55 +02:00
Daniel Stenberg
7aa2b4e01f
tests: make precheck for HTTP on 127.0.0.1 into a feature
It can now be required easily in <features> instead of having perl code
in a <precheck>.

Closes #15039
2024-09-26 08:44:45 +02:00
Daniel Stenberg
56183c1d6f
tests: postcheck is now in verify
Also introduce 'notexists' for verifying that directory entries do not
exist after a test. Now an explicit supported feature instead of using
"funny" perl in postcheck.

Closes #15046
2024-09-26 08:43:24 +02:00
Daniel Stenberg
7060b9b082
build: fix cross-compile check for poll with bionic
Since it seems the _POSIX_C_SOURCE "trick" does not work there, the
check does not find poll().

Fixes #15013
Reported-by: vvb2060 on github
Closes #15037
2024-09-25 23:41:17 +02:00
Daniel Stenberg
da94b02372
THANKS: cleanup duplicates 2024-09-25 09:54:09 +02:00
Viktor Szakats
d82f9f965c
build: add pytest targets
It enables running pytests in cmake jobs, regardless of underlying build
tool choice (= makes it work with ninja.)

Also:

- drop pytest logic launching `make` and exiting in case of failure.
  Maybe there is a better way and keep this functionality somehow, bind
  it to a command-line option? make it fail softly?

- GHA/linux: invoke pytest via the build, not directly.

- autotools: add missing dummy runtests targets when cross-compiling.

Closes #15034
2024-09-25 09:25:44 +02:00
Viktor Szakats
ed766751cc
GHA/linux: tidy up msh3 build step
Ninja does not improve msh3 build speed on GHA/linux:
https://github.com/curl/curl/actions/runs/11020206432/job/30604509300

Cherry-picked from #15023
2024-09-25 09:20:52 +02:00
Viktor Szakats
b4cf21b45d
build: clarify CA embed is for curl tool, mark default, improve summary
- say that CA embed is for the curl tool.
- show "no" in summary when there is no CA embed.
- cmake: sync wording.

Closes #15035
2024-09-25 09:10:45 +02:00
Viktor Szakats
73ea09b9ef
GHA/linux: review and prune valgrind use
Valgrind jobs are slow, drop it from jobs where its use is redundant
and/or has limited impact:

- BearSSL: deprecated.
- LibreSSL heimdal with autotools.
  Keep valgrind for the same job with cmake.
- msh3.
- IntelC no-SSL.
  Keep valgrind for IntelC OpenSSL.
- OpenSSL 3.
  All OpenSSL jobs are v3 now, keep valgrind for the `-O3`, and
  libssh2 + sync-resolver variants.

Closes #15020
2024-09-25 09:10:45 +02:00
Viktor Szakats
68a224c291
tidy-up: indentation in autotools sources
Indentation in `configure.ac` and `.m4` files.

Closes #14692
2024-09-25 09:10:45 +02:00
Gabriel Marin
b70e8f4b9b
cleanup: added space around ternary expressions
Closes #14990
2024-09-25 08:02:01 +02:00
Gabriel Marin
b7c9166c4c
test1185: Updated test data with NOSPACEC rule
Closes #14990
2024-09-25 08:01:58 +02:00
Gabriel Marin
cff75acfec
checksrc: Added checks for colon operator in ternary expressions
Closes #14990
2024-09-25 08:01:49 +02:00
Ian Spence
635253caa0
configure: improve help string for some options
Closes #15033
2024-09-24 23:52:49 +02:00
Baruch Siach
8025777917
curl_trc: fix build with verbose messages disabled
Add empty definition of Curl_trc_ws() to fix this following build error:

In file included from sendf.h:29,
                 from ws.c:35:
ws.c: In function 'Curl_ws_accept':
curl_trc.h💯10: error: implicit declaration of function 'Curl_trc_ws'; did you mean 'Curl_trc_ftp'? [-Wimplicit-function-declaration]
  100 |          Curl_trc_ws(data, __VA_ARGS__); } while(0)
      |          ^~~~~~~~~~~
ws.c:779:5: note: in expansion of macro 'CURL_TRC_WS'
  779 |     CURL_TRC_WS(data, "WS, using chunk size %zu", chunk_size);
      |     ^~~~~~~~~~~

Closes #15026
2024-09-24 23:51:20 +02:00
Stefan Eissing
98c7d4b194
multi.c: warn/assert on stall only without timer
Warn/assert about a possibly stalling transfer only when it
has no timeout set.

The assertion triggered in test 1540 on loaded CI sometimes.

Closes #15028
2024-09-24 23:49:04 +02:00
Viktor Szakats
336b8ca54d
GHA/linux: merge AWS-LC workflow
Closes #15031
2024-09-24 16:12:16 +02:00
Viktor Szakats
820afa2b7c
GHA/linux: merge wolfSSL workflow
Add wolfSSL builds to cache.

Also apply -j4 for the valgrind job (was: -j2).

Closes #15030
2024-09-24 14:59:36 +02:00
Viktor Szakats
f6036dead5
build: show if CA bundle to embed was found
Follow-up to 8a3740bc8e #14059
Closes #15027
2024-09-24 13:36:14 +02:00
Viktor Szakats
9b3a7d1e6a
GHA/linux: enable test bundles for cmake jobs
Test build step speed-up (3x): 18s -> 6s

Follow-up to 71cf0d1fca #14772
Closes #15022
2024-09-24 03:19:21 +02:00
Viktor Szakats
4619b4103b
build: fix possible -Wformat-overflow in lib557 with test bundle builds
- lib557: suppress `-Wformat-overflow` warning in source.
  Fixes:
  ```
  lib557.c: In function ‘test_float_formatting’:
  lib557.c:1408:37: error: ‘%*f’ directive output of 2147483648 bytes exceeds ‘INT_MAX’ [-Werror=format-overflow=]
   1408 |   curl_msnprintf(buf, sizeof(buf), "%*f", INT_MIN, 9.1);
        |                                     ^~~
  lib557.c:1408:3: note: ‘curl_msnprintf’ output 2147483649 bytes
   1408 |   curl_msnprintf(buf, sizeof(buf), "%*f", INT_MIN, 9.1);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://app.circleci.com/pipelines/github/curl/curl/10226/workflows/87642ee9-cda6-4916-8206-c82aac5f595e/jobs/107669?invite=true#step-106-40996_46

  The root cause of why this option gets enabled remains undiscovered.

  Reported-by: Daniel Stenberg
  Fixes #15008
  Follow-up to 71cf0d1fca #14772

- build: drop `-Wno-format-overflow` from picky warning list.
  These options only get used with picky warnings enabled.
  Follow-up to 145f87b9e8 #14598

- unit1652: suppress in source (and not rely on picky warnings anymore.)

Closes #15012
2024-09-23 11:52:55 +02:00
Viktor Szakats
954bd90837
CI: improve readability of Circle CI config
- move curl configure commands next to each other.
- re-order configure options to improve readability.
- fold long configure commands.

Closes #15011
2024-09-23 11:52:55 +02:00
Viktor Szakats
d48747b267
GHA/windows: mark 3023, 3024 flaky for mingw-w64 7.3.0 job
They became flaky recently as reported by Testclutch and firsthand
observations. It's curious because it only seems to happen in 7.3.0,
but not in the very similar (except non-Unicode) 9.5.0 job.

We've found no explanation or reason for them so far.

```
test 3023...[HTTPS GET to localhost, first subject alt name matches, CN does not match (Schannel variant)]

 3023: protocol FAILED!
 There was no content at all in the file log/14/server.input.
 Server glitch? Total curl failure? Returned: 7
```
Ref: https://github.com/curl/curl/actions/runs/10871191391/job/30164710777?pr=14918#step:13:4849

```
test 3024...[HTTPS GET to localhost, last subject alt name matches, CN does not match (Schannel variant)]

 3024: protocol FAILED!
 There was no content at all in the file log/8/server.input.
 Server glitch? Total curl failure? Returned: 7
```
Ref: https://github.com/curl/curl/actions/runs/10871191391/job/30164710777?pr=14918#step:13:4713

```
FAIL 3023: 'HTTPS GET to localhost, first subject alt name matches, CN does not match (Schannel variant)' HTTPS, HTTP GET, PEM certificate
FAIL 3024: 'HTTPS GET to localhost, last subject alt name matches, CN does not match (Schannel variant)' HTTPS, HTTP GET, PEM certificate
```
https://github.com/curl/curl/actions/runs/10982991876/job/30491895264?pr=14930#step:14:4914
https://github.com/curl/curl/actions/runs/10871191391/job/30164710777?pr=14918
https://github.com/curl/curl/actions/runs/10841065505/job/30084573629?pr=14859#step:13:5484
https://github.com/curl/curl/actions/runs/10858001821/job/30135376138?pr=14906#step:13:4841

Reported-by: Testclutch
Fixes https://github.com/curl/curl/pull/14905#issuecomment-2350772804
Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-10652044

Closes #15006
2024-09-23 11:52:55 +02:00
Viktor Szakats
7b88bb4443
cmake: make test-ci target skip building dependencies
Make `test-ci` not depend on the `testdeps` target.

`test-ci` is designed to run curl tests in CI. In CI we build all
necessary dependencies explicitly beforehand, and they are always ready
when calling the `test-ci` step. Thus, it isn't necessary to enforce
them via a dependency rule. Dropping it saves redundant work and delay
in CI jobs.

The `testdeps` dependency should not normally be a problem. It's
supposed to be a no-op if those targets are already built. In practice
however, it causes a delay and/or an actual rebuild of those
dependencies depending on generator (= build tool) used and other
factors.

As observed in the GHA/windows workflow, the `testdeps` dependency:

- with Ninja, causes no delay, and no extra work:
  https://github.com/curl/curl/actions/runs/10980099984/job/30485440389#step:25:18

- with GNU Make, caused a re-evaluation of `testdeps` targets,
  but did not actually rebuild them. This re-evaluation took a
  noticeable time (esp. with non-bundled tests):
  https://github.com/curl/curl/actions/runs/10980099984/job/30485440155#step:14:11 (with bundles)
  https://github.com/curl/curl/actions/runs/10973851013/job/30471690331#step:14:11 (w/o bundles)
  verbose: https://github.com/curl/curl/actions/runs/10980506956/job/30486434629#step:14:13

- with MSBuild, caused a re-evaluation of `testdeps` targets, and
  triggered a _rebuild_:
  https://github.com/curl/curl/actions/runs/10980099984/job/30485435968#step:14:19 (with bundles)
  https://github.com/curl/curl/actions/runs/10973851013/job/30471689714#step:14:19 (w/o bundles)
  verbose: https://github.com/curl/curl/actions/runs/10980506956/job/30486436368#step:14:48
  It's suspected that our use of
  `-DCMAKE_VS_GLOBALS=TrackFileAccess=false` in CI is contributing to
  this. This option is supposed to affect incremental builds only. For
  some reason it affects CI builds too, even though they are not
  incremental, and no sources are changed between build steps.
  Reported-by: Aki Sakurai
  Ref: #14999

Notice that `test-*` targets depending on `testdeps` is NOT sufficient
to build everything to run tests, e.g. it misses to build the curl tool,
which is essential. This is also true for autotools' `test-ci` target
which misses to build libcurl and the curl tool.

Perhaps it'd be best to drop `testdeps` as a dependency for _all_
`test-*` targets and make it official to require building dependencies
manually. Alternatively these targets could be fixed to rebuild
everything necessary to run tests.

Closes #15001
2024-09-23 11:52:55 +02:00