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

--jemalloc-root actually expects file path, not a directory #35349

Closed
jirutka opened this issue Aug 5, 2016 · 1 comment
Closed

--jemalloc-root actually expects file path, not a directory #35349

jirutka opened this issue Aug 5, 2016 · 1 comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jirutka
Copy link

jirutka commented Aug 5, 2016

--jemalloc-root has description: “set directory where libjemalloc_pic.a is located”, but it actually expects full path of libjemalloc_pic.a, not a directory.

When I set --jemalloc-root=/usr/lib (and --enable-rustbuild), then build fails:

     Running `/home/jirutjak/rust/build/bootstrap/debug/rustc src/liballoc_jemalloc/lib.rs --crate-name alloc_jemalloc --crate-type lib -C opt-level=2 -C metadata=fa1cd829f11122da -C extra-filename=-fa1cd829f11122da --out-dir /home/jirutjak/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/home/jirutjak/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps -L dependency=/home/jirutjak/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps --extern core=/home/jirutjak/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps/libcore-eccf49d39f88a622.rlib --extern libc=/home/jirutjak/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps/liblibc-5aeeadd0596ef5a0.rlib -L native=/usr --cfg cargobuild -l dylib=`
       Fresh panic_unwind v0.0.0 (file:///home/jirutjak/rust/src/libpanic_unwind)
error: empty library name given via `-l`
error: aborting due to previous error
error: Could not compile `alloc_jemalloc`.

The problem is in src/liballoc_jemalloc/build.rs:30.

    if let Some(jemalloc) = env::var_os("JEMALLOC_OVERRIDE") {
        let jemalloc = PathBuf::from(jemalloc);  //=> "/usr/lib"
        println!("cargo:rustc-link-search=native={}",
                 jemalloc.parent().unwrap().display());
        let stem = jemalloc.file_stem().unwrap().to_str().unwrap();  //=> "lib"
        println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);  //=> "cargo:rustc-link-lib=dylib="

It works fine with --jemalloc-root=/usr/lib/libjemalloc_pic.a.

@alexcrichton alexcrichton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 5, 2016
@ishitatsuyuki
Copy link
Contributor

A friendly ping, this would break most distros on a major release.

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

3 participants