Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 875563 - dev-lang/rust-1.64.0-r1: broken on musl/clang after 2aae4ce71867
Summary: dev-lang/rust-1.64.0-r1: broken on musl/clang after 2aae4ce71867
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard: Workaround applied; needs to copy is_...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-06 06:39 UTC by Evgeniy Khramtsov
Modified: 2022-10-10 11:42 UTC (History)
4 users (show)

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


Attachments
build.log.xz (build.log.xz,57.34 KB, application/x-xz)
2022-10-06 06:40 UTC, Evgeniy Khramtsov
Details
emerge-info.log (emerge-info.log,5.68 KB, text/x-log)
2022-10-06 06:40 UTC, Evgeniy Khramtsov
Details
emerge-pqv.log (emerge-pqv.log,507 bytes, text/x-log)
2022-10-06 06:40 UTC, Evgeniy Khramtsov
Details
environment.log (environment.log,165.71 KB, text/x-log)
2022-10-06 06:41 UTC, Evgeniy Khramtsov
Details
fc974604fdfb -> 28b0e6b360bc *.log diff sans noise (fc974604fdfb-28b0e6b360bc-log.diff,1.40 KB, patch)
2022-10-06 18:41 UTC, Evgeniy Khramtsov
Details | Diff
build.log.xz (28b0e6b360bc) (2build.log.xz,57.23 KB, application/x-xz)
2022-10-06 19:19 UTC, Evgeniy Khramtsov
Details
emerge-info.log (28b0e6b360bc) (2emerge-info.log,5.68 KB, text/x-log)
2022-10-06 19:19 UTC, Evgeniy Khramtsov
Details
emerge-pqv.log (28b0e6b360bc) (2emerge-pqv.log,507 bytes, text/x-log)
2022-10-06 19:19 UTC, Evgeniy Khramtsov
Details
environment.log (28b0e6b360bc) (2environment.log,165.78 KB, text/x-log)
2022-10-06 19:20 UTC, Evgeniy Khramtsov
Details
0001-dev-lang-rust-change-libcxx-detection-method.patch (0001-dev-lang-rust-change-libcxx-detection-method.patch,2.28 KB, patch)
2022-10-06 21:38 UTC, Georgy Yakovlev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeniy Khramtsov 2022-10-06 06:39:29 UTC
See also bugs gentoo org / 875392#c10
(<24 hour Bugzilla are forbidden from posting links, links are adjusted with whitespace to bypass draconian restrictions).

Reproducible: Always

Steps to Reproduce:
export DIR="$(mktemp -d)"
export URL="httpz mirror leaseweb com/gentoo/releases/amd64/autobuilds/20221002T170543Z/stage3-amd64-musl-clang-20221002T170543Z.tar.xz"

curl --http2 --output "$DIR/$(basename "$URL")" "$URL"
curl --http2 --output "$DIR/$(basename "$URL")".asc "$URL".asc

gpg --keyserver hkps: / / keys gentoo org --recv-keys 13EBBDBEDE7A12775DFDB1BABB572E0E2D182910 D99EAC7379A850BCE47DA5F29E6438C817072058
gpg --verify "$DIR/$(basename "$URL")".asc

tar -C "$DIR" -xpf "$DIR/$(basename "$URL")" --xattrs-include='*.*' --numeric-owner
echo "ACCEPT_KEYWORDS=\"~amd64\"" >> "$DIR"/etc/portage/make.conf
echo "MAKEOPTS=\"-j$(nproc)\"" >> "$DIR"/etc/portage/make.conf
cp --dereference /etc/resolv.conf "$DIR"/etc

mount --types proc /proc "$DIR"/proc
mount --rbind /sys "$DIR"/sys
mount --rbind /dev "$DIR"/dev
mount --bind /run "$DIR"/run

mount --bind /var/db/repos "$DIR"/var/db/repos
mount --bind /var/cache/distfiles "$DIR"/var/cache/distfiles
cp -a /etc/portage/repos.conf "$DIR"/etc/portage

chroot "$DIR" /bin/sh
source /etc/profile

emerge -1 portage
emerge -1 =sys-devel/llvm-common-15.0.2 =sys-devel/clang-common-15.0.2 =sys-devel/lld-toolchain-symlinks-15 =sys-devel/llvm-15.0.2 =sys-devel/llvm-toolchain-symlinks-15 sys-libs/compiler-rt-15.0.2 =sys-devel/clang-15.0.2 =sys-devel/clang-toolchain-symlinks-15-r1 =sys-libs/libcxxabi-15.0.2 =sys-libs/libcxx-15.0.2 =sys-devel/clang-runtime-15.0.2 =sys-devel/lld-15.0.2 =sys-libs/llvm-libunwind-15.0.2
source /etc/profile
emerge -1 sys-libs/libcxx
emerge --depclean
emerge rust
Actual Results:  
Build failure.

Expected Results:  
Build pass.

~5 minutes (i7-7700) after x.py reaches Rust LLVM build failure.
see *.toml and use-libcxx, see attached files and Bugzilla post earlier above.

::gentoo is fc974604fdfb (Date:   Wed Oct 5 21:22:23 2022 -0500)
[42]  default/linux/amd64/17.0/musl/clang (exp) *
temp directory assumes dev,exec,suid permissions and no LSM enforcement
Comment 1 Evgeniy Khramtsov 2022-10-06 06:40:27 UTC
Created attachment 821710 [details]
build.log.xz
Comment 2 Evgeniy Khramtsov 2022-10-06 06:40:43 UTC
Created attachment 821713 [details]
emerge-info.log
Comment 3 Evgeniy Khramtsov 2022-10-06 06:40:55 UTC
Created attachment 821716 [details]
emerge-pqv.log
Comment 4 Evgeniy Khramtsov 2022-10-06 06:41:08 UTC
Created attachment 821719 [details]
environment.log
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 16:00:29 UTC
I'm going to do the hack fix first (has_version changing) and then keep the bug open for us to change to copying llvm's link test for robustness, as it'll cover manual /etc/clang config changes, etc.
Comment 6 Larry the Git Cow gentoo-dev 2022-10-06 16:10:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07da00e100b4c9ea0c6c5c790ce0c7d20aa1118f

commit 07da00e100b4c9ea0c6c5c790ce0c7d20aa1118f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-06 16:09:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-06 16:10:39 +0000

    dev-lang/rust: fix has_version default-libcxx test for Clang
    
    We moved the flag to sys-devel/clang-common to prepare for proper
    config file support (which is backported to 15.0.2, although it's
    going to be better in 16.x).
    
    Go for the hack for now, but keep the bug open as we want to
    switch to the proper link test from the LLVM ebuilds.
    
    Bug: https://bugs.gentoo.org/875563
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/rust/rust-1.62.1.ebuild    | 2 +-
 dev-lang/rust/rust-1.63.0-r1.ebuild | 2 +-
 dev-lang/rust/rust-1.64.0-r1.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2022-10-06 16:15:44 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9bfff99769df96416c910d095b414c76386bd02

commit b9bfff99769df96416c910d095b414c76386bd02
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-06 16:14:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-06 16:15:26 +0000

    dev-qt/qtwebengine: fix has_version default-libcxx test for Clang
    
    We moved the flag to sys-devel/clang-common to prepare for proper
    config file support (which is backported to 15.0.2, although it's
    going to be better in 16.x).
    
    Go for the hack for now, but keep the bug open as we want to
    switch to the proper link test from the LLVM ebuilds.
    
    Bug: https://bugs.gentoo.org/875641
    Bug: https://bugs.gentoo.org/875563
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-qt/qtwebengine/qtwebengine-5.15.5_p20220618.ebuild | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Comment 8 Larry the Git Cow gentoo-dev 2022-10-06 16:20:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=4e846acf550c7c510a2ccbd04f546c3baa225789

commit 4e846acf550c7c510a2ccbd04f546c3baa225789
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-06 16:14:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-06 16:20:01 +0000

    dev-qt/qtwebengine: fix has_version default-libcxx test for Clang
    
    We moved the flag to sys-devel/clang-common to prepare for proper
    config file support (which is backported to 15.0.2, although it's
    going to be better in 16.x).
    
    Go for the hack for now, but keep the bug open as we want to
    switch to the proper link test from the LLVM ebuilds.
    
    Bug: https://bugs.gentoo.org/875641
    Bug: https://bugs.gentoo.org/875563
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-qt/qtwebengine/qtwebengine-5.15.6.9999.ebuild | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Comment 9 Evgeniy Khramtsov 2022-10-06 18:41:05 UTC
Created attachment 821821 [details, diff]
fc974604fdfb -> 28b0e6b360bc *.log diff sans noise

(In reply to Larry the Git Cow from comment #6)
> The bug has been referenced in the following commit(s):
> 
> https // gitweb gentoo org/repo/gentoo.git/commit/
> ?id=07da00e100b4c9ea0c6c5c790ce0c7d20aa1118f
> 
> commit 07da00e100b4c9ea0c6c5c790ce0c7d20aa1118f
> Author:     Sam James <sam@gentoo.org>
> AuthorDate: 2022-10-06 16:09:57 +0000
> 
>     dev-lang/rust: fix has_version default-libcxx test for Clang
>     [...]

Thanks. Build still fails in clean chroot with ::gentoo 28b0e6b360bc
https // github com/gentoo/gentoo/commit/28b0e6b360bc

fc974604fdfb -> 28b0e6b360bc *.log diff sans non-determistic build order build.log noise attached.

Condition still evaluates to false, resulting in build failure, unless "use-libcxx" is locally hacked/moved to the outer block inside tc-is-clang for testing.

I can't propose a .patch due to low experience with ebuilds.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 18:55:34 UTC
I may well be missing something, but why does it evaluate to false with clang-common[default-libcxx]?

WWhat is emerge -pvO clang-common for you?
Comment 11 Evgeniy Khramtsov 2022-10-06 18:56:13 UTC
(In reply to Sam James from comment #10)
> I may well be missing something, but why does it evaluate to false with
> clang-common[default-libcxx]?
> 
> WWhat is emerge -pvO clang-common for you?

# emerge -pvO clang-common

These are the packages that would be merged, in order:

[ebuild   R    ] sys-devel/clang-common-15.0.2::gentoo  USE="default-compiler-rt default-libcxx default-lld (llvm-libunwind) -verify-sig" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 19:03:42 UTC
I can't see how that test can possibly fail then. Please provide the logs in full, not just diffs, so I can try to spot the problem.
Comment 13 Evgeniy Khramtsov 2022-10-06 19:19:03 UTC
Created attachment 821824 [details]
build.log.xz (28b0e6b360bc)

Logs obtained via clean environment after executing commands in comment #1.
Comment 14 Evgeniy Khramtsov 2022-10-06 19:19:41 UTC
Created attachment 821827 [details]
emerge-info.log (28b0e6b360bc)
Comment 15 Evgeniy Khramtsov 2022-10-06 19:19:59 UTC
Created attachment 821830 [details]
emerge-pqv.log (28b0e6b360bc)
Comment 16 Evgeniy Khramtsov 2022-10-06 19:20:16 UTC
Created attachment 821833 [details]
environment.log (28b0e6b360bc)
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 19:26:37 UTC
(In reply to Evgeniy Khramtsov from comment #13)
> Created attachment 821824 [details]
> build.log.xz (28b0e6b360bc)
> 
> Logs obtained via clean environment after executing commands in comment #1.

Thanks (I'm building it myself right now too). My guess is maybe tc-is-clang fails for some reason.
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 20:07:58 UTC
Reproduced & investigating.
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-06 20:23:07 UTC
Oh, duh. clang-common isn't slotted.
Comment 20 Georgy Yakovlev archtester gentoo-dev 2022-10-06 21:38:33 UTC
Created attachment 822685 [details, diff]
0001-dev-lang-rust-change-libcxx-detection-method.patch

can you test this?
Comment 21 Larry the Git Cow gentoo-dev 2022-10-06 21:40:58 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e51d85c825d1ad84ff357a038b1eff6411972873

commit e51d85c825d1ad84ff357a038b1eff6411972873
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-06 20:57:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-06 21:40:35 +0000

    dev-lang/rust: fix has_version rust check
    
    Bug: https://bugs.gentoo.org/875563
    Fixes: 07da00e100b4c9ea0c6c5c790ce0c7d20aa1118f
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/rust/rust-1.62.1.ebuild    | 2 +-
 dev-lang/rust/rust-1.63.0-r1.ebuild | 2 +-
 dev-lang/rust/rust-1.64.0-r1.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 22 Larry the Git Cow gentoo-dev 2022-10-06 22:15:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a903ffe027a436e6b391d3233c94c69aaea0a393

commit a903ffe027a436e6b391d3233c94c69aaea0a393
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-10-06 21:32:11 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-10-06 22:14:42 +0000

    dev-lang/rust: change libcxx detection method
    
    Bug: https://bugs.gentoo.org/732632
    Bug: https://bugs.gentoo.org/875563
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/rust-1.64.0-r1.ebuild | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
Comment 23 Georgy Yakovlev archtester gentoo-dev 2022-10-06 22:16:09 UTC
ok no longer need to test attached patch, changes landed to repo.
Comment 24 Larry the Git Cow gentoo-dev 2022-10-06 22:19:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33f9d1b26716280ef7b8644c7c86e0e67ed9d17c

commit 33f9d1b26716280ef7b8644c7c86e0e67ed9d17c
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-10-06 22:18:35 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-10-06 22:18:35 +0000

    dev-lang/rust: backport is_libcxx_linked to older versions
    
    Closes: https://bugs.gentoo.org/875563
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/rust-1.62.1.ebuild    | 24 ++++++++++++++----------
 dev-lang/rust/rust-1.63.0-r1.ebuild | 24 ++++++++++++++----------
 2 files changed, 28 insertions(+), 20 deletions(-)