1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00
Commit Graph

65 Commits

Author SHA1 Message Date
Viktor Szakats
784446b6c5 build: add support for clang-cl, add CI job
- ci/appveyor: add clang-cl job.
- ci/appvayor: optimize setting an env.
- build: fix clang-cl builds.
- build: fix `-Wcast-function-type` compiler warnings for OpenSSL 3.
- build: use `stdint.h` with MSVC when supported.
- src: use `PRId64` for MSVC where supported.
- src: avoid recursive macro definition for `recv()` and `send()`.
- session: silence `-Wcast-function-type` for `libssh2_session_callback_set2()`.
  Sadly this function is still not fully warning-clean, and it
  seems we'd need separate setter-getters for each callback
  to avoid all warnings.

Closes #1484
2025-01-31 05:13:18 +01:00
Viktor Szakats
df2b206cd0 ci/appveyor: fix PowerShell warning (#1514)
in WinCNG builds, e.g. VS2015, WinCNG, x86, Server 2016:
```
Test-Path : Cannot bind argument to parameter 'Path' because it is null.
At line:10 char:16
+   if(Test-Path $env:OPENSSL_ROOT_DIR) {
+                ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand
```
https://ci.appveyor.com/project/libssh2org/libssh2/builds/51280178/job/9ddtkb91w54si3da#L85
2025-01-07 20:11:55 +01:00
Viktor Szakats
25d3a09207 ci/appveyor: use -A option with all MSVC versions (#1513)
To simplify the initialization. The ` Win64` method was meant for old
CMake versions not in use in CI.

Also pass the `-A` option without a space to make PowerShell pass
the option as expected by CMake.
2025-01-07 18:36:50 +01:00
Viktor Szakats
66f8574ec5 ci/appveyor: fix and bump OpenSSL 3 path, add path check
Follow-up to b5e68bdc37 #1461
Closes #1468
2024-10-04 13:28:04 +02:00
Viktor Szakats
b5e68bdc37 ci/appveyor: reduce test runs (workaround for infrastructure permafails)
Jobs consistently fail to connect to the test server (run in GHA) since
2024-Aug-29:
https://ci.appveyor.com/project/libssh2org/libssh2/builds/50498393

There was an earlier phase of failures one month before that, that got
fixed by increasing the wait for the server in
bf3af90b3f.

Thus, skip running tests in AppVeyor CI jobs, except: After some
experiments, it seems that running tests with the last OpenSSL job and
the last WinCrypt job _work_, which still leaves some coverage.
It remains to be seen how stable this is.

This is meant as a temporary fix till there is a solution to make all
jobs run tests reliable like up until a few months ago.

Closes #1461
2024-10-03 19:13:59 +02:00
Viktor Szakats
bf3af90b3f CI/appveyor: increase wait for SSH server on GHA [ci skip]
Blind attempt to make AppVeyor CI tests work again.
2024-07-30 23:35:32 +02:00
Johannes Passing
3e72343737 wincng: add ECDSA support for host and user authentication (#1315)
The WinCNG backend currently only supports DSA and RSA. This PR
adds ECDSA support for host and user authentication.

* Disable WinCNG ECDSA support by default to maintain backward
  compatibility for projects that target versions below Windows 10.

* Add cmake option `ENABLE_ECDSA_WINCNG` to guard ECDSA support.

* Update AppVeyor job matrix to only enable ECDSA on Server 2016+
2024-04-14 04:19:17 +02:00
Viktor Szakats
1bfae57b55 ci: enable Unity mode for most CMake builds
Ref: 7129ea9ca8 #1034
Closes #1367
2024-04-14 01:54:56 +00:00
Viktor Szakats
53d9c1a658 ci/appveyor: re-enable OpenSSL 3, also bump to 3.2.1 (#1363)
Ref: 104744f4a5 #1348
2024-04-09 18:36:29 +02:00
Viktor Szakats
104744f4a5 ci/appveyor: OpenSSL 3 no longer found by CMake, revert to 1.1.1 (#1348)
Ref: 702e8cdca0
Ref: https://github.com/appveyor/build-images/pull/149
2024-04-03 13:20:43 +02:00
Viktor Szakats
e190e5b269 ci/appveyor: re-enable parallel mode
The comment cited earlier is no longer true with recent CMake versions.
This options does actually enable parallel builds with MSVC since CMake
v3.26.0: https://gitlab.kitware.com/cmake/cmake/-/issues/20564

The effect isn't much for libssh2, because it spends most time in tests,
but let's enable it anyway for efficiency.

Ref: 0d08974633 #884
Ref: 7a039d9a7a #867

Closes #1294
2023-12-21 21:42:02 +00:00
Viktor Szakats
d0a7f1da21 appveyor: delete UWP job broken since Visual Studio upgrade
Few days ago UWP job started permafailing.

fail: https://ci.appveyor.com/project/libssh2org/libssh2/builds/48678129/job/yb8n2pox8mfjwv6m
good: https://ci.appveyor.com/project/libssh2org/libssh2/builds/48673013

Other projects also affected:
https://ci.appveyor.com/project/c-ares/c-ares/builds/48687390/job/l0fo4b0sijvqkw9r

No related local update. Same CMake version. Same CI image.

This seems to be the culprit, which could mean that this update broke
CMake detection, needs a different CMake configuration on our end, or
that this MSVC update pulled support for UWP apps:

fail: -- The C compiler identification is MSVC 19.38.33130.0 (~ Visual Studio 2022 v17.8)
good: -- The C compiler identification is MSVC 19.37.32825.0 (~ Visual Studio 2022 v17.7)

If this is v17.8, release notes don't readily suggest a feature removal:
https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8

So it might just be UWP accidentally broken in this release.

Closes #1275
2023-12-06 14:56:15 +00:00
Viktor Szakats
fc00bdd7f1 cmake: simplify showing CMake version
Move it to `CMakeLists.txt`. Drop `cmake --version` commands.

Credit to the `zlib-ng` project for the idea:
61e181c8ae/CMakeLists.txt (L7)

Closes #1203
2023-10-07 16:56:32 +00:00
Viktor Szakats
06fd721f08 appveyor: YAML/PowerShell formatting, shorten variable name
- use single-quotes in yaml and PowerShell.

- shorten a variable name.

- use indentation 2 for scripts.

- use C else-style in PowerShell.

Closes #1200
2023-10-02 12:41:22 +00:00
Viktor Szakats
d468a33f62 ci: update actions, use shallow clones with appveyor
- update GitHub Actions to their latest versions.

- use shallow git clones in AppVeyor CI to save data over the wire.

Closes #1199
2023-09-30 16:05:00 +00:00
Viktor Szakats
8a081fd98b appveyor: move to pure PowerShell
- replace batch commands with PowerShell.

- merge separate command entries into single PowerShell blocks.

Closes #1197
2023-09-30 06:49:35 +00:00
Viktor Szakats
87f5769b51 cmake: show cmake versions in ci
Cherry-picked from #1175
2023-08-23 10:54:17 +00:00
Viktor Szakats
e61987a3bf tests: formatting and tidy-ups
- Dockerfile: use standard sep with `sed`
- Dockerfile: use single quotes in shell command
- appveyor.yml: use long-form option with `choco`
- tests/cmake: add language to test project
- reuse.yml: fix indentation
  ```
  $ yamllint reuse.yml
  reuse.yml
    [...]
    11:5      error    wrong indentation: expected 6 but found 4  (indentation)
    15:5      error    wrong indentation: expected 6 but found 4  (indentation)
    [...]
    27:5      error    wrong indentation: expected 6 but found 4  (indentation)
  ```

Cherry-picked from #1175
2023-08-23 10:53:53 +00:00
Viktor Szakats
f58f77b5c8 cmake: streamline invocation
Stop specifiying the current directory.
Simplify build instructions.

Closes #1138
2023-07-27 10:49:00 +00:00
Daniel Stenberg
f6aa31f48f provide SPDX identifiers
- All files have prominent copyright and SPDX identifier
- If not embedded in the file, in the .reuse/dep5 file
- All used licenses are in LICENSES/ (not shipped in tarballs)
- A new REUSE CI job verify that all files are OK

Assisted-by: Viktor Szakats

Closes #1084
2023-06-07 08:18:55 +02:00
Viktor Szakats
187d89bb07 copyright: remove years from copyright headers
Also:
- uppercase `(C)`.
- add missing 'All rights reserved.' lines.
- drop duplicate 'Author' lines.
- add copyright headers where missing.
- enable copyright header check in checksrc.

Reasons for deleting years (copied as-is from curl):
- 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

Closes #1082
2023-06-04 19:19:16 +00:00
Viktor Szakats
003fb454c3 tidy-up: avoid exclamations, prefer single quotes, in outputs
Closes #1079
2023-06-03 12:51:56 +00:00
Viktor Szakats
c6e137f7aa ci: add non-static autotools i386 build, ignore GHA updates on AppVeyor
Add a non-static autotools build to GitHub Actions. Make this build
target i386 and libgcrypt, to test a new build combination if we are at
it.

Also:
- GHA: add necessary generic bits for i386 autotools builds.
- AppVeyor CI: teach it to ignore commits updating our GHA config.

Follow-up to 572c57c9d8 #1072
Closes #1074
2023-05-31 15:04:51 +00:00
Viktor Szakats
e7a542da6a add copyright/credits
Closes #1050
2023-05-29 17:07:11 +00:00
Viktor Szakats
c7074ccc9d ci: drop default shared/static configuration options
Both autotools and cmake build both shared and static lib by default.

Ref: 896154bc17

Delete configuration enabling these explicitly in CI jobs.

Cherry-picked from #1036
Closes #1036
2023-05-09 08:14:05 +00:00
Viktor Szakats
86eaec4a1e ci: make one of the AppVeyor CMake jobs shared-only
This build combination did not have a CI test before.

Cherry-picked from #1036
2023-05-08 13:51:06 +00:00
Viktor Szakats
7129ea9ca8 cmake: add and test "unity" builds
"Unity" (aka "jumbo", aka "amalgamation" builds concatenate source files
before compiling. It has these benefits for example: faster builds,
improved code optimization, cleaner code. Let's support and test this.

- enable unity builds for some existing CI builds to test this build
  scenario.
- tune `UNITY_BUILD_BATCH_SIZE` size.
- disable unity build for example and test programs (they use one source
  each already).

You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake.
Supported by CMake 3.16 and newer.

Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html

Closes #1034
2023-05-07 10:03:20 +00:00
Viktor Szakats
1458e28f36 cmake: move CMAKE_VS_GLOBALS setting to CI configs
To not force this setting for local builds where they might serve
a good purpose.

It makes our CI runs slightly faster and we don't need to track
file changes in unattended, single, CI runs.

Cherry-picked from #1031
2023-05-05 01:21:00 +00:00
Viktor Szakats
8d076c0f0c tests: disable sshd tests on Windows via new options
Instead of using hacks inside the build systems.

`SSHD` variable added to GitHub Actions is not currently used.
Added there to make it easy to experiment with these tests and
the path is non-trivial to discover. Using the Windows built-in
sshd server is another option (haven't discovered its path yet).

Cherry-picked from #1017
2023-05-03 15:01:53 +00:00
Viktor Szakats
82ef89611a appveyor: add a UWP OpenSSL 3 build
Cherry-picked from #1017
2023-05-03 01:35:16 +00:00
Viktor Szakats
5ca2d638e8 appveyor: skip before_test when not doing tests
Also merge `before_test` section into `test_script`.

Cherry-picked from #1017
2023-05-03 01:35:16 +00:00
Viktor Szakats
7c98234790 appveyor: wait more for SSH connection from GHA
Cherry-picked from #1017
2023-05-03 01:11:30 +00:00
Viktor Szakats
d93ccf4901 ci: add macOS CI jobs + fix issues revealed
Add macOS CI jobs, both cmake and autotools for all supported crypto
backends (except BoringSSL), with debug, zlib enabled. Without running
tests. It also introduces OpenSSL 1.1 into the CI with a non-MSVC
compiler.

Credits to curl's `macos.yml`, that I used as a base.

Fix these issues uncovered by the new tests:

- openssl: fix warning when built with wolfSSL, or OpenSSL 1.1 and
  earlier. CI missed it because apparently the only OpenSSL 1.1 test
  we had used MSVC, which did not complain.

  ```
  ../src/openssl.c:3852:19: error: variable 'sslError' set but not used [-Werror,-Wunused-but-set-variable]
      unsigned long sslError;
                    ^
  ```

  Regression from 097c8f0dae

- pem: add hack to build without MD5 crypto-backend support.

  The Homebrew wolfSSL build comes with MD5 support disabled. We can
  expect this becoming the norm. FIPS also requires MD5 disabled.

  We deleted the same hack from `hostkey.c` a month ago:
  ad6aae302a

  A better fix would be to guard the MD5 logic with our `LIBSSH2_MD5`
  macro.

  ```
  pem.c:214:32: error: use of undeclared identifier 'MD5_DIGEST_LENGTH'; did you mean 'SHA_DIGEST_LENGTH'?
          unsigned char secret[2*MD5_DIGEST_LENGTH];
                                 ^~~~~~~~~~~~~~~~~
                                 SHA_DIGEST_LENGTH
  ```

  Regression from 386e012292

- `configure.ac`: add crypto libs late.

  Fix it by adding crypto libs to `LIBS` at the end of the configuration
  process.

  Otherwise `configure` links crypto libs while doing feature tests,
  which can cause unwanted detections. For example LibreSSL publishes
  the function `explicit_bzero()`, which masks the system alternative,
  e.g. `memset_s()` on macOS. Then when trying to compile libssh2, its
  declaration is missing:

  ```
  bcrypt_pbkdf.c:93:5: error: implicit declaration of function 'explicit_bzero' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      _libssh2_explicit_zero(ciphertext, sizeof(ciphertext));
      ^
  ../src/misc.h:50:43: note: expanded from macro '_libssh2_explicit_zero'
                                            ^
  ```

  Regression from 4f0f4bff5a

- cmake: fix to list our own include directory before the crypto libs',
  when building tests.

  Otherwise a global crypto header path, such as `/usr/local/include`,
  containing an external `libssh2.h` of a different version, could cause
  weird errors:

  ```
  cc -DHAVE_CONFIG_H -DLIBSSH2_LIBGCRYPT \
    -I../src -I../../src -I/usr/local/include -I[...]/libssh2/include \
    -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk  \
    -mmacosx-version-min=12.6 -MD -MT  \
    tests/CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o \
    -MF CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o.d  \
    -o CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o -c \
    [...]/libssh2/tests/test_aa_warmup.c
  ```

  ```
  [ 62%] Building C object tests/CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o
  In file included from /Users/runner/work/libssh2/libssh2/tests/test_aa_warmup.c:4:
  In file included from /Users/runner/work/libssh2/libssh2/tests/runner.h:42:
  In file included from /Users/runner/work/libssh2/libssh2/tests/session_fixture.h:43:
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:649:5: error: type name requires a specifier or qualifier
      LIBSSH2_AUTHAGENT_FUNC((*authagent));
      ^
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:649:30: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
      LIBSSH2_AUTHAGENT_FUNC((*authagent));
                               ^
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:650:5: error: type name requires a specifier or qualifier
      LIBSSH2_ADD_IDENTITIES_FUNC((*addLocalIdentities));
      ^
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:650:35: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
      LIBSSH2_ADD_IDENTITIES_FUNC((*addLocalIdentities));
                                    ^
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:651:5: error: type name requires a specifier or qualifier
      LIBSSH2_AUTHAGENT_SIGN_FUNC((*agentSignCallback));
      ^
  /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:651:35: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
      LIBSSH2_AUTHAGENT_SIGN_FUNC((*agentSignCallback));
                                    ^
  6 errors generated.
  ```

- `tests/session_fixture.h`: delete duplicate `libssh2.h`,
  `libssh2_priv.h` already includes it.

  Follow-up to a683133dfe

CI logs with these errors:
https://github.com/libssh2/libssh2/actions/runs/4824079094
https://github.com/libssh2/libssh2/actions/runs/4824270819

curl's `macos.yml`: da2470de96/.github/workflows/macos.yml

Tidying-up while here:

- tests/session_fixture.h: delete duplicate `libssh2.h`.
  `libssh2_priv.h` includes it already.

  Follow-up to a683133dfe

- ci.yml: yamllint warnings and formatting.

- ci.yml: msvc section formatting and step-naming sync with macOS.

  Follow-up to f4a4c05dc3

- ci.yml: enable `--enable-werror` for msys2 jobs.

  Follow-up to 71cae949d5

- appveyor.yml: show OpenSSL versions, link to image content.

Closes #1013
2023-04-28 13:59:38 +00:00
Viktor Szakats
fdf824d6f4 ci: reduce algo test runtime on AppVeyor
Make the block count customizable in `test_read` via environment
`FIXTURE_XFER_COUNT`.

Set the custom count lower than the default when running on AppVeyor.

The goal is to reduce CI roundtrip times.

Closes #995
2023-04-22 08:58:57 +00:00
Viktor Szakats
fba0b52b6a ci: add Windows Server 2016 into the test mix
We had Windows Server 2012 R2 (8.1) and Windows Server 2019 (10) before
this patch. After, we also have Windows Server 2016 (10).

The WinCNG flakey tests should have a better chance when running on the
newer OS.

This update does not change the compiler mix.

Also change the test fixture to not use the `--quiet` option with the
`docker pull` commant. This option requires docker v19.03, and
AppVeyor's Visual Studio 2017 image doesn't support it. Log output did
not change without `--quiet`, so it seems safe to delete it. In case
we'd need it, another solution is to retry without `--quiet` if the
command fails. docker's exit status is 125 in that case.

Ref: https://github.com/libssh2/libssh2/issues/804#issuecomment-1515232799
Ref: https://www.appveyor.com/docs/windows-images-software/

Closes #994
2023-04-21 21:12:42 +02:00
Viktor Szakats
e8ceea0c8e ci: enable FIXTURE_TRACE_ALL_CONNECT for WinCNG tests
To hopefully help finding the WinCNG hostkey verification
intermittent failure #804.

Tested in #979
2023-04-19 18:28:07 +00:00
Viktor Szakats
2d0bd5837b ci: really enable logging in AppVeyor CMake builds
`CONFIGURATION` was never passed to the cmake command, so it had
never enabled logging when set to `Debug`.

Also `CONFIGURATION` is ambiguous depending on the "generator" used
by CMake. In case of Visual Studio, this is a build/ctest-time
setting, not a cmake-config parameter.

So set this permanently to `Release` and enable logging via our
dedicated CMake option `ENABLE_DEBUG_LOGGING`.

Tested in #979
2023-04-19 18:27:49 +00:00
Viktor Szakats
01f3fbf01c ci: rename Logging to Debug in AppVeyor 2023-04-17 14:31:54 +00:00
Viktor Szakats
1ccae7d548 ci: use OpenSSL 3 on AppVeyor VS2022 images
Closes #954
2023-04-12 09:17:54 +00:00
Viktor Szakats
2e3e0be816 ci: add MSVS 2008/2010 build tests and fix warnings
Also:

- fix newly surfaced (bogus) warnings in examples with MSVS 2010:

  ```
  ..\..\example\direct_tcpip.c(262): warning C4127: conditional expression is constant
  ```
  Happens for every `FD_SET()` macro reference.

  Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46677835/job/ni4hs97bh18c14ap

- silence MSVS 2010 predefined Windows macro warnings:

  ```
  ..\..\src\wincng.c(867): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
  ..\..\src\wincng.c(897): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
  ..\..\src\wincng.c(1132): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
  ```

  Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46678071/job/08t5ktvkcgdghp7r

Closes #925
2023-04-03 12:08:50 +00:00
Viktor Szakats
d23133b5a3 ci: flatten AppVeyor jobs, add debug builds (#900)
This results in better job names (now including CPU), avoiding the
complex exception rules, and fine-tuning the order and variation of
these tests.

Enable `LIBSSH2DEBUG` for two of the existing jobs.
2023-03-29 22:53:59 +02:00
Viktor Szakats
97417ad37f ci: add VS2022 builds (incl. ARM64) to AppVeyor (#899)
- add MSVS 2022 WinCNG builds for x64 and ARM64,
  replacing MSVS 2013 WinCNG builds for x64 and x86.

- add MSVS 2022 OpenSSL builds for x64.

- fix a compiler warning uncovered by the new ARM64 build:

  ```
  tests\openssh_fixture.c(393,17): warning C4477: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'libssh2_socket_t'
  tests\openssh_fixture.c(393,17): message : consider using '%lld' in the format string
  tests\openssh_fixture.c(393,17): message : consider using '%Id' in the format string
  tests\openssh_fixture.c(393,17): message : consider using '%I64d' in the format string
  ```

- echo the actual CMake command-line.

- cmake: echo the DLL filenames found by the OpenSSL DLL-finder
  heuristics.

- cmake: delete `libcrypto.dll` and `libssl.dll` names from the above
  logic.

  I've added these in 19884e5055. That
  resulted in CMake picking up a rogue `libcrypto.dll` (with no
  `libssl.dll` pair) from `C:\Windows\System32\` on the
  `Visual Studio 2022` image, breaking tests.

  Turns out, OpenSSL v1.0.2 uses the "EAY" names, but let's not re-add
  those either, because CMake mis-picks those up from
  `C:/OpenSSL-Win64/bin/`, even while pointing `OPENSSL_ROOT_DIR` to a
  v1.1.1 installation.

- cmake: set `NO_DEFAULT_PATH` for OpenSSL DLL lookup to avoid picking
  up all kinds of wrong DLLs. CMake considers not the first, but the
  _last_ hit the valid one. This happened to be
  `C:/Program Files/Meson/lib*-1_1.dll` when using the
  `Visual Studio 2022` image.

  Ref: https://cmake.org/cmake/help/latest/command/find_file.html

- cmake: leave two commented debug lines that will be useful next time
  the DLL detection lookup goes wrong.

  Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html

- on error, also dump `CMakeFiles/CMakeConfigureLog.yaml` if it exists
  (requires CMake 3.26 and newer)
2023-03-29 20:23:25 +02:00
Viktor Szakats
0d08974633 ci: drop cmake --parallel (#884)
`--parallel 2` did not seem to make builds faster. Neither did 4 or 6.

Delete this option from both GHA and AppVeyor jobs.

On AppVeyor, with VS, it uses MSBuild under the hood where apparently
`--parallel` doesn't do much [1]. The suggested MSBuild-specific option
`/p:CL_MPcount=2` did not improve build times either.

CMake spends significant time (comparable to building the project
itself) on feature detection, it'd be nice to execute those in parallel,
but I found not such CMake option.

[1] https://discourse.cmake.org/t/parallel-does-not-really-enable-parallel-compiles-with-msbuild/964

Partial revert of 7a039d9a7a
2023-03-27 16:29:00 +02:00
Viktor Szakats
a3d42f41d0 ci: fix cmake warning with AppVeyor WinCNG builds (#883)
```
CMake Warning:
  Manually-specified variables were not used by the project:

    OPENSSL_ROOT_DIR
```

Follow-up to 0834b9bcc8
2023-03-27 11:27:05 +02:00
Viktor Szakats
71cae949d5 ci: cmake ENABLE_WERROR -> ON (#877)
Consider warnings as errors for CMake jobs in CI.
2023-03-27 01:23:55 +02:00
Viktor Szakats
0834b9bcc8 ci: test with OpenSSL v1.1.1 on AppVeyor (#870)
Was: v1.0.2.

Keep using v1.0.2 with the static-only test. To make sure we don't break
support.
2023-03-22 23:09:53 +01:00
Viktor Szakats
1d32ad1ced ci: speed up static-only build tests on AppVeyor (#868)
- limit static-only build to a single platform (x64).

- skip running ctest for the static-only build.

- use MSVS 2013 for static-only builds. It's faster.

- run static-only test before WinCNG ones. Otherwise it's often skipped
  due to WinCNG failures (#804).
2023-03-22 19:43:26 +01:00
Viktor Szakats
7a039d9a7a ci: parallelize more (#867) 2023-03-22 13:52:52 +01:00
Viktor Szakats
61a7d45d24 ci: use static+shared builds to cut number of cmake jobs (#865)
With CMake builds supporting static-shared libssh2 builds in a single
pass, we no longer need to run static and shared jobs separately. For
the same effect it's enough to run builds with both shared and static
builds enabled. Halving CI jobs.

We add an extra run to test the CMake config-path without shared builds
enabled.

This allows to add useful jobs, e.g. MSVS 2022 or ZLIB-enabled builds
for Windows, valgrind builds or other useful stuff, without stretching
CI run times further.

Ref: #863
2023-03-22 11:23:57 +01:00
Viktor Szakats
2ac44a19aa ci: more timeout adjustments (#853)
- add timeout to SSH connection wait loop in AppVeyor test prep.
  (2 minutes)

- switch to per-step timeout for GitHub CI cmake/ctest runs.
  (10 minutes)

  ctest timeout (of 450 seconds) didn't seem to make any difference.
2023-03-17 16:55:48 +01:00