Commit Graph

98 Commits

Author SHA1 Message Date
Viktor Szakats
f42a279ee3
cmake: fix unity with Windows Unicode + TrackMemory
Found the root cause of the startup crash in unity builds with Unicode
and TrackMemory enabled at the same time.

We must make sure that the `memdebug.h` header doesn't apply to
`lib/curl_multibyte.c` (as even noted in a comment there.) In unity
builds all headers apply to all sources, including `curl_multibyte.c`.
This probably resulted in an infinite loop on startup.

Exclude this source from unity compilation with TrackMemory enabled,
in both libcurl and curl tool. Enable unity mode for a debug Unicode
CI job to keep it tested. Also delete the earlier workaround that
fully disabled unity for affected builds.

Follow-up to d82b080f63 #12005
Follow-up to 3f8fc25720 #11095

Closes #11928
2023-10-03 09:43:46 +00:00
Viktor Szakats
75078a415d
appveyor: rewrite batch in PowerShell + CI improvements
1. Rewrite in PowerShell:

- rewrite MS-DOS batch build script in PowerShell.
- move some bash operations into native PowerShell.
- fixups for PowerShell insisting on failure when a command outputs
  something to stderr.
- fix to actually run `curl -V` after every build.
  (and exclude ARM64 builds.)
- also say why we skipped `curl -V` if we had to skip.
- fix CMake warnings about unused configuration variables, by adapting
  these dynamically for build cases.
- dedupe OpenSSL path into a variable.
- disable `test1451` failing with a warning anyway due to missing python
  impacket. (after trying and failing to install impacket)
  PowerShell promotes these warnings to errors by PowerShell. We can also
  suppress they wholesale if they start causing issues in the future,
  like we already to with `autoreconf` and `./configure`.

PowerShell is better than MS-DOS batches, so the hope is this makes it
easier to extend and maintain the AppVeyor build logic. POSIX/bash isn't
supported inline by AppVeyor on Windows build machines, but we are okay
to keep it in an external script, so it's also an option.

2. CI improvements:

- enable tests for a "unity" build job.
- speed-up CI initialization by using shallow clones of the curl repo.
- speed-up CMake MSVC jobs with `TrackFileAccess=false`.
- enable parallelism in `VisualStudioSolution` builds.
- display CMake version before builds.
- always show the CPU in job names.
- tell which jobs are build-only in job names.
- move `TESTING:` value next to `DISABLED_TESTS:` in two jobs.
- add `config.log` (autotools) to dumped logs (need to enable manually).

3. Style:

- use single-quotes in YAML like we do in other CI YAML files.
  It also allows to drop quoting characters and lighter to write/read.
  (keep double quotes for PowerShell strings needing expansion.)

Closes #11999
2023-10-02 22:47:23 +00:00
Viktor Szakats
a1d73a6bbf
appveyor: fix yamlint issues, indent
Also:
- use double quotes in all batch if statements.

Closes #11994
2023-09-30 07:05:54 +00:00
Viktor Szakats
69aa8f6de4
appveyor: minor improvements
- run `curl -V` after builds to see if they run and with what features.
  Except for one job where a CRT DLL is missing. And ARM64 which should
  fail, but is silently not launched instead.

- copy libcurl DLL next to curl tool and tests binaries in shared mode.
  This makes it possible to run the tests. (We don't run tests after
  these builds yet.)

- list the DLLs and EXEs present after the builds.

- add `DEBUG` variable for CMake builds to allow disabling it, for
  testing non-debug builds. (currently enabled for all)

- add commented lines that dump CMake configuration logs for debugging
  build/auto-detection issues.

- add gcc version to jobs where missing.

- switch a job to the native MSYS2 mingw-w64 toolchain. This adds gcc 9
  to the build mix.

- make `SHARED=OFF` and `OPENSSL=OFF` defaults global.

- delete a duplicate backslash.

Closes #11976
2023-09-29 18:27:47 +00:00
Viktor Szakats
781242ffa4
cmake: detect TLS-SRP in OpenSSL/wolfSSL/GnuTLS
With new option `CURL_DISABLE_SRP=ON` to force-disable it.
To match existing option and detection logic in autotools.

Also:
- fix detecting GnuTLS.
  We assume `nettle` as a GnuTLS dependency.
- add CMake GnuTLS CI job.
- bump AppVeyor CMake OpenSSL MSVC job to OpenSSL 1.1.1 (from 1.0.2)
  TLS-SRP fails to detect with 1.0.2 due to an OpenSSL header bug.
- fix compiler warning when building with GnuTLS and disabled TLS-SRP.
- fix comment typos, whitespace.

Ref: #11964

Closes #11967
2023-09-28 10:50:56 +00:00
Viktor Szakats
38029101e2
mingw: delete support for legacy mingw.org toolchain
Drop support for "old" / "legacy" / "classic" / "v1" / "mingw32" MinGW:
  https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no llvm/clang
support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:
https://www.mingw-w64.org/  https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/  https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw
(Also available via Linux and macOS package managers.)

Closes #11625
2023-09-23 09:12:57 +00:00
Dan Fandrich
223f601c04 test1056: disable on Windows
This test relies on the IPv6 scope field being ignored when connecting to
ipv6-localhost (i.e. [::1%259999] is treated as [::1]). Maybe this is a bit
dodgy, but it works on all our test platforms except Windows. This
test was disabled manually on all Windows CI builds already, so instead
add an incompatible feature and precheck so it's skipped on Windows
everywhere automatically.
2023-09-13 11:26:08 -07:00
Dan Fandrich
9d6d47099b CI: make Appveyor job names unique
Two otherwise identical mingw-w64 jobs now have their differing compiler
versions mentioned in their names.
2023-06-28 01:07:21 -07:00
Viktor Szakats
3f8fc25720
cmake: add support for "unity" builds
Aka "jumbo" or "amalgamation" builds. It means to compile all sources
per target as a single C source. This is experimental.

You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake.
It requires CMake 3.16 or newer.

It makes builds (much) faster, allows for better optimizations and tends
to promote less ambiguous code.

Also add a new AppVeyor CI job and convert an existing one to use
"unity" mode (one MSVC, one MinGW), and enable it for one macOS CI job.

Fix related issues:
- add missing include guard to `easy_lock.h`.
- rename static variables and functions (and a macro) with names reused
  across sources, or shadowed by local variables.
- add an `#undef` after use.
- add a missing `#undef` before use.
- move internal definitions from `ftp.h` to `ftp.c`.
- `curl_memory.h` fixes to make it work when included repeatedly.
- stop building/linking curlx bits twice for a static-mode curl tool.
  These caused doubly defined symbols in unity builds.
- silence missing extern declarations compiler warning for ` _CRT_glob`.
- fix extern declarations for `tool_freq` and `tool_isVistaOrGreater`.
- fix colliding static symbols in debug mode: `debugtime()` and
  `statename`.
- rename `ssl_backend_data` structure to unique names for each
  TLS-backend, along with the `ssl_connect_data` struct member
  referencing them. This required adding casts for each access.
- add workaround for missing `[P]UNICODE_STRING` types in certain Windows
  builds when compiling `lib/ldap.c`. To support "unity" builds, we had
  to enable `SCHANNEL_USE_BLACKLISTS` for Schannel (a Windows
  `schannel.h` option) _globally_. This caused an indirect inclusion of
  Windows `schannel.h` from `ldap.c` via `winldap.h` to have it enabled
  as well. This requires `[P]UNICODE_STRING` types, which is apperantly
  not defined automatically (as seen with both MSVS and mingw-w64).
  This patch includes `<subauth.h>` to fix it.
  Ref: https://github.com/curl/curl/runs/13987772013
  Ref: https://dev.azure.com/daniel0244/curl/_build/results?buildId=15827&view=logs&jobId=2c9f582d-e278-56b6-4354-f38a4d851906&j=2c9f582d-e278-56b6-4354-f38a4d851906&t=90509b00-34fa-5a81-35d7-5ed9569d331c
- tweak unity builds to compile `lib/memdebug.c` separately in memory
  trace builds to avoid PP confusion.
- force-disable unity for test programs.
- do not compile and link libcurl sources to libtests _twice_ when libcurl
  is built in static mode.

KNOWN ISSUES:
- running tests with unity builds may fail in cases.
- some build configurations/env may not compile in unity mode. E.g.:
  https://ci.appveyor.com/project/curlorg/curl/builds/47230972/job/51wfesgnfuauwl8q#L250

Ref: https://github.com/libssh2/libssh2/issues/1034
Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html
Ref: https://en.wikipedia.org/wiki/Unity_build

Closes #11095
2023-06-07 13:06:08 +00:00
Dan Fandrich
6cfa1a42eb CI: use another glob syntax for matching files on Appveyor
The previous globbing syntax was not matching files recursively in
directories, so try appending a /* to more closely match the examples at
https://www.appveyor.com/docs/how-to/filtering-commits/
2023-04-28 10:31:28 -07:00
Dan Fandrich
fe61f015e5 CI: don't run CI jobs if only another CI was changed
A few paths were missed in the last commit, as well as a job added since
then.

Followup-to 395b9175
2023-04-24 20:46:09 -07:00
Dan Fandrich
395b9175b7 CI: don't run CI jobs if only another CI was changed
Also skip builds on non-Windows platforms when only Windows build files
have changed.

This should reduce the number of useless builds and the associated
waiting time and chance of spurious failures, freeing resources for
new PRs.

Closes #10742
2023-03-11 18:59:45 -08:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Marc Hoersken
9f3d3bfb71
CI: report AppVeyor build status for each job
Also give each job on AppVeyor CI a human-readable name.

This aims to make job and therefore build failures more visible.

Reviewed-by: Marcel Raad
Closes #9769
2022-10-20 20:48:13 +02:00
Viktor Szakats
86f2d8f67f
cmake: set HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID on Windows
`lib/config-win32.h` enables this configuration option unconditionally.
Make it apply to CMake builds as well.

While here, delete a broken check for
`HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` from `CMakeLists.txt`. This came with
the initial commit [1], but did not include the actual verification code
inside `CMake/CurlTests.c`, so it always failed. A later commit [2]
added a second test, for non-Windows platforms.

Enabling this flag causes test 1056 to fail with CMake builds, as they
do with autotools builds. Let's apply the same solution and ignore the
results here as well.

[1] 4c5307b456
[2] aec7c5a87c

Reviewed-by: Daniel Stenberg
Assisted-by: Marcel Raad

Closes #9726
2022-10-14 19:07:16 +00:00
Daniel Stenberg
30035dfde7
appveyor: enable websockets 2022-09-09 15:11:15 +02:00
Marc Hoersken
c5c6e86783
CI/runtests.pl: add param for dedicated curl to talk to APIs
This should make it possible to also report test failures
if our freshly build curl binary is not fully functional.

Reviewed-by: Daniel Stenberg
Closes #9360
2022-08-28 19:18:22 +02:00
Marc Hoersken
52484bf383
CI/appveyor: disable TLS in msys2-native autotools builds
Schannel cannot be used from msys2-native Linux-emulated builds.

Reviewed-by: Marcel Raad
Reviewed-by: Daniel Stenberg

Follow up to #9367
Closes #9370
2022-08-25 23:31:13 +02:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Marcel Raad
a34a8480c8
appveyor: add Cygwin build
Closes https://github.com/curl/curl/pull/8693
2022-04-11 08:27:31 +02:00
Marcel Raad
84be999672
appveyor: only add MSYS2 to PATH where required
Closes https://github.com/curl/curl/pull/8693
2022-04-11 08:27:24 +02:00
Jay Satiro
f7376547bf projects: Update VC version names for VS2017, VS2022
- Rename VC15 -> VC14.10, VC17 -> VC14.30.

The projects directory that holds the pre-generated Visual Studio
project files uses VC<ver> to indicate the MSVC version. At some point
support for Visual Studio 2017 (Visual Studio version 15 which uses MSVC
14.10) was added as VC15. Visual Studio 2022 (Visual Studio version 17
which uses MSVC 14.30) project files were recently added and followed
that same format using VC17.

There is no such MSVC version (yet) as VC15 or VC17.

For VS 2017 for example, the name we use is correct as either VS17,
VS2017, VC14.10. I opted for the latter since we use VC for earlier
versions (eg VC10, VC12, etc).

Ref: https://github.com/curl/curl/pull/8438#issuecomment-1037070192

Closes https://github.com/curl/curl/pull/8447
2022-03-29 03:39:36 -04:00
Philip H
22d33956ec
CI: Do not use buildconf. Instead, just use: autoreconf -fi
Closes #8596
2022-03-15 14:15:35 +01:00
Daniel Stenberg
1fa09990ab
misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
Marcel Raad
c07a71e74f appveyor: use VS 2017 image for the autotools builds
The newer images don't have all required MSYS2 packages.

Fixes https://github.com/curl/curl/issues/8248
Closes https://github.com/curl/curl/pull/8265
2022-01-12 11:10:22 +01:00
Marcel Raad
51df1c8e3e appveyor: update images from VS 2019 to 2022
Closes https://github.com/curl/curl/pull/8265
2022-01-12 11:10:22 +01:00
Daniel Stenberg
9108da2c26
cmake: private identifiers use CURL_ instead of CMAKE_ prefix
Since the 'CMAKE_' prefix is reserved for cmake's own private use.
Ref: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html

Reported-by: Boris Rasin
Fixes #7988
Closes #8044
2021-11-23 08:46:41 +01:00
Marc Hoersken
9121032fe3
CI/runtests.pl: restore -u flag, but remove it from CI runs
This makes it possible to use -u again for local testing,
but removes the flag from CI config files and make targets.

Reviewed-by: Daniel Stenberg

Partially reverts #7841
Closes #7921
2021-10-31 11:28:25 +01:00
Marc Hoersken
74d46aee28
CI: more use of test-ci make target and verbose output
Replace test-nonflaky with test-ci and enable verbose output
in all remaining CIs except Zuul which is customized a lot.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Follow up to #7785
Closes #7832
2021-10-27 12:33:18 +02:00
Marc Hoersken
ab1671cafe
CI/makefiles: introduce dedicated test target
Make it easy to use the same set of test flags
throughout all current and future CI builds.

Reviewed-by: Jay Satiro

Follow up to #7690
Closes #7785
2021-10-08 20:16:15 +02:00
Marc Hoersken
02c9802fd1
CI: align make and test flags in various config files
1. Use Makefile target to run tests in autotools builds on AppVeyor.
2. Disable testing of SCP protocol on native Windows environments.
3. Remove redundant parameters -a -p from target test-nonflaky.
4. Don't use -vc parameter which is reserved for debugging.

Replaces #7591
Closes #7690
2021-09-27 20:59:29 +02:00
Marc Hoersken
60efeb1e0d
runtests: add option -u to error on server unexpectedly alive
Let's try to actually handle the server unexpectedly alive
case by first making them visible on CI builds as failures.

This is needed to detect issues with killing of the test
servers completely including nested process chains with
multiple PIDs per test server (including bash and perl).

On Windows/cygwin platforms this is especially helpful with
debugging PID mixups due to cygwin using its own PID space.

Reviewed-by: Daniel Stenberg
Closes #7180
2021-09-09 21:28:26 +02:00
Daniel Stenberg
e052bbcd57
ci: adapt to configure requiring an explicit TLS choice 2021-04-22 23:19:47 +02:00
Daniel Stenberg
4d2f800677
curl.se: new home
Closes #6172
2020-11-04 23:59:47 +01:00
Daniel Stenberg
96450a1a33
alt-svc: enable by default
Remove CURLALTSVC_IMMEDIATELY, which was never implemented/supported.

alt-svc support in curl is no longer considered experimental

Closes #5868
2020-10-25 23:08:54 +01:00
Daniel Stenberg
e2bcdf557b
CI/appveyor: remove (unused) runtests.pl -b option 2020-10-25 22:58:06 +01:00
Daniel Stenberg
6f8871844c
CI/appveyor: disable test 571 in two cmake builds
...  they're simply too flaky there.

Closes #6119
2020-10-24 23:24:09 +02:00
Sergei Nikulov
d8fffd718b
CI/tests: fix invocation of tests for CMake builds
Update appveyor.yml to set env variable TFLAGS and run tests
Remove curly braces due to CMake error (${TFLAGS} -> $TFLAGS)
Move testdeps build to build step (per review comments)

Reviewed-by: Marc Hörsken

Closes #6066
Fixes #6052
2020-10-14 07:03:55 +02:00
Marcel Raad
5cfb807bba AppVeyor: switch 64-bit Schannel Debug CMake builds to Unicode
The Schannel builds are the most useful to verify as they make the most
use of the Windows API. Classic MinGW doesn't support Unicode at all,
only MinGW-w64 and MSVC do.

Closes https://github.com/curl/curl/pull/5843
2020-08-29 10:01:22 +02:00
Daniel Stenberg
2429f45a97
TLS naming: fix more Winssl and Darwinssl leftovers
The CMake option is now called CMAKE_USE_SCHANNEL

The winbuild flag is USE_SCHANNEL

The CI jobs and build scripts only use the new names and the new name
options

Tests now require 'Schannel' (when necessary)

Closes #5795
2020-08-08 00:19:21 +02:00
Marc Hoersken
35fa07c84b
appveyor: collect libcurl.dll variants with prefix or suffix
On some platforms libcurl is build with a platform-specific
prefix and/or a version number suffix.

Assisted-by: Jay Satiro

Closes #5659
2020-07-13 21:00:39 +02:00
Daniel Stenberg
eab2f95c0d
wording: avoid blacklist/whitelist stereotypes
Instead of discussing if there's value or meaning (implied or not) in
the colors, let's use words without the same possibly negative
associations.

Closes #5546
2020-06-10 08:49:17 +02:00
Marc Hoersken
bbaef1a042
appveyor: add non-debug plain autotools-based build
This should enable us to catch linking issues with the
testsuite early, like the one described/fixed in #5475.

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad

Closes #5477
2020-05-30 09:46:04 +02:00
Marc Hoersken
cffbcc3110
test1238: avoid tftpd being busy for tests shortly following
The tftpd server may still be busy if the total timeout of
25 seconds has not been reached or no sread error was received
during or after the execution of the timeout test 1238.

Once the next TFTP test comes around (eg. 1242 or 1243),
those will fail because the tftpd server is still waiting
on data from curl due to the UDP protocol being stateless
and having no connection close. On Linux this error may not
happen, because ICMP errors generated due to a swrite error
can also be returned async on the next sread call instead.

Therefore we will now just kill the tftpd server after test
1238 to make sure that the following tests are not affected.

This enables us to no longer ignore tests 1242, 1243, 2002
and 2003 on the CI platforms CirrusCI and AppVeyor.

Assisted-by: Peter Wu
Closes #5364
2020-05-11 19:59:19 +02:00
Marc Hoersken
54fa68bf44
appveyor: update comments to be clear about toolchain
- CMake-based MSYS builds use mingw-w64 to cross-compile.
- autotools-based builds are compiled using msys2-devel.

The difference is that the later ones are not cross-compiled
to Windows and instead require the msys2 runtime to be present.

At the moment only the Azure Pipelines CI builds actually
run autotools-based cross-compilation builds for Windows.
2020-05-09 18:04:38 +02:00
Marc Hoersken
7ae8801901
appveyor: disable test 1139 instead of ignoring it
Spending time on manpage checking makes no sense
for these builds due to lacking manpage support.
2020-05-07 06:51:22 +02:00
Marc Hoersken
4fdb2005a2
appveyor: disable flaky test 1501 and ignore broken 1056
Test 1501 is flaky on Windows CI due to being time sensitive
and the testsuite relying on taskkill.exe to check for the
existance of processes which can take to much time itself.

Test 1056 is broken in autotools-based Windows builds due
to scope ID support missing in these builds at the moment.
2020-05-07 06:45:26 +02:00
Marcel Raad
9c703ead36
appveyor: add Unicode winbuild jobs
These are cheap as they don't build tests.

Closes https://github.com/curl/curl/pull/5063
2020-04-17 21:50:34 +02:00
Marc Hoersken
93772465b8
appveyor: completely disable tests that fail to timeout early
The tests changed from ignored to disabled are tests that are
about connecting to non-listening socket. On AppVeyor these
tests are not reliable, because for some unknown reason the
connect is not timing out before the test time limit is reached.
2020-04-13 19:35:30 +02:00
Marc Hoersken
3e36af2cfa
appveyor: partially revert 3413a110 to keep build without proxy
Ref: #5211 and #4526
Reported-by: Marcel Raad
2020-04-10 21:01:19 +02:00