Bug 267542 - devel/cargo-c: Fails to build with security/libressl 3.5.x: Crate is only compatible with ..., or LibreSSL through 3.4.1
Summary: devel/cargo-c: Fails to build with security/libressl 3.5.x: Crate is only com...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2022-11-03 14:27 UTC by jakub_lach
Modified: 2022-11-06 08:35 UTC (History)
3 users (show)

See Also:
jbeich: maintainer-feedback+
koobs: maintainer-feedback? (brnrd)
jbeich: merge-quarterly+


Attachments
patch bumping version (345 bytes, patch)
2022-11-03 14:27 UTC, jakub_lach
no flags Details | Diff
0002-devel-cargo-c-Fix-build-with-LibreSSL-3.5 (8.95 KB, patch)
2022-11-05 06:57 UTC, Felix Palmen
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2022-11-03 14:27:56 UTC
Created attachment 237840 [details]
patch bumping version

=====line 1 col 0 lines from top 1 ============================================
  --- stderr
  thread 'main' panicked at '

  This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3.0.0), or LibreSSL                                                                                2.
  through 3.4.1, but a different version of OpenSSL was found. The build is now aborting
  due to this version mismatch.

  ', /usr/obj/usr/ports/devel/cargo-c/work/cargo-c-0.9.8+cargo-0.60/cargo-crates/openssl-sys-0.9.7                                                                      2/build/mai
  stack backtrace:
     0: std::panicking::begin_panic
     1: build_script_main::version_error
     2: build_script_main::validate_headers
     3: build_script_main::main
     4: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
warning: unused return value of `std::mem::replace` that must be used
   --> /usr/obj/usr/ports/devel/cargo-c/work/cargo-c-0.9.8+cargo-0.60/cargo-crates/im-rc-15.0.0/./src/vector/mod.rs:986:13
    |
986 |             replace(self, other);
    |             ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default
    = note: if you don't need the old value, you can just assign the new value directly

warning: `im-rc` (lib) generated 1 warning
*** Error code 101

Stop.
make: stopped in /usr/ports/devel/cargo-c
Comment 1 Jan Beich freebsd_committer freebsd_triage 2022-11-03 14:47:17 UTC
Comment on attachment 237840 [details]
patch bumping version

Looks incomplete compared to https://github.com/sfackler/rust-openssl/commit/ea03bc0200a5
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2022-11-05 06:57:00 UTC
Created attachment 237870 [details]
0002-devel-cargo-c-Fix-build-with-LibreSSL-3.5

Here's a patch backporting the commit mentioned above instead. It's very likely incomplete, so will probably expose *some* wrong runtime behavior. At least it works for me temporarily (until we have new upstream versions).
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-11-05 18:11:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e139a162009b6af2aa039ca33cce5e4b629f55d

commit 4e139a162009b6af2aa039ca33cce5e4b629f55d
Author:     Felix Palmen <zirias@FreeBSD.org>
AuthorDate: 2022-11-04 12:18:51 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-11-05 18:10:39 +0000

    devel/cargo-c: Fix build with LibreSSL 3.5

    PR:             267542

 devel/cargo-c/files/patch-libressl-3.5 (new) | 252 +++++++++++++++++++++++++++
 1 file changed, 252 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-11-05 18:11:52 UTC
A commit in branch 2022Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8026af5b3e55c8f6702965ca3b6b72144c594d2c

commit 8026af5b3e55c8f6702965ca3b6b72144c594d2c
Author:     Felix Palmen <zirias@FreeBSD.org>
AuthorDate: 2022-11-04 12:18:51 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-11-05 18:11:27 +0000

    devel/cargo-c: Fix build with LibreSSL 3.5

    PR:             267542
    (cherry picked from commit 4e139a162009b6af2aa039ca33cce5e4b629f55d)

 devel/cargo-c/files/patch-libressl-3.5 (new) | 252 +++++++++++++++++++++++++++
 1 file changed, 252 insertions(+)
Comment 5 Jan Beich freebsd_committer freebsd_triage 2022-11-05 18:22:11 UTC
Comment on attachment 237870 [details]
0002-devel-cargo-c-Fix-build-with-LibreSSL-3.5

> It's very likely incomplete,

Looks fine as far as backport of that particular commit.

> so will probably expose *some* wrong runtime behavior.

*SSL is mainly used (by bundled cargo) to fetch registry + crates when building outside of ports. Something like the following maybe enough for testing:

$ git clone https://github.com/ImageOptim/libimagequant
$ cd libimagequant
$ cargo cbuild
Comment 6 Jan Beich freebsd_committer freebsd_triage 2022-11-05 18:34:37 UTC
(In reply to Jan Beich from comment #5)
> $ cd libimagequant

Forgot about subdirectory

  $ cd libimagequant/imagequant-sys

Otherwise, build would fail

  $ cargo cbuild                                                                                                                
  Error: CliError { error: Some(none of the selected packages contains these features: capi), exit_code: 101 }

I originally used lewton (doesn't use a subdirectory for capi) as example but switched to libimagequant as it's more popular and depends on fewer crates (faster build).
Comment 7 Felix Palmen freebsd_committer freebsd_triage 2022-11-06 08:35:53 UTC
(In reply to Jan Beich from comment #5)
> Looks fine as far as backport of that particular commit.
Yes, I meant the commit itself is very likely incomplete, at least that's what vishwin told me on IRC, showing some later commits fixing things...

> *SSL is mainly used (by bundled cargo) to fetch registry + crates when
> building outside of ports.
Good to know, I'll give that a test soon!