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

build scripts break when the target-dir is configured to an alternate location #2700

Closed
bbatha opened this issue May 16, 2016 · 2 comments
Closed

Comments

@bbatha
Copy link

bbatha commented May 16, 2016

Cargo is unable to build openssl-sys if your cargo config sets "target-dir" to an alternate location.

$ cargo build --verbose
   Compiling bitflags v0.6.0
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/bitflags-0.6.0/src/lib.rs --crate-name bitflags --crate-type lib -g -C metadata=01727bf67df6b16b -C extra-filename=-01727bf67df6b16b --out-dir rust-obj/debug/deps --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --cap-lints allow`
   Compiling gcc v0.3.28
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/gcc-0.3.28/src/lib.rs --crate-name gcc --crate-type lib -g -C metadata=2e3f9b8efefd9144 -C extra-filename=-2e3f9b8efefd9144 --out-dir rust-obj/debug/deps --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --cap-lints allow`
   Compiling libc v0.2.11
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/libc-0.2.11/src/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"use_std\" --cfg feature=\"default\" -C metadata=7f0d63b960234050 -C extra-filename=-7f0d63b960234050 --out-dir rust-obj/debug/deps --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --cap-lints allow`
   Compiling lazy_static v0.2.1
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/lazy_static-0.2.1/src/lib.rs --crate-name lazy_static --crate-type lib -g -C metadata=8c84f489cd3e7d4a -C extra-filename=-8c84f489cd3e7d4a --out-dir rust-obj/debug/deps --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --cap-lints allow`
   Compiling pkg-config v0.3.8
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/pkg-config-0.3.8/src/lib.rs --crate-name pkg_config --crate-type lib -g -C metadata=4db00a0f261b88d6 -C extra-filename=-4db00a0f261b88d6 --out-dir rust-obj/debug/deps --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --cap-lints allow`
   Compiling openssl-sys v0.7.11
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/openssl-sys-0.7.11/build.rs --crate-name build_script_build --crate-type bin -g --out-dir rust-obj/debug/build/openssl-sys-34e294f784d96ad8 --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --extern pkg_config=rust-obj/debug/deps/libpkg_config-4db00a0f261b88d6.rlib --cap-lints allow`
   Compiling openssl-sys-extras v0.7.11
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/openssl-sys-extras-0.7.11/build.rs --crate-name build_script_build --crate-type bin -g --out-dir rust-obj/debug/build/openssl-sys-extras-e1c84960cd35bc93 --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --extern gcc=rust-obj/debug/deps/libgcc-2e3f9b8efefd9144.rlib --cap-lints allow`
   Compiling openssl v0.7.11
     Running `rustc /home/user/bbatha/.multirust/cargo/registry/src/gh.neting.cc-88ac128001ac3a9a/openssl-0.7.11/build.rs --crate-name build_script_build --crate-type bin -g --out-dir rust-obj/debug/build/openssl-5eb24e119ff837c6 --emit=dep-info,link -L dependency=rust-obj/debug/deps -L dependency=rust-obj/debug/deps --extern gcc=rust-obj/debug/deps/libgcc-2e3f9b8efefd9144.rlib --cap-lints allow`
     Running `rust-obj/debug/build/openssl-sys-34e294f784d96ad8/build-script-build`
Build failed, waiting for other jobs to finish...
failed to run custom build command for `openssl-sys v0.7.11`
Could not execute process `rust-obj/debug/build/openssl-sys-34e294f784d96ad8/build-script-build` (never executed)

Caused by:
  No such file or directory (os error 2)

$ cat .cargo/config
[build]
target-dir = "rust-obj"

$ cat Cargo.toml
[package]
name = "test"
version = "0.1.0"

[dependencies]
openssl = "*"

Cross-filed sfackler/rust-openssl#396

@alexcrichton
Copy link
Member

What version of Cargo are you running? I thought this bug was fixed long ago...

@alexcrichton
Copy link
Member

Ah I can reproduce on nightly, fix coming soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants