Skip to content
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

rustbuild: stdlib not installed for 2nd target triple #39235

Closed
xi2 opened this issue Jan 22, 2017 · 4 comments
Closed

rustbuild: stdlib not installed for 2nd target triple #39235

xi2 opened this issue Jan 22, 2017 · 4 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@xi2
Copy link

xi2 commented Jan 22, 2017

Hi. I am testing out rust 1.15.0 beta and I came across a problem installing from source:

OS

Debian GNU/Linux 8 x86_64

Rust version

10893a9 (1.15.0-beta.5)

Actions

$ ./configure \
    --prefix=$HOME/rust \
    --enable-local-rust \
    --local-rust-root=$SNAPSHOT \
    --disable-rpath \
    --disable-manage-submodules \
    --target=x86_64-unknown-linux-gnu,i686-unknown-linux-gnu \
    --enable-vendor \
    --release-channel=beta
$ make
$ make install

Expected outcome

x86_64-unknown-linux-gnu and i686-unknown-linux-gnu directories in $HOME/rust/lib/rustlib.

Actual outcome

Only the x86_64-unknown-linux-gnu directory is present.

I am new to rust (just a couple of days) so forgive me if I've overlooked something. I'm pretty sure I installed 1.14.0 similarly and i686-unknown-linux-gnu was installed OK. That was using the old makefiles-based build system.

@sfackler sfackler added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 22, 2017
@alexcrichton
Copy link
Member

IIRC this hasn't ever worked, but would be a great bug to fix with rustbuild!

@sezaru
Copy link

sezaru commented Mar 11, 2017

I've made a fix to this issue, you just need to apply this patch:

diff -ruN rustc-1.15.1-src/src/bootstrap/install.rs rustc-1.15.1-src_new/src/bootstrap/install.rs
--- rustc-1.15.1-src/src/bootstrap/install.rs	2017-02-09 01:37:48.000000000 +0000
+++ rustc-1.15.1-src_new/src/bootstrap/install.rs	2017-03-11 02:06:21.676817872 +0000
@@ -37,6 +37,12 @@
         install_sh(&build, "docs", "rust-docs", stage, host, prefix,
                    &docdir, &libdir, &mandir, &empty_dir);
     }
+    
+    for target in build.config.target.iter().filter(|target| *target != host) {
+        install_sh(&build, "std", "rust-std", stage, target, prefix,
+                   &docdir, &libdir, &mandir, &empty_dir);
+    }
+
     install_sh(&build, "std", "rust-std", stage, host, prefix,
                &docdir, &libdir, &mandir, &empty_dir);
     install_sh(&build, "rustc", "rustc", stage, host, prefix,

This will check the build structure for the targets provided on the configure stage, it will then remove any target that is equal to the host (since the host rustlibs will already be installed) and call the install function on it resulting in the installation of all the rustlibs for all the targets.

I don't know if this is the best approach or if there is some case that will fail and I'm not aware.

But, if it is a ok patch, can we apply it to the next version of rust since it seems that this is a major problem for a lot of users (at least for me it is since I'm trying to make the rust ebuild for gentoo support multiple targets and this bug is just what is preventing me).

Thanks

@alexcrichton
Copy link
Member

@sezaru looks like a great start to me, you're more than welcome to send a PR!

I think that we'llalso want to update step.rs for the new dependencies, but other than that look great to me.

alexcrichton pushed a commit to sezaru/rust that referenced this issue Apr 5, 2017
When the user select more than one target to generate rustlibs for, rustbuild will only install the host one.

This patch fixes it, more info in rust-lang#39235 (comment)
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 5, 2017
Fixes other targets rustlibs installation

When the user select more than one target to generate rustlibs for, rustbuild will only install the host one.

This patch fixes it, more info in rust-lang#39235 (comment)
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 5, 2017
Fixes other targets rustlibs installation

When the user select more than one target to generate rustlibs for, rustbuild will only install the host one.

This patch fixes it, more info in rust-lang#39235 (comment)
@Mark-Simulacrum
Copy link
Member

I believe this is fixed now that #40479 landed, closing. Please let me know if I'm wrong though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants