I think it would be very wise for Rust ebuild to not depend on Rust binary distribution for building and only fall back to it in the case there is no installed rust or rust-bin packages with previous versions of Rust. Just a minor FR though.
I tried to do that and it's a bit problematic. the main reason is that rust bootstrap has strict requirements on which version to use for initial bootstrap. like 1.35.0 requires exactly 1.34.2 too bootstrap. The restriction can be relaxed a bit in some cases, but not much. This will require us to always keep old versions of rust around to keep portage dependency graph consistent. It not only depends on compiler versions, but on cargo versions as well. this constraint is defined in src/stage0.txt file https://github.com/rust-lang/rust/blob/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/stage0.txt I may introduce a masked use-flag called system-bootstrap which can be unmasked and set to use system-installed rust, but not sure yet. I wasn't actually able to get it to build yet with already installed rust.
Using a local rust might be more pressing, since now I'm getting segfaults from the internally shipped version. I can't build >=rust-1.34 for this reason.
(In reply to Mark Gomersbach from comment #2) > Using a local rust might be more pressing, since now I'm getting segfaults > from the internally shipped version. > I can't build >=rust-1.34 for this reason. Disregard message and sorry for the noise. After strace it turned out to be my virus scanner.
(In reply to Mark Gomersbach from comment #3) > (In reply to Mark Gomersbach from comment #2) > > Using a local rust might be more pressing, since now I'm getting segfaults > > from the internally shipped version. > > I can't build >=rust-1.34 for this reason. > > Disregard message and sorry for the noise. > After strace it turned out to be my virus scanner. probably same as https://bugs.gentoo.org/683856
+1 because I'd like to use Rust on my musl systems (both x86 and arm64). (In reply to Georgy Yakovlev from comment #1) > like 1.35.0 requires exactly 1.34.2 too bootstrap. Seriously? That kind of version sensitivity for *bootstrapping* is ludicrous. Maybe we can (kindly) ask upstream to provide static binaries?
rust upstream provides binaries, even for musl(but it emits static binaries by default). those binaries are used to bootstrap and the bug is about getting rid of it. rust that bootstraps and works on musl is available here https://github.com/smaeul/portage-overlay
system-bootstrap useflag added to rust-1.40.0-r1 please try it out and report any issues you may encounter. likely it'll need some checks pre-emerge to verify it's using correct version selected, but otherwise both rust-bin-1.40.0 and rust-1.40.0-r1 can bootstrap a new copy without downloading tarballs at all. please note due to way we installed rust before dev-lang/rust below 1.40.0-r1 CANNOT be used to bootstrap another compiler (but rust-bin should be fine) rust 1.41.0 (or whatever next version is) should be bootsrap-able with previous one as intended.
(In reply to Georgy Yakovlev from comment #7) > system-bootstrap useflag added to rust-1.40.0-r1 > > please try it out and report any issues you may encounter. > > likely it'll need some checks pre-emerge to verify it's using correct > version selected, but otherwise both rust-bin-1.40.0 and rust-1.40.0-r1 can > bootstrap a new copy without downloading tarballs at all. > > please note due to way we installed rust before dev-lang/rust below > 1.40.0-r1 CANNOT be used to bootstrap another compiler (but rust-bin should > be fine) > > rust 1.41.0 (or whatever next version is) should be bootsrap-able with > previous one as intended. I've tried new ebuild and it fails somewhere around doctest or so (use flag "system-bootstrap" not set, "system-llvm" and "doc" set). Judging by the logs, it looks for static LLVM libraries and can't find them (because there aren't any). 1.40.0 builds fine.
(In reply to Georgy Yakovlev from comment #1) > I tried to do that and it's a bit problematic. > the main reason is that rust bootstrap has strict requirements on which > version to use for initial bootstrap. > > like 1.35.0 requires exactly 1.34.2 too bootstrap. > The restriction can be relaxed a bit in some cases, but not much. This will > require us to always keep old versions of rust around to keep portage > dependency graph consistent. > This was a very special case that isn't the normal state of things. This should definitely work most of the time.
ok hit it today while bumping to 1.41.0 system-llvm and system-bootstrap if used together fails to find some llvm libraries cannot find -lLLVMPowerPCDisassembler /usr/lib/gcc/powerpc64le-unknown-linux-gnu/9.2.0/../../../../powerpc64le-unknown-linux-gnu/bin/ld: cannot find -lLLVMPowerPCAsmParser etc.. but the libraries are clearly present in /usr/lib/llvm/9/lib64/ checking what's going on..
1.41.0 is in the tree, 1.40.0-r1 and rust-bin-1.40.0 can be used to system-bootstap it, internal bootstrap is still supported (USE=-system-bootstrap) should build fine with USE="doc system-llvm system-bootstrap", thanks for reporting the issue, just built it on 2 machines without hitting the llvm lib search path issue.
(In reply to Georgy Yakovlev from comment #10) > ok hit it today while bumping to 1.41.0 > > system-llvm and system-bootstrap if used together fails to find some llvm > libraries > > cannot find -lLLVMPowerPCDisassembler > > /usr/lib/gcc/powerpc64le-unknown-linux-gnu/9.2.0/../../../../powerpc64le- > unknown-linux-gnu/bin/ld: cannot find -lLLVMPowerPCAsmParser > > > etc.. > > but the libraries are clearly present in /usr/lib/llvm/9/lib64/ > > checking what's going on.. It looks for static libraries (*.a), but the ones present are dynamic (*.so).
(In reply to Alex from comment #12) > (In reply to Georgy Yakovlev from comment #10) > > ok hit it today while bumping to 1.41.0 > > > > system-llvm and system-bootstrap if used together fails to find some llvm > > libraries > > > > cannot find -lLLVMPowerPCDisassembler > > > > /usr/lib/gcc/powerpc64le-unknown-linux-gnu/9.2.0/../../../../powerpc64le- > > unknown-linux-gnu/bin/ld: cannot find -lLLVMPowerPCAsmParser > > > > > > etc.. > > > > but the libraries are clearly present in /usr/lib/llvm/9/lib64/ > > > > checking what's going on.. > > It looks for static libraries (*.a), but the ones present are dynamic (*.so). At least on x86_64, that is.
ok getting really close to enabling this by default. all rust versions left in the tree can now do system boostrap. the only 1 thing left to solve is bootstrap compiler check (#706292)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2701fa0f4b3b3a3d971c2274c36b4ea4bce7181 commit e2701fa0f4b3b3a3d971c2274c36b4ea4bce7181 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-09-25 07:26:47 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-09-25 07:37:58 +0000 sys-devel/rust-std: new package, for crossdev #679878 EXPERIMENTAL! Bug: https://bugs.gentoo.org/680652 Bug: https://bugs.gentoo.org/679878 Bug: https://bugs.gentoo.org/689336 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-devel/rust-std/Manifest | 1 + sys-devel/rust-std/metadata.xml | 21 +++++ sys-devel/rust-std/rust-std-1.46.0.ebuild | 146 ++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+)
ok, this is complete. rust-1.47.0 has system-bootstrap flag set by default. but still contains fallback internal bootstrap just in case. it remains stable-masked for now, because of equal visibility requirement and bootstrap constraints. rust requires exactly previous version to bootstrap. but a stable package can never depend on unstable one. so for example, we have versions 1.46.0, 1.47.0 and version 1.48.0, 1.46.0 is stable. but 1.47.0 contains known bugs (it happens) and never got stable keywords on all arches. we can't stabilize 1.48.0 then time comes. well, we can, but to install 1.48.0 rust will pull rust-bin-1.48.0, as it can't pull 1.47.0 on stable system. So it will remain stable-masked for now, but I'll try really hard to keep system-boostrap path stable so there are no gaps in versions. when next stabilization time comes I will consider enabling it for stable users as well. as for cross-compilation, please use bug https://bugs.gentoo.org/679878 to track progress. this bug is only about system-bootstrap. I see no use keeping this bug open, so closing. again, at the time of next stabilization (in about 30 days) I will try enabling it for stable users. and maybe remove internal-bootstrap, as it's direct equivalent of installing rust-bin and using it to bootstrap source version. cheers.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e61ae40fcdeac8948f307c4dff57337e5d79caef commit e61ae40fcdeac8948f307c4dff57337e5d79caef Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-11-26 19:18:46 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-11-26 19:19:32 +0000 dev-lang/rust: don't default to system-bootstrap for now Bug: https://bugs.gentoo.org/689336 Bug: https://bugs.gentoo.org/756793 Package-Manager: Portage-3.0.10, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-lang/rust/rust-1.47.0-r1.ebuild | 2 +- dev-lang/rust/rust-1.47.0-r2.ebuild | 2 +- dev-lang/rust/rust-1.48.0.ebuild | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)