-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Use rustc docker image for x86_64 and i686 linux #1815
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over-all I like this a lot. It feels right to me to be using the same docker image sources everywhere.
@alexcrichton how do you feel about this? I'm guessing positive?
(tentative approval, but I'd like at least one other docker-conversant person to have final approval)
RUN make -j$(nproc) | ||
RUN make install | ||
FROM rust-i686-unknown-linux-gnu | ||
RUN ln /rustroot/bin/gcc /rustroot/bin/cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a nicer, perhaps package-managery way we can have this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no package manager involved here.
Setting environment variable CC=/rustroot/bin/gcc
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, setting CC
env doesn't seem to work. Maybe cc
crate doesn't respect
CC
env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ printenv CC CXX
clang
clang++
CC is set to clang and we still had the build error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the target is explicitly configured: https://github.com/rust-lang/rustup.rs/blob/66c4d10871edc307865db031483f2bd799abbba3/ci/run.sh#L9
So it'd be CC_x86_64-unknown-linux-gnu
for x84_64.
I don't know exact error but if it was the linker then RUSTFLAGS="-C linker=gcc"
would help but this is getting a bit complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is CC_x86_64-unknown-linux-gnu
standard or it's just used by cc crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is
Running `rustc --crate-name semver_parser /src/target/cargo-home/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C codegen-units=1 -C metadata=c7af5d73bcae4fa9 -C extra-filename=-c7af5d73bcae4fa9 --out-dir /src/target/release/deps -L dependency=/src/target/release/deps --cap-lints allow`
error: linker `cc` not found
|
= note: No such file or directory (os error 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is CC_x86_64-unknown-linux-gnu standard or it's just used by cc crate?
As far as I can tell it's used by cc-rs
and Rust's bootstrap.
The error message is
That's the linker error so RUSTFLAGS="-C linker=gcc"
would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think about it: Why does rustc's docker image have no cc
hard link?
It is common that cc
hard link to gcc
on Linux distro.
Blocked by rust-lang/rust#60366 |
build-gcc: Create missing cc hard link This PR mostly fixes build error caused by using rustc docker images to build [rustup][1] (with the error: ``linker `cc` not found``). I don't know why gcc build script doesn't install cc hard link by default. In build log, with `make SHELL='sh -x' install`, gcc build script installs c++ hard link but not `cc` one: ```bash if test "" != "yes" ; then \ rm -f /rustroot/bin/g++; \ /usr/bin/install -c xg++ /rustroot/bin/g++; \ chmod a+x /rustroot/bin/g++; \ rm -f /rustroot/bin/c++; \ ( cd /rustroot/bin && \ ln g++ c++ ); \ if [ -f cc1plus ] ; then \ if [ ! -f g++-cross ] ; then \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \ ( cd /rustroot/bin && \ ln g++ x86_64-unknown-linux-gnu-g++ ); \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \ ( cd /rustroot/bin && \ ln c++ x86_64-unknown-linux-gnu-c++ ); \ fi ; \ fi; \ fi ``` This might be fixed downstream by manually creating cc hard link or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2]. But I find it better to fix it upstream in this PR. [1]: rust-lang/rustup#1815 [2]: rust-lang/rustup#1815 (comment)
build-gcc: Create missing cc symlink This PR mostly fixes build error caused by using rustc docker images to build [rustup][1] (with the error: ``linker `cc` not found``). I don't know why gcc build script doesn't install cc hard link by default. In build log, with `make SHELL='sh -x' install`, gcc build script installs c++ hard link but not `cc` one: ```bash if test "" != "yes" ; then \ rm -f /rustroot/bin/g++; \ /usr/bin/install -c xg++ /rustroot/bin/g++; \ chmod a+x /rustroot/bin/g++; \ rm -f /rustroot/bin/c++; \ ( cd /rustroot/bin && \ ln g++ c++ ); \ if [ -f cc1plus ] ; then \ if [ ! -f g++-cross ] ; then \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \ ( cd /rustroot/bin && \ ln g++ x86_64-unknown-linux-gnu-g++ ); \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \ ( cd /rustroot/bin && \ ln c++ x86_64-unknown-linux-gnu-c++ ); \ fi ; \ fi; \ fi ``` This might be fixed downstream by manually creating cc hard link or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2]. But I find it better to fix it upstream in this PR. [1]: rust-lang/rustup#1815 [2]: rust-lang/rustup#1815 (comment)
build-gcc: Create missing cc symlink This PR mostly fixes build error caused by using rustc docker images to build [rustup][1] (with the error: ``linker `cc` not found``). I don't know why gcc build script doesn't install cc hard link by default. In build log, with `make SHELL='sh -x' install`, gcc build script installs c++ hard link but not `cc` one: ```bash if test "" != "yes" ; then \ rm -f /rustroot/bin/g++; \ /usr/bin/install -c xg++ /rustroot/bin/g++; \ chmod a+x /rustroot/bin/g++; \ rm -f /rustroot/bin/c++; \ ( cd /rustroot/bin && \ ln g++ c++ ); \ if [ -f cc1plus ] ; then \ if [ ! -f g++-cross ] ; then \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \ ( cd /rustroot/bin && \ ln g++ x86_64-unknown-linux-gnu-g++ ); \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \ ( cd /rustroot/bin && \ ln c++ x86_64-unknown-linux-gnu-c++ ); \ fi ; \ fi; \ fi ``` This might be fixed downstream by manually creating cc hard link or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2]. But I find it better to fix it upstream in this PR. [1]: rust-lang/rustup#1815 [2]: rust-lang/rustup#1815 (comment)
build-gcc: Create missing cc symlink This PR mostly fixes build error caused by using rustc docker images to build [rustup][1] (with the error: ``linker `cc` not found``). I don't know why gcc build script doesn't install cc hard link by default. In build log, with `make SHELL='sh -x' install`, gcc build script installs c++ hard link but not `cc` one: ```bash if test "" != "yes" ; then \ rm -f /rustroot/bin/g++; \ /usr/bin/install -c xg++ /rustroot/bin/g++; \ chmod a+x /rustroot/bin/g++; \ rm -f /rustroot/bin/c++; \ ( cd /rustroot/bin && \ ln g++ c++ ); \ if [ -f cc1plus ] ; then \ if [ ! -f g++-cross ] ; then \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \ ( cd /rustroot/bin && \ ln g++ x86_64-unknown-linux-gnu-g++ ); \ rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \ ( cd /rustroot/bin && \ ln c++ x86_64-unknown-linux-gnu-c++ ); \ fi ; \ fi; \ fi ``` This might be fixed downstream by manually creating cc hard link or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2]. But I find it better to fix it upstream in this PR. [1]: rust-lang/rustup#1815 [2]: rust-lang/rustup#1815 (comment)
Ok. Ready to merge 🎉 |
cc @kinnison , @alexcrichton
So the effort of improving CI time is zero for now(#1760)The next PR might be setting up sccache.