Skip to content

Installation is broken when custom relative libdir path starts with lib/ or when libdir is changed during installation #28627

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

Closed
jauhien opened this issue Sep 24, 2015 · 6 comments
Labels
O-linux Operating system: Linux

Comments

@jauhien
Copy link
Contributor

jauhien commented Sep 24, 2015

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.

  1. 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
    
  2. Make rust

    make -j5
    

    Have some coffee or tea.

  3. 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.

  1. 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

  1. Download rust binary tarball for your arch and unpack it.

  2. Install rust

    ./install.sh --prefix=/home/jauhien/w/image-bin-working
    
  3. 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

  1. As in previous case

  2. Install rust

    ./install.sh --prefix=/home/jauhien/w/image-bin --libdir=/home/jauhien/w/image-bin/customrust
    
  3. 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.

@jauhien
Copy link
Contributor Author

jauhien commented Sep 24, 2015

@jauhien jauhien changed the title Installation is broken when custom libdir path starts with lib/ or when libdir is changed during installation Installation is broken when custom relative libdir path starts with lib/ or when libdir is changed during installation Sep 24, 2015
@anguslees
Copy link
Contributor

I think this is a dup of #22831 - the latter was closed due to "inactivity", and I couldn't find the button to reopen it :/

@steveklabnik
Copy link
Member

Anyone with commit can re-open it, if you're interested in reviving the PR, @anguslees , I'd be happy to do so

@steveklabnik steveklabnik added the O-linux Operating system: Linux label Sep 28, 2015
@jauhien
Copy link
Contributor Author

jauhien commented Sep 28, 2015

@steveklabnik: #22831 doesn't fix this problem in general. I even doubt that it will work (cause it fixies installation, but I'm not sure that it will not break compilation). And anyway it does not address the problem No. 2 -- broken installation when libdir is changed in the install phase.

What I think we should do now is removing of --libdir parameter from the install script as it makes no sense and is broken anyway. This will correctly fix problem No. 1. Then, if for some reason somebody is interested in the changing of libdir during installation, he can try to fix this problem. The right way to fix it can be using of standard system mechanism for library lookup during looking for std crate in place of the one that we have now.

@brson
Copy link
Contributor

brson commented Oct 1, 2015

My current preferred solution is to simply remove the --libdir option from rust-installer since it is so broken. That would leave the working case where --libdir is specified to the configure script, but make it uncustomizable at install-time with the normal installers.

Then we'll just wait until somebody complains hard about needing the installer to actually be able to do this customization.

@steveklabnik
Copy link
Member

My understanding is that packaging has moved significantly forward in the 17 months since this bug has been commented on, and including gentoo: https://wiki.gentoo.org/wiki/Project:Rust

As such, I'm gonna assume this is stale, and give it a close. If not, please open a new bug. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-linux Operating system: Linux
Projects
None yet
Development

No branches or pull requests

4 participants