Skip to content

Custom libdir breaks std crate #45345

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
o01eg opened this issue Oct 17, 2017 · 10 comments
Closed

Custom libdir breaks std crate #45345

o01eg opened this issue Oct 17, 2017 · 10 comments
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@o01eg
Copy link
Contributor

o01eg commented Oct 17, 2017

I maintain live-ebuild for dev channel. To avoid collision between different rust channels libdir should be set to different subdirectory: gentoo/gentoo-rust#287
It worked with configure script but was broken after moving to x.py script.

config.toml file:

[llvm]
optimize = true
release-debuginfo = false
assertions = false
[build]
build = "x86_64-unknown-linux-gnu"
host = ["x86_64-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu"]
docs = true
submodules = false
python = "python2.7"
locked-deps = true
vendor = false
verbose = 2
sanitizers = true
extended = true
[install]
prefix = "/usr"
libdir = "lib64/rust-9999"
docdir = "share/doc/rust-9999"
mandir = "share/rust-9999/man"
[rust]
optimize = true
debuginfo = false
debug-assertions = false
use-jemalloc = true
default-linker = "x86_64-pc-linux-gnu-gcc"
rpath = false
ignore-git = false
[target.x86_64-unknown-linux-gnu]
cc = "x86_64-pc-linux-gnu-gcc"
cxx = "x86_64-pc-linux-gnu-g++"
ar = "x86_64-pc-linux-gnu-ar"
llvm-config = "/usr/bin/x86_64-pc-linux-gnu-llvm-config"

Compiling hello world project:

$ cargo build --verbose
   Compiling tst01 v0.1.0 (file:///tmp/tst01)
     Running `rustc --crate-name tst01 src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=b838c4ea0bb50c79 -C extra-filename=-b838c4ea0bb50c79 --out-dir /tmp/tst01/target/debug/deps -L dependency=/tmp/tst01/target/debug/deps`
error[E0463]: can't find crate for `std`

error: aborting due to previous error

error: Could not compile `tst01`.

Caused by:
  process didn't exit successfully: `rustc --crate-name tst01 src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=b838c4ea0bb50c79 -C extra-filename=-b838c4ea0bb50c79 --out-dir /tmp/tst01/target/debug/deps -L dependency=/tmp/tst01/target/debug/deps` (exit code: 101)

If I set libdir to lib64 then rustc works.

rustc --version --verbose:

rustc 1.22.0-dev (db80da1c1 2017-10-17)
binary: rustc
commit-hash: db80da1c1a20529054ce6745a6219c2108693fb7
commit-date: 2017-10-17
host: x86_64-unknown-linux-gnu
release: 1.22.0-dev
LLVM version: 3.9
@kennytm kennytm added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Oct 17, 2017
@o01eg
Copy link
Contributor Author

o01eg commented Nov 29, 2017

Its gone if I manually adds RUSTFLAGS="-L /usr/lib/rust-9999/ -L /usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/"

@o01eg
Copy link
Contributor Author

o01eg commented Nov 29, 2017

It's looks like it was broken #44107 where script was stopped to set CFG_LIBDIR_RELATIVE

@o01eg
Copy link
Contributor Author

o01eg commented Nov 29, 2017

I've tried to set config.libdir_relative to same value as config.libdir

config.libdir = install.libdir.clone().map(PathBuf::from);

It fixed this issue but gets error with building rust docs on proc_macro.

@o01eg
Copy link
Contributor Author

o01eg commented Nov 30, 2017

It works on 1.20 but start to breaks at 1.21 and later.

@o01eg
Copy link
Contributor Author

o01eg commented Nov 30, 2017

Breaking change for proc_macro is PR #43630 and commit facf5a9

@kennytm kennytm added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Nov 30, 2017
@o01eg
Copy link
Contributor Author

o01eg commented Dec 2, 2017

Looks like rustdoc here searches libraries in

/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/

while stage1 libraries are in

/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/

@o01eg
Copy link
Contributor Author

o01eg commented Dec 3, 2017

Command which failed:

rustdoc command: "/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--crate-name" "proc_macro" "src/libproc_macro/lib.rs" "--target" "x86_64-unknown-linux-gnu" "-o" "/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc" "-L" "dependency=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "--extern" "syntax_pos=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-94faca1471e8dcc3.so" "--extern" "syntax=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-355ef924b9232203.so" "--extern" "rustc_errors=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-24cf71b122930dcb.so" "--cfg" "stage1" "--cfg" "dox" "--sysroot" "/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage1" "-Z" "force-unstable-if-unmarked" "-Z" "unstable-options" "--crate-version" "1.24.0-dev (0bae745cd 2017-12-03)"

Looks like either should be used custom libdir on all stages or stage2 rustdoc should use stage2 instead stage1 libraries. Maybe use stage1 rustdoc.

@o01eg o01eg mentioned this issue Dec 8, 2017
@nikomatsakis
Copy link
Contributor

I'm not really clear on what team this is. Maybe @rust-lang/docs (rustdoc bug?) anyway, I guess there's a pending fix.

@GuillaumeGomez
Copy link
Member

I recall a similar bug I fixed a while ago. Strange it's reappearing...

bors added a commit that referenced this issue Jan 13, 2018
Fix 45345

There is a fix for #45345

It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.

Other commits fix errors which happen after rustbuild cleanups.
@bors bors closed this as completed in ee8b578 Jan 13, 2018
raspbian-autopush pushed a commit to raspbian-packages/rustc that referenced this issue Mar 15, 2018
commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752)
Merge: 6eff103aa1f9 472f4e1cc8c3
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 13 05:02:04 2018 +0000

    Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton
    
    Fix 45345
    
    There is a fix for rust-lang/rust#45345
    
    It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.
    
    Other commits fix errors which happen after rustbuild cleanups.


Gbp-Pq: Name u-rust-pr46592-bootstrap-libdir.patch
raspbian-autopush pushed a commit to raspbian-packages/rustc that referenced this issue Jul 15, 2018
commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752)
Merge: 6eff103aa1f9 472f4e1cc8c3
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 13 05:02:04 2018 +0000

    Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton
    
    Fix 45345
    
    There is a fix for rust-lang/rust#45345
    
    It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.
    
    Other commits fix errors which happen after rustbuild cleanups.


Gbp-Pq: Name u-rust-pr46592-bootstrap-libdir.patch
raspbian-autopush pushed a commit to raspbian-packages/rustc that referenced this issue Nov 8, 2018
commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752)
Merge: 6eff103aa1f9 472f4e1cc8c3
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 13 05:02:04 2018 +0000

    Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton
    
    Fix 45345
    
    There is a fix for rust-lang/rust#45345
    
    It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.
    
    Other commits fix errors which happen after rustbuild cleanups.


Gbp-Pq: Name u-rust-pr46592-bootstrap-libdir.patch
raspbian-autopush pushed a commit to raspbian-packages/rustc that referenced this issue Nov 11, 2018
commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752)
Merge: 6eff103aa1f9 472f4e1cc8c3
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 13 05:02:04 2018 +0000

    Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton
    
    Fix 45345
    
    There is a fix for rust-lang/rust#45345
    
    It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.
    
    Other commits fix errors which happen after rustbuild cleanups.


Gbp-Pq: Name u-rust-pr46592-bootstrap-libdir.patch
raspbian-autopush pushed a commit to raspbian-packages/rustc that referenced this issue Nov 18, 2018
commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752)
Merge: 6eff103aa1f9 472f4e1cc8c3
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 13 05:02:04 2018 +0000

    Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton
    
    Fix 45345
    
    There is a fix for rust-lang/rust#45345
    
    It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`.
    
    Other commits fix errors which happen after rustbuild cleanups.


Gbp-Pq: Name u-rust-pr46592-bootstrap-libdir.patch
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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

4 participants