Open Porkepix opened 4 months ago
What exact command is used for building broot ?
Just cargo build --release
, see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=broot-git#n27
But some build options and environments comes from https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/makepkg.conf?ref_type=heads which is where lto
comes from, but I don't know enough of its internals to explain how does it interact.
I also wanted to do a manual cargo build
while requiring it to do a lto
build, but couldn't find the right options or documentations to do so.
Here's why I don't understand:
I already build for arch with cargo build --release
, you find the result in https://github.com/Canop/broot/releases/tag/v1.36.0
And broot in release mode is always built with the lto option, because of this line: https://github.com/Canop/broot/blob/main/Cargo.toml#L91
All I can say is that, on the advice of people on IRC, broot
as for the two other rust packages I have with similar issues, is back to building fine if I remove/disable using an exclamation mark lto
from this line: https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/makepkg.conf?ref_type=heads#L100
This is also the reason distro builds stable releases by adding that option, as visible here: https://gitlab.archlinux.org/archlinux/packaging/packages/broot/-/blob/main/PKGBUILD?ref_type=heads#L15
If you try to build stable's PKGBUILD but remove this line, you should run into the same issue as me.
When I was looking for ways to reproduce this with only cargo, outside of makepkg
's environment, I wasn't able to find good ways to do it, but seemed to find things about something like two "levels" of lto
, maybemakepkg
is trying to do a more "pushed" one which trigger that issue? (I've honestly no idea, here).
I had a similar issue for this package: https://aur.archlinux.org/packages/zebrad.
The only difference was that the undefined reference was to git_...
Adding
options=(!debug !lto)
to PKGBUILD
resolved it. The package used to work fine without that line before.
Here's someone else with a similar issue: https://bbs.archlinux.org/viewtopic.php?id=294150.
So it looks like the issue is not related to broot
only.
Adding
options=(!debug !lto)
to
PKGBUILD
resolved it. The package used to work fine without that line before.
That line disables lto, so of course it works with it, but it doesn't solve the fact it skips using lto.
EDIT: And yes, I reported the same issue elsewhere. I use at least ten packages like that built with rust, and 3 of them have issues with lto, which seems to comes from crates that doesn't seems to receive updates anymore I think.
I also couldn't reproduce it outside of makepkg
. It's also not clear to me why lto
causes it.
I used to update
broot
to latest commit for quite some time, through ArchLinux's AUR, from https://aur.archlinux.org/packages/broot-git Recently, Arch changed building defaults to enablelto
by default for everything.It caused some of these packages to fail to build under
lto
option, andbroot
is one of them. Stable package got added an option to disable it (https://gitlab.archlinux.org/archlinux/packaging/packages/broot/-/blob/main/PKGBUILD?ref_type=heads#L15) but AUR's didn't as it doesn't seems to get much updates.Anyway, I didn't see any report of the failing build with
lto
so it felt like it's always worth a report, even if it's to explain that it's intended.The build/link errors are the following ones:
I'm not much knowledgeable of the matter, but I'm guessing issue would come from
onig
crate, coming from there: