Summary: | cargo.eclass: RUSTFLAGS merging broken (dev-util/cargo-nextest-0.9.72: fails to compile because it can't merge rustflags) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Benjamin Neff <gentoo> |
Component: | Eclasses | Assignee: | Gentoo Rust Project <rust> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chewi, flow, gentoo, herrtimson, sam, toralf |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 937453 | ||
Attachments: |
emerge --info
build.log |
Description
Benjamin Neff
2024-08-07 00:40:24 UTC
Created attachment 899323 [details]
emerge --info
Created attachment 899324 [details]
build.log
Thanks, already aware of another instance of this. I was able to make it an array easily enough last night, but it seemed like it was then just ignoring our flags. Cargo has is really bad at this all round, but I'll try to work something out. Got one or two more ideas. > but it seemed like it was then just ignoring our flags.
Interesting, when I edited the build.rustflags in .cargo/config.toml manually to be an array (split at spaces), it compiled just fine, and it looked like it used all of them from both files.
(In reply to Benjamin Neff from comment #4) > > but it seemed like it was then just ignoring our flags. > > Interesting, when I edited the build.rustflags in .cargo/config.toml > manually to be an array (split at spaces), it compiled just fine, and it > looked like it used all of them from both files. Yeah, I was testing a different package. It depends on whether the project puts its flags under target-specific config or generic [build] config. I've put together some changes, just getting some feedback now. Fix proposed here: https://marc.info/?l=gentoo-dev&m=172304650421630&w=2 maybe I'm dumb, but where is the patch on the mailing list? can you maybe add it here as well, I'd like to test it and give you feedback. They're in the following messages of that thread. You can also get them here. https://github.com/gentoo/gentoo/compare/master...chewi:gentoo:cargo-rustflags *** Bug 937520 has been marked as a duplicate of this bug. *** thank you, I tested it with cross compile and it now works again (if I set up the linker additionally) - so the cross compile ability is back to its old state. I see one problem: the changes pull in app-misc/yq, which lacks keywords, and app-misc/jq, which lacks stable keywords - this should lead to destabilizing of packages on non amd64/arm64/x86 for librsvg and friends. so maybe app-misc/yq should be keyworded & stabilized before the changes are commited? The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27d469a2114b4ad0b3e682854c50c806753eb472 commit 27d469a2114b4ad0b3e682854c50c806753eb472 Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2024-08-07 14:27:36 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2024-08-08 09:00:08 +0000 cargo.eclass: Change RUSTFLAGS approach following recent build failures Cargo turned out to be even worse at handling flags than I thought. Target-specific flags set by projects were overriding our own, and Cargo was bailing out when faced with merging a string of flags with an array of flags. After weighing up the poor set of options, I've found that it is better to always set flags via a target-specific environment variable for reasons set out in comments added here. This approach was previously just used for cross-compiling, but now we do it unconditionally. It has the downside of overriding generic [build] flags set by projects, but these were already being overridden by users and ebuilds setting RUSTFLAGS themselves. Closes: https://bugs.gentoo.org/937453 Closes: https://bugs.gentoo.org/937470 Signed-off-by: James Le Cuirot <chewi@gentoo.org> eclass/cargo.eclass | 65 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 26 deletions(-) (In reply to tt_1 from comment #10) > so maybe app-misc/yq should be keyworded & stabilized before the changes are > commited? I'm aware, but we're discussing alternative approaches on the mailing list. Python has a built-in toml parser, so I may just use that. In the meantime, I've merged the first commit, which fixes the main issue. The remaining issue is less likely to cause real problems. (In reply to tt_1 from comment #10) > thank you, I tested it with cross compile and it now works again (if I set > up the linker additionally) - so the cross compile ability is back to its > old state. > > I see one problem: the changes pull in app-misc/yq, which lacks keywords, > and app-misc/jq, which lacks stable keywords - this should lead to > destabilizing of packages on non amd64/arm64/x86 for librsvg and friends. > > so maybe app-misc/yq should be keyworded & stabilized before the changes are > commited? That's unavoidable, because the tree would be broken (CI would fail) and the changes wouldn't reach users. So, it makes sense to say it in the sense of "you may want to do that to get on with the process", but not in the sense of "it would lead to loads of stuff being destabled" because that's obviously not going to happen. I guess with the recent changes, the compile of dev-util/cbindgen is broken on musl. Will open a new bug later, once I had enough time to understand it better. *** Bug 937555 has been marked as a duplicate of this bug. *** |