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

136 Commits

Author SHA1 Message Date
Viktor Szakats
dab48398b9 ci/GHA: show configure logs on failure and other tidy-ups
- dump cmake error log on configure failure. (for cmake 3.26 and newer)
- dump `config.log` on autotools configure failure.
- convert specs filename to Windows format before passing to CMake.
- add missing quotes.

Closes #1403
2024-06-05 14:05:03 +02:00
Viktor Szakats
6f3d3bc8ff ci/GHA: bump parallel jobs to nproc+1
Ref: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

Closes #1402
2024-06-04 23:26:53 +02:00
Viktor Szakats
b8ffa7a56d ci/GHA: show test logs on failure
Closes #1401
2024-05-31 22:34:23 +02:00
Viktor Szakats
50143d5867 ci/GHA: use ubuntu-latest with OmniOS job
It's the same as ubuntu-22.04.

Also update OmniOS package search link.
2024-05-30 12:12:20 +02:00
Viktor Szakats
e44f041805 ci: disable dependency tracking in autotools builds
For better build performance. Dependency tracking causes a build
overhead while compiling to help a subsequent build, but in CI there is
never one and the extra work is discarded.

Closes #1396
2024-05-27 21:41:38 +02:00
Viktor Szakats
e973493f99 mbedtls: fail to compile with v3.6.0 outside CI
A compile-time failure is preferred over an unexpected one at
runtime.

The problem is silenced with a macro in CI and this macro will have
to be added to more platforms when mbedTLS v3.6.0 reaches them.

Follow-up to 2e4c5ec462 #1349
Closes #1393
2024-05-24 19:22:29 +02:00
Viktor Szakats
3b23e039f7 ci/GHA: shell syntax tidy-up
Closes #1390
2024-05-14 14:55:14 +02:00
Viktor Szakats
e980af729f ci/GHA: bump NetBSD/OpenBSD, add NetBSD arm64 job
OpenBSD arm64 jobs were very slow, so skipped that.

Closes #1388
2024-05-11 01:47:29 +02:00
Viktor Szakats
d19b619070 autotools: fix to update LDFLAGS for each detected dependency
autotools lib detection routine failed to extend LDFLAGS for each
detection. This could cause successful detection of a dependency, but
later failing to use it. This did not cause an issue as long as all
dependencies lived under the same prefix, but started breaking on macOS
ARM + Homebrew where this was no longer true for mbedTLS and zlib in
particular.

Follow-up to 844115393b #1381
Follow-up to ae2770de25 #1377
Closes #1384
2024-05-08 23:44:14 +02:00
Viktor Szakats
5953c1f153 ci/GHA: tidy-up wolfSSL autotools config on macOS
Closes #1383
2024-05-08 22:19:54 +02:00
Viktor Szakats
736e3d7d8b ci/GHA: shorter mbedTLS autotools workaround
Follow-up to 844115393b #1381
Closes #1382
2024-05-08 22:13:39 +02:00
Michael Buckley
844115393b ci: fix mbedtls runners on macOS (#1381)
Sets LDFLAGS while configuring the autoconf mbedTLS build for macOS.
2024-05-08 12:23:59 -07:00
Viktor Szakats
ae2770de25 ci/GHA: fix gcrypt with autotools/macOS/Homebrew/ARM64 (#1377)
mbedtls configure fails to detect anything due to this:
```
configure:23101: gcc -o conftest -g -O2 -I/opt/homebrew/include  conftest.c  -lmbedcrypto -lz >&5
ld: library 'mbedcrypto' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2024-04-25 21:12:59 +02:00
Viktor Szakats
499b27ae83 ci/GHA: fix verbose option for autotools jobs (#1376)
Also enable verbose for macOS `make` step.
2024-04-25 17:00:51 +02:00
Viktor Szakats
4fa6921413 ci/GHA: dump config.log on failure for macOS autotools jobs (#1375) 2024-04-25 16:29:49 +02:00
Viktor Szakats
0b64b30b81 ci/GHA: fix autoreconf failure on macOS/Homebrew (#1374)
By manually installing `libtool`.

```
autoreconf -fi
  shell: /bin/bash -e {0}
configure.ac:75: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:76: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: error: /opt/homebrew/Cellar/autoconf/2.72/bin/autoconf failed with exit status: 1
```
Ref: https://github.com/libssh2/libssh2/actions/runs/8833608758/job/24253334557#step:4:1
2024-04-25 15:59:08 +02:00
Viktor Szakats
6128aee0d7 ci/GHA: fixup Homebrew location (for ARM runners) (#1373)
GHA macOS runners became ARM64 machines. Make the Homebrew prefix
dynamic to adapt to these installations.
2024-04-25 15:47:10 +02:00
Viktor Szakats
3f98bfb090 wincng: add to ci/GHA, add ./configure option --enable-ecdsa-wincng
- add `./configure` option `--enable-ecdsa-wincng`

- add WinCNG autotools jobs to GHA.

- enable WinCNG ECDSA in some GHA jobs (both CMake and autotools).

Follow-up to 3e72343737 #1315
Closes #1368
2024-04-14 02:44:38 +00: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
d88b9bcdaf ci: add shellcheck job and script
Add FIXME for OS/400 scripts.

Cherry-picked from #1358
2024-04-10 00:49:55 +00:00
Viktor Szakats
0e458b3781 ci: use a better test timestamp [ci skip]
Mar 27 2024 08:00:00 GMT+0000

Follow-up to 2d765e454d #1360
2024-04-09 14:16:35 +00:00
Viktor Szakats
a86e27e8ae ci: verify build and install from tarball (#1362)
Install verification based on:
28c5ddf13a/scripts/installcheck.sh
2024-04-09 15:17:53 +02:00
Viktor Szakats
7aa6cba038 tidy-up: dir names, command-line [ci skip]
Follow-up to 2d765e454d #1360
2024-04-09 12:53:04 +00:00
Viktor Szakats
2d765e454d ci: add reproducibility test for maketgz (#1360) 2024-04-09 11:47:15 +02:00
Viktor Szakats
fb8ce480df ci/GHA: improve version number in maketgz test
Follow-up to cba7f97506 #1353
2024-04-09 09:14:44 +00:00
Viktor Szakats
cba7f97506 maketgz: set -eu, reproducibility, improve zip, add CI test
- set bash `-eu`.
- fix bash `-eu` issues.
- apply `TZ=UTC` and `LC_ALL=C` for reproducibility.
- sort `.zip` entries for reproducibility.
- zip with `--no-extra` for reproducibliity.
- use maximum zip compression.
- add the gpg sign command-line. Copied from curl.
- add CI test for `maketgz`.

Closes #1353
2024-04-04 16:56:17 +00:00
Viktor Szakats
6f86b196da ci: use Linux runner for BSDs, add arm64 FreeBSD 14 job
- bump cross-platform-actions to 0.23.0.
  Ref: https://github.com/cross-platform-actions/action/releases/tag/v0.23.0

- switch to Linux runners (from macOS) for cross-platform-actions.
  It's significantly faster.

- switch back FreeBSD 14 job to cross-platform-actions.
  Also switch back to default shell.

- add FreeBSD 14 arm64 job.

Closes #1343
2024-03-30 23:45:00 +00:00
Viktor Szakats
dd52300890 ci: use single quotes in yaml [ci skip] 2024-03-30 23:08:57 +00:00
Viktor Szakats
b6e8bdb444 ci: tidy-up job order [ci skip] 2024-03-30 22:49:31 +00:00
Viktor Szakats
576ca7a067 ci: delete flaky FreeBSD 13.2 job
Keep FreeBSD 14.
2024-03-29 11:55:16 +00:00
Viktor Szakats
5e65dd87dd ci: don't parallelize distcheck job
A while ago the `distcheck` CI job became flaky. This continued after
switching to Debian stable (from testing). Try stabilzing it by running
it single-threaded.

Closes #1339
2024-03-28 22:20:00 +00:00
Viktor Szakats
b08cfbc99f ci/gha: review/fixup auto-cancel settings
- use the group expression from `reuse.yml` (via curl).
- add auto-cancel for `ci` and `cifuzz`.
- add auto-cancel to `appveyor_docker`. I'm just guessing here.
  The hope is that it fixes AppVeyor CI runs when re-pushing a PR.
  This frequently caused the freshly pushed session to fail waiting for
  a connection.
- sync group expression in `appveyor_status` with `reuse`.

Closes #1292
2023-12-21 21:41:41 +00:00
Viktor Szakats
46333adfb8 ci: add FreeBSD 14 job, fix issues
- install bash to fix error when running tests:
  ```
  ERROR: test_sshd.test - missing test plan
  ERROR: test_sshd.test - exited with status 127 (command not found?)
  =====================================
  [...]
  # TOTAL: 4
  # PASS:  2
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  0
  # XPASS: 0
  # ERROR: 2
  [...]
  env: bash: No such file or directory
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7133852508/job/19427420687#step:3:3998

- fix sshd issue when running tests:
  ```
    # sshd log:
    #  Server listening on :: port 4711.
    #  Server listening on 0.0.0.0 port 4711.
    #  Authentication refused: bad ownership or modes for file /home/runner/work/libssh2/libssh2/tests/key_rsa.pub
    #  Authentication refused: bad ownership or modes for file /home/runner/work/libssh2/libssh2/tests/openssh_server/authorized_keys
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7134629175/job/19429828342#step:3:4059

Cherry-picked from #1277
Closes #1277
2023-12-08 02:04:18 +00:00
Viktor Szakats
5e0ec99134 ci: add OmniOS job, fix issues
- use GNU Make, to avoid errors:
  ```
  make: Fatal error in reader: Makefile, line 983: Badly formed macro assignment
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7134629175/job/19429838379#step:3:1956

  Caused by `?=` in `Makefile.am`. Fix it just in case.

  ```
  make: Fatal error in reader: Makefile, line 438: Unexpected end of line seen
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7135524843/job/19432451767#step:3:1966

  It's around line 43 in `Makefile.am`, reason undiscovered.

- fix error:
  ```
  ../../src/hostkey.c:1227:44: error: pointer targets in passing argument 5 of '_libssh2_ed25519_sign' differ in signedness [-Werror=pointer-sign]
     1227 |                                  datavec[0].iov_base, datavec[0].iov_len);
          |                                  ~~~~~~~~~~^~~~~~~~~
          |                                            |
          |                                            caddr_t {aka char *}
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7135102832/job/19431233967#step:3:2225

  https://docs.oracle.com/cd/E36784_01/html/E36887/iovec-9s.html

- FIXME: new `-Wsign-conversion` warnings appeared in examples:
  ```
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
    251 |         FD_SET(forwardsock, &fds);
        |         ^~~~~~
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long int' from 'long unsigned int' may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
    259 |         if(rc && FD_ISSET(forwardsock, &fds)) {
        |                  ^~~~~~~~
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
  [...]
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7136086865/job/19433997429#step:3:3450

Cherry-picked from #1277
2023-12-08 02:02:44 +00:00
Viktor Szakats
e051ae343a autotools: delete --disable-tests option, fix CI tests
Originally added to improve build performance by skipping building
tests. But, there seems to be no point in this, because autotools
doesn't build tests by default, unless explicitly invoking
`make check`.

Delete this option from Cygwin and FreeBSD CI tests, where it caused
`make check` to do nothing. Tests are built now, and runtime tests are
too, where supported.

Also disable Docker-based tests for these, and add a missing `make -j3`
for FreeBSD.

Reverts 7483edfada #715

Closes #1271
2023-12-06 00:55:15 +00:00
ren mingshuai
b1414503f5 build: add LIBSSH2_NO_DEPRECATED option (#1266)
The following APIs have been deprecated for over 10 years and
use `LIBSSH2_NO_DEPRECATED` to mark them as deprecated:

libssh2_session_startup()
libssh2_banner_set()
libssh2_channel_receive_window_adjust()
libssh2_channel_handle_extended_data()
libssh2_scp_recv()

Add these options to disable them:
- autotools: `--disable-deprecated`
- cmake: `-DLIBSSH2_NO_DEPRECATED=ON`
- `CPPFLAGS`: `-DLIBSSH2_NO_DEPRECATED`

Fixes #1259
Replaces #1260
Co-authored-by: Viktor Szakats
Closes #1267
2023-12-06 00:14:53 +01:00
Viktor Szakats
c912408809 ci: show compiler in cross/cygwin job names
Tested via #1257
2023-12-01 05:50:12 +00:00
Viktor Szakats
363dcbf449 openssl: use OpenSSL 3 HMAC API, add no-deprecated CI job
- use OpenSSL 3 API when available for HMAC.
  This fixes building with OpenSSL 3 `no-deprecated` builds.

- ensure we support pure OpenSSL 3 API by adding a CI job using
  OpenSSL 3 custom-built with `no-deprecated`.

Follow-up to b0ab005fe7 #1207

Fixes #1235
Closes #1243
2023-11-27 09:41:05 +00:00
Viktor Szakats
66108f02f0 ci: restore lost comment for FreeBSD [ci skip]
Follow-up to eee4e8055a
2023-11-26 12:00:23 +00:00
Viktor Szakats
0c9a8e3590 ci: add OpenBSD (v7.4) job + fix build error in example
- Use CMake, LibreSSL and clang from the base install.

- This uncovered a build error in `example/subsystem_netconf.c`, caused
  by using the `%n` printf mask. This is a security risk and some
  systems (notably OpenBSD) disable this feature.

  Fix it by applying this patch from OpenBSD ports (from 2021-09-11):
  https://cvsweb.openbsd.org/ports/security/libssh2/patches/patch-example_subsystem_netconf_c?rev=1.1&content-type=text/x-cvsweb-markup
  2c5b2f3e94
  "The old code is also broken, as it passes a pointer to a variable
  of a different size (on LP64).  There is no check for truncation,
  but buf[] is 1MB in size."
  Patch-by: naddy

  ```
  /home/runner/work/libssh2/libssh2/example/subsystem_netconf.c:252:17: error: '%n' format specifier support is deactivated and will call abort(3) [-Werror]
        "]]>]]>\n%n", (int *)&len);
                 ~^
  /home/runner/work/libssh2/libssh2/example/subsystem_netconf.c:270:17: error: '%n' format specifier support is deactivated and will call abort(3) [-Werror]
        "]]>]]>\n%n", (int *)&len);
                 ~^
  2 errors generated.
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/6991449778/job/19022024280#step:3:420

Also made tests with arm64, but it takes consistently almost 14m to
finish the job, vs. 2-3m for the native amd64:
https://github.com/libssh2/libssh2/actions/runs/6991648984/job/19022440525
https://github.com/libssh2/libssh2/actions/runs/6991551220/job/19022233651

Cherry-picked from #1250
Closes #1250
2023-11-26 10:16:56 +00:00
Viktor Szakats
65c7a7a55a ci: add NetBSD (v9.3) job
Use CMake, OpenSSL (v1.1) and clang from the base install.

Cherry-picked from #1250
2023-11-26 10:16:01 +00:00
Viktor Szakats
eee4e8055a ci: update and speed up FreeBSD job
- switch to an alternate GitHub action. This one seems (more) actively
  maintained, and runs faster:
  https://github.com/cross-platform-actions/action

- use clang instead of gcc. clang is already present in the base
  install, saving install time and bandwidth.

- stop installing `openssl-quictls` and use the OpenSSL (v1.1) from
  the base system.
  (I'm suspecting that quictls before this patch wasn't detected by
  the build.)
  https://wiki.freebsd.org/OpenSSL

Cherry-picked from #1250
2023-11-26 10:16:01 +00:00
Viktor Szakats
7494881617 ci: use absolute path in CMAKE_INSTALL_PREFIX
To make the installed locations unambiguous in the build logs.

Closes #1247
2023-11-25 11:25:52 +00:00
Viktor Szakats
236e79a115 ci: boost mbedTLS build speed
Build times down to 4 seconds (from 18-20).

Closes #1245
2023-11-25 11:01:00 +00:00
Viktor Szakats
c9dd3566b2 ci: add BoringSSL job (cmake, gcc, amd64)
Closes #1233
2023-11-21 01:42:38 +00:00
Viktor Szakats
fea6664e1b ci: fixup FreeBSD version, bump mbedtls
We haven't been using the FreeBSD version. Also it turns out,
the single version supported is 13.2 at the moment:
  https://github.com/vmactions/freebsd-vm/tree/main/conf

Stop trying to set the version and instead rely on the action
providing the latest supported one automatically.

Follow-up to a7d2a573be

Also:
- add more details to the FreeBSD job description.
- bump mbedtls version while here.

Closes #1217
2023-11-10 16:58:19 +00:00
Viktor Szakats
a7d2a573be ci: add FreeBSD 13.2 job
It runs over Linux via qemu. First two runs were (very) slow, then it
became (much) more performant at just 2x slower than a native Linux
build. Then got slow again, then fast again. Still seems acceptable
for the value this adds.

The build uses autotools and quictls.

Successful builds:
1. https://github.com/libssh2/libssh2/actions/runs/6802676786/job/18496286419 (13m59s, -j3)
2. https://github.com/libssh2/libssh2/actions/runs/6802976375/job/18497243225 (11m5s, -j2)
3. https://github.com/libssh2/libssh2/actions/runs/6803142201/job/18497785049 (3m6s, -j1)
4. https://github.com/libssh2/libssh2/actions/runs/6803194839/job/18497962766 (3m10s, -j2)
5. https://github.com/libssh2/libssh2/actions/runs/6803267201/job/18498208501 (3m13s)
6. https://github.com/libssh2/libssh2/actions/runs/6803510333/job/18498993698 (15m25s)
7. https://github.com/libssh2/libssh2/actions/runs/6813602863/job/18528571057 (3m13s)

Similar solution exists for Solaris (over macOS via VirtualBox), but it
hangs forever at `Waiting for text: solaris console login`:
https://github.com/libssh2/libssh2/actions/runs/6802388128/job/18495391869#step:4:185

Idea taken from LibreSSL.

FIXME: Unrelated, the `distcheck` job became flaky in recent days:
https://github.com/libssh2/libssh2/actions/runs/6802976375/job/18497256437#step:10:536
```
FAIL: test_auth_pubkey_ok_rsa_aes256gcm
```
https://github.com/libssh2/libssh2/actions/runs/6813602863/job/18528588933#step:10:533
```
FAIL: test_read
```

Closes #1215
2023-11-09 15:32:45 +00:00
Viktor Szakats
4348557960 Makefile.mk: delete Windows-focused raw GNU Make build
We recommend using CMake instead. Especially in unity mode, it's faster
and probably more familiar for most. It's also easily portable.

(`Makefile.mk` was also portable, but in practice only usable for
Windows. Other platforms required a manual config header.)

Also:
- migrate `LIBSSH2_NO_*` option CI tests to CMake.
- make MSYS2 CMake builds verbose to show compilation options.

Closes #1204
2023-11-06 21:41:12 +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
5e19044282 ci: mbedtls 3.5.0
v3.5.0 needs extra compiler option for i386 to avoid:
```
#error "Must use `-mpclmul -msse2 -maes` for MBEDTLS_AESNI_C"
```

Closes #1202
2023-10-07 11:02:28 +00:00