Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 847583 - net-libs/quiche-0.1[34].0: installs non-functional libquiche.so, breaks curl, fwupd, ...
Summary: net-libs/quiche-0.1[34].0: installs non-functional libquiche.so, breaks curl,...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Craig Andrews
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 847451
  Show dependency tree
 
Reported: 2022-05-26 12:22 UTC by Klaus Kusche
Modified: 2024-07-20 11:27 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
quiche build log (file_847583.txt,79.36 KB, text/plain)
2022-05-28 16:31 UTC, Jason Lynch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2022-05-26 12:22:04 UTC
See bug 847451, my comment 8.

This breaks curl, fwupd and several other things,
and it breaks further re-emerges of quiche
(you have to manually remove the lib or install a working backup of the lib
before emerging).
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-27 17:26:39 UTC
Can you try downgrading CMake as you mentioned?
Comment 2 Klaus Kusche 2022-05-27 18:43:13 UTC
(In reply to Sam James from comment #1)
> Can you try downgrading CMake as you mentioned?

Downgrading CMake does not solve the problem,
but downgrading rust from 1.61.0-r1 to 1.60.0 
and re-emerging quiche fixed libquiche.so for me.
Comment 3 Klaus Kusche 2022-05-27 19:04:08 UTC
(In reply to Klaus Kusche from comment #2)
> Downgrading CMake does not solve the problem,
> but downgrading rust from 1.61.0-r1 to 1.60.0 
> and re-emerging quiche fixed libquiche.so for me.

... for both quiche-0.14.0 and -0.13.0, and with cmake-3.23.2 .
Comment 4 Georgy Yakovlev archtester gentoo-dev 2022-05-27 23:05:22 UTC
reproduced with rust-bin-1.61.0

it looks like it fails to properly link boringssl it compiled in.


from rust's changelog we can see:

Previously native static libraries were linked as whole-archive in some cases, but now rustc tries not to use whole-archive unless explicitly requested. This change may result in linking errors in some cases. To fix such errors, native libraries linked from the command line, build scripts, or #[link] attributes need to

    (more common) either be reordered to respect dependencies between them (if a depends on b then a should go first and b second)
    (less common) or be updated to use the +whole-archive modifier.


so basically quiche needs to modify it's code a bit to specify correct linking parameters, and not rely on whole-archive behavior.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-27 23:12:05 UTC
As for the inability to reinstall quiche, that sounds odd, please share logs of it.
Comment 6 Klaus Kusche 2022-05-28 07:23:43 UTC
(In reply to Sam James from comment #5)
> As for the inability to reinstall quiche, that sounds odd, please share logs
> of it.

I no longer have a broken version of quiche around,
and I don't have logs (my /var/portage is a tmpfs),
and I don't want to upgrade rust just to build a broken quiche.

As far as I remember, one of the early phases of emerge failed,
because it used (or tested?) the existing quiche in some way.
I'm not sure if this happened during a same-version emerge
or a downgrade from 0.14.0 to 0.13.0.
Comment 7 Jason Lynch 2022-05-28 16:31:35 UTC
Created attachment 781265 [details]
quiche build log

At least in my case, the problem seems to be that once libquiche is broken, cmake itself becomes broken (if curl is linked against libquiche), meaning curl (and possibly cmake itself) need to be rebuilt once libquiche is fixed/removed. The actual build log is long gone, but I salvaged the attached from my terminal scrollback.
Comment 8 Ionen Wolkens gentoo-dev 2022-05-29 04:15:28 UTC
Simplest would probably be to drop cmake stuff entirely and use the boring crate.

It has the "boringssl-boring-crate" feature for this (adding it to the features list in the ebuild gives a working quiche, albeit that builds it twice without cmake cleanup), the crate is even already in the CRATES="" but was unused.

That's how other packages already handle bssl given most upstreams don't have these extras to build it differently.

Also while experimenting I did run into the same rebuilding error where it was looking at system quiche for some reason, but I haven't really dug into it (maybe dropping cmake will help that too).
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-29 06:33:28 UTC
yeah, looks like cmake itself is using quiche automagically?
Comment 10 Craig Andrews gentoo-dev 2022-06-01 16:55:00 UTC
How's this look?

https://github.com/gentoo/gentoo/pull/25723

I haven't actually seen the problem, but it seems like it should fix it. And using the "boringssl-boring-crate" feature seems cleaner and more maintainable anyways.
Comment 11 Ionen Wolkens gentoo-dev 2022-06-01 18:28:02 UTC
(In reply to Craig Andrews from comment #10)
> How's this look?
> 
> https://github.com/gentoo/gentoo/pull/25723
> 
> I haven't actually seen the problem, but it seems like it should fix it. And
> using the "boringssl-boring-crate" feature seems cleaner and more
> maintainable anyways.
Are you still using stable rust? Need >=rust-1.61 to reproduce (build quiche with it, then try curl with USE=quiche).

PR does fix it for native build, but I'm now realizing build is broken with USE=abi_x86_32 because upstream for boring-ssl crate skips including the 32-bit-toolchain.cmake file in the crate for some reason. May not be that simple after all.
Comment 12 Craig Andrews gentoo-dev 2022-06-01 19:23:19 UTC
> Are you still using stable rust? Need >=rust-1.61 to reproduce (build quiche with it, then try curl with USE=quiche).

I'm using rust 1.61.0.
Comment 13 Craig Andrews gentoo-dev 2022-06-01 19:30:07 UTC
> PR does fix it for native build, but I'm now realizing build is broken with USE=abi_x86_32 because upstream for boring-ssl crate skips including the 32-bit-toolchain.cmake file in the crate for some reason. May not be that simple after all.

I think the crate in question is "boring" (not "boring-ssl"): https://github.com/cloudflare/quiche/blob/0.14.0/quiche/Cargo.toml#L36

Could I trouble you to report the issue? I believe the relevant issue tracker to be https://github.com/cloudflare/boring/issues
Comment 14 Drunkard Zhang 2022-06-27 01:18:45 UTC
I came across the same issues, rebuilding of rust/cmake/quiche and some other packages fails, but after successfully rebuild net-misc/curl, all issues gone. Still not understand why.
Comment 15 Klaus Kusche 2022-08-20 12:28:29 UTC
What's the current status?
Any solutions?

With the latest portage tree, this bug forces a downgrade of cargo-c:
This bug forces rust to <= 1.60,
rust <= 1.60 forces cargo-c to <= 0.9.9,
and cargo-c 0.9.9 has now been removed from the tree,
forcing a downgrade to 0.9.5.