Viktor Szakats [Mon, 7 Oct 2024 14:13:32 +0000 (16:13 +0200)]
cmake: detect GNU GSS
Fix to set `HAVE_GSSGNU` when GNU GSS is detected.
Also set the appropriate `pkg-config` dependency and do version
detection for the GNU GSS flavour.
Tested with `pkg-config` and partly tested without. The latter case
picks up everything else but, in my env. This is likely not the last
word to implement this detection correctly for all build-cases.
GNU GSS doesn't seem to have a Homebrew formula and building
it locally needs manual tweaks to make finish successfully.
Also move a MIT-specific header detection into to MIT-specific `if`
branch.
- `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`
are for AmigaOS.
(Note: `./configure` tries to detect these for all targets, cmake does
it only for AmigaOS, to not inflate configure time.)
Viktor Szakats [Sun, 6 Oct 2024 13:41:48 +0000 (15:41 +0200)]
build: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows
Before this patch `setmode()` was not detected with Cygwin/MSYS, because
it's a macro, not a function, and detection is looking for a function.
Switching to symbol detection doesn't work because it mis-detects it on
BSD systems which features a function with the same name but different
functionality and arguments.
Fix it by looking for a `_setmode()` function on Cygwin/MSYS, and use it
if available.
`_setmode()` is recommended over `setmode()` by Windows documentation so
use that on Windows too. It seems to be available on all supported
compilers, so omit detection.
Officially Windows requires argument `_O_BINARY` with an underscore.
`O_BINARY` is also supported but bound to conditions. Continue to use it
for simplicity. Cygwin supports `O_BINARY` (no underscore).
Dan Fandrich [Thu, 26 Sep 2024 18:33:58 +0000 (11:33 -0700)]
CI: run pytype and ruff on Python code
These ensure a more consistent style and can find some errors statically
that would otherwise only be seen at run-time. Also, bump the Ubuntu
version of some other checks to get newer versions of some linters.
Daniel Stenberg [Thu, 3 Oct 2024 21:53:10 +0000 (23:53 +0200)]
asyn-ares: remove typecast, fix expire
- Use the appropriate variable type for the curlx_tvtoms() return code:
timediff_t and remove the typecast.
- Simplify the function and avoid the odd expire adjustment that
probably is a rest from ancient days when the expire function did not
handle zero millisecond timeouts.
Stefan Eissing [Tue, 1 Oct 2024 10:48:46 +0000 (12:48 +0200)]
test1915: add tracing and connect timeout
Since we see Windows fails of 1915, add tracing and a connect timeout.
The test uses a port no one is supposed to listen on, but Windows has
this weird wait logic. So, set a short timeout.
Daniel Stenberg [Thu, 3 Oct 2024 12:37:00 +0000 (14:37 +0200)]
urlapi: normalize the IPv6 address
As the parsing and address "regeneration" are done anyway, we might as
well use the updated version in the result and thereby A) get a
normalized (and lower cased) version of the address and B) avoid a
strcpy().
Stefan Eissing [Thu, 3 Oct 2024 08:51:26 +0000 (10:51 +0200)]
openssl quic: populate x509 store before handshake
Since OpenSSL does its own send/recv internally, we may miss the moment
to populate the x509 store right before the server response. Do it
instead before we start the handshake, at the loss of the time to set
this up.
Stefan Eissing [Thu, 3 Oct 2024 09:10:29 +0000 (11:10 +0200)]
pytest: improve pytest_07_42a reliability
Due to timings on paused response receive, the error code may vary due
to the location where it is detected that the server closed the transfer
prematurely.
Be more lenient in always allowing PARTIAL_FILE as ok.
Daniel Stenberg [Thu, 3 Oct 2024 07:21:45 +0000 (09:21 +0200)]
DEPRECATE: remove hyper in January 2025
Previously this document stated we would do it after February, but now
it will be done already for the first January 2025 release.
The reason being that since we decided to deprecate hyper, the
degradation speed has increased as now no one bothers to fix issues in
the hyper side of things. Also: not a single soul has yet spoken up in
favor of keeping the support.
Viktor Szakats [Wed, 2 Oct 2024 21:20:00 +0000 (23:20 +0200)]
tests: let openssl generate random cert serials
Generate the certificate serial numbers automatically instead of doing
from shell (or Perl earlier).
Fixes intermittent CI failures due to the shell-based random generator
generating the same serial number twice:
```
$ openssl ca -config EdelCurlRoot-ca.cnf -revoke Server-localhost0h-sv.crt
Using configuration from EdelCurlRoot-ca.cnf
ERROR:Already revoked, serial number 66FDB23A
make: *** [../../../tests/certs/Server-localhost0h-sv.pem] Error 1
```
https://github.com/curl/curl/actions/runs/11151401083/job/30994755798?pr=15128#step:10:498
Viktor Szakats [Sat, 28 Sep 2024 18:26:44 +0000 (20:26 +0200)]
tests: simplify `pathhelp.pm`, avoid using external tools
Instead of calling the shell and external tools, rely on Perl functions
like `Cwd::getcwd()`, `Cwd::abs_path()`, `Cygwin::posix_to_win_path()`,
`Cygwin::win_to_posix_path()` to retrieve the current directory and
convert between POSIX and Windows formats.
This adds native Windows Perl support, avoids most failure modes and
makes format guessing and other internal functions unnecessary.
Also:
- delete unused `sys_native_path()`.
- delete redundant `normalize_path()` because Perl `abs_path()` already
does it.
Daniel Stenberg [Tue, 1 Oct 2024 22:01:27 +0000 (00:01 +0200)]
tests: remove debug requirement on 38 tests
For all tests using -O that were previously relying on a debug build and
the CURL_TESTDIR environment variable, use the plain --output-dir option
instead so that they can run proper in non-debug builds.
Viktor Szakats [Tue, 1 Oct 2024 20:16:25 +0000 (22:16 +0200)]
GHA/macos: delete `macos-12` jobs, update matrix for `macos-14`
- Days of `macos-12` are numbered:
https://github.com/actions/runner-images/issues/10721
Drop 5 affected jobs, replaced by `macos-15` ones added earlier today.
- Drop Xcode 14 and 16 from `macos-14` jobs.
Following up upstream announcement:
https://github.com/actions/runner-images/issues/10703
(No active jobs are affected by this.)
Viktor Szakats [Tue, 1 Oct 2024 11:20:09 +0000 (13:20 +0200)]
GHA/macos: Sequoia chores, fixes for llvm 18
- add `macos-15` Sequoia to combinations jobs.
- add `llvm@18` to combinations jobs for `macos-15`.
- fix cmake, autotools configurations for llvm 18.
It requires `CMAKE_OSX_SYSROOT` for cmake, and `--sysroot` within `CC`
for both cmake and autotools.
(Also add `--target` to `CC` for all jobs.)
- stop `brew update` on `macos-12`.
`macos-12` is Monterey. Homebrew stopped providing binaries for it
after the latest macOS was out. It means newer versions of packages
have to be built from source, which is slow and undesired. Try to
avoid it using this trick. If it doesn't work, `macos-12` jobs will
have to be dropped.
Daniel Stenberg [Mon, 30 Sep 2024 21:43:58 +0000 (23:43 +0200)]
select: use poll() if existing, avoid poll() with no sockets
poll() on macOS 10.12 was deemed broken in 2016 when we discovered that
it misbehaves when provided with no sockets to wait for. The
HAVE_POLL_FINE is used to mark a poll() implementation that behaves
correctly: it *should* still wait the timeout time.
curl has therefore opted to use select() on Apple operating systems ever
since. To avoid the risk that this or other breakage cause problems.
However, using select() internally is also bad because it suffers from
problems when using file descriptors beyond 1024.
This change makes poll() used if it is present, but if there is no
sockets to wait for it avoids using poll() and instead falls back to
select() - but without any sockets to wait for there is no 1024 problem.
This removes all previous special-handling involving HAVE_POLL_FINE.
Stefan Eissing [Tue, 1 Oct 2024 09:59:37 +0000 (11:59 +0200)]
ftp: fix 0-length last write on upload from stdin
When uploading FTP with unknown length, we write a last 0-length chunk
with the EOS flag set. OpenSSL's SSL_write() errors on such a write.
Skip writing 0-length data to TLS backends instead.
Viktor Szakats [Mon, 30 Sep 2024 22:41:43 +0000 (00:41 +0200)]
tests: replace hard-coded `/dev/null` with variable
- add variable for the null device filename and use that in Perl code.
- initialize this variable with `NUL` on native Windows.
- add `%DEV_NULL` variable and use it in tests.
Fixes `The system cannot find the path specified.` messages seen when
running `runtests.pl` with native Windows Perl.
Also adjust code to not break mcedit syntax highlighting.
Viktor Szakats [Mon, 30 Sep 2024 21:58:35 +0000 (23:58 +0200)]
tests: add and use `%PERL` variable to refer to the Perl binary
To ensure Perl invocations within tests call the same Perl binary used
for running the tests, as specified or auto-detected via `PERL` env
(autotools) or `PERL_EXECUTABLE` setting (cmake). Instead of the first
`perl` executable found in `PATH`.)
Viktor Szakats [Mon, 30 Sep 2024 11:06:06 +0000 (13:06 +0200)]
cmake: readd `generate-curl.1` dependency for `src` just in case
Trying to fix intermittent build failures with MSVC 2008:
```
unity_0.obj : error LNK2019: unresolved external symbol _showhelp referenced in function _tool_help
unity_0.obj : error LNK2019: unresolved external symbol _hugehelp referenced in function _operate
```
https://ci.appveyor.com/project/curlorg/curl/builds/50700212/job/h3ekljnbccosej5k#L154
https://ci.appveyor.com/project/curlorg/curl/builds/50701615/job/61mkg9og1eooqli8#L155
Viktor Szakats [Mon, 30 Sep 2024 09:11:49 +0000 (11:11 +0200)]
GHA: move Cygwin jobs back into the Windows workflow
Cygwin jobs took 30 minutes and was the reason for moving them to their
own workflow. After recent changes, they finish in 8 minutes, which is
on par or lower than the longest Windows jobs. Thus, Cygwin can now be
moved back to the Windows workflow without causing extra wait for all
the workflow jobs to complete (and allowing a manual retry for the
remaining flaky jobs).
Notice that Cygwin still uses the cygwin/cygwin-install-action action to
install Cygwin itself. This action uses no caching and the time it takes
fluctuates widely depending on mirror speed, congestion and other
things. If Cygwin tends to hold up jobs again for this or other reasons,
this patch may be reverted.
Viktor Szakats [Sun, 29 Sep 2024 10:23:01 +0000 (12:23 +0200)]
GHA/cygwin, msys: move tests to cmake jobs, to finish faster
Move test runs from autotools jobs to cmake ones for Cygwin and MSYS.
This makes producing test results and finishing the workflows faster,
because the cmake build steps are much faster than autotools in these
envs.
Also:
- drop building examples with Cygwin autotools. It takes almost
4 minutes. Keep building them with cmake, taking 20 seconds.
- drop building examples in MSYS autotools jobs that run tests.
Keep building them in autotools jobs without tests. It makes
the longest running job 2 minutes shorter.
After this patch Cygwin job times are on par with or lower than Windows
ones. It means Cygwin doesn't cause extra delay to finish the whole
workflow, allowing to re-merge these jobs into the Windows workflow.
Viktor Szakats [Sat, 28 Sep 2024 10:23:48 +0000 (12:23 +0200)]
ci: tidy-ups
- http3-linux: add newlines for readability.
- http3-linux: use `make pytest` to run pytest.
- checksrc: use `|` multiline to sync with other uses.
- checksrc: prefer `$()`.
- prefer `>-` over `>` for folded option lists.
- cygwin: drop a `grep` no longer necessary.