Description
Gentoo uses installation of multiple rust versions side by side based on the possibility to install libraries to custom locations. At the moment because of this bug (its first part) we need to apply patch.
Steps to reproduce bug.
Case when custom libdir works
We are installing to /home/jauhien/w/image-working
, libraries go to /home/jauhien/w/image-working/customrust
.
-
Configure rust
./configure --prefix=/home/jauhien/w/image-working --libdir=/home/jauhien/w/image-working/customrust --disable-debug --disable-valgrind --disable-helgrind --disable-valgrind-rpass --enable-debuginfo-tests --disable-llvm-assertions --disable-debug-assertions --disable-debug-jemalloc --disable-debuginfo
-
Make rust
make -j5
Have some coffee or tea.
-
Install rust
make install
Rust is installed and works. Libraries go to /home/jauhien/w/image-working/customrust
as expected.
Case when custom libdir leads to failure (bug)
We are going to install rust into /home/jauhien/w/image
, libraries will go to /home/jauhien/w/image/lib/customrust
.
- Configure rust
./configure --prefix=/home/jauhien/w/image --libdir=/home/jauhien/w/image/lib/customrust --disable-debug --disable-valgrind --disable-helgrind --disable-valgrind-rpass --enable-debuginfo-tests --disable-llvm-assertions --disable-debug-assertions --disable-debug-jemalloc --disable-debuginfo
Steps 2 and 3 as in the previous case.
Result: libraries are installed in /home/jauhien/w/image/lib/customrust/customrust
. Note the customrust
being repeated twice. Reason: lines in installer removed by mentioned patch.
Changing libdir during installation is broken
Libdir option for installer makes no sense as it is anyway broken.
Working installation using unchanged libdir
-
Download rust binary tarball for your arch and unpack it.
-
Install rust
./install.sh --prefix=/home/jauhien/w/image-bin-working
-
Try if it works
jauhien@jauhien-VirtualBox rust-tmp % LD_LIBRARY_PATH=/home/jauhien/w/image-bin-working/lib ../image-bin-working/bin/rustc -V rustc 1.3.0 (9a92aaf19 2015-09-15) jauhien@jauhien-VirtualBox rust-tmp % cat test.rs fn main() { println!("It works!"); } jauhien@jauhien-VirtualBox rust-tmp % LD_LIBRARY_PATH=/home/jauhien/w/image-bin-working/lib ../image-bin-working/bin/rustc -V rustc 1.3.0 (9a92aaf19 2015-09-15) jauhien@jauhien-VirtualBox rust-tmp % ./test It works!
Broken installation when libdir option is used
-
As in previous case
-
Install rust
./install.sh --prefix=/home/jauhien/w/image-bin --libdir=/home/jauhien/w/image-bin/customrust
-
Try if it works
jauhien@jauhien-VirtualBox rust-tmp % LD_LIBRARY_PATH=/home/jauhien/w/image-bin/customrust ../image-bin/bin/rustc -V rustc 1.3.0 (9a92aaf19 2015-09-15) jauhien@jauhien-VirtualBox rust-tmp % LD_LIBRARY_PATH=/home/jauhien/w/image-bin/customrust ../image-bin/bin/rustc test.rs -o test test.rs:1:1: 1:1 error: can't find crate for `std` test.rs:1 fn main() { ^ error: aborting due to previous error
Reason: relative libdir path is captured by rust compiler during build and it is impossible to change it later.