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

Broken when DYLD_LIBRARY_PATH is empty #179

Closed
elbaro opened this issue May 6, 2019 · 6 comments
Closed

Broken when DYLD_LIBRARY_PATH is empty #179

elbaro opened this issue May 6, 2019 · 6 comments

Comments

@elbaro
Copy link

elbaro commented May 6, 2019

  1. cargo test in OSX complains about empty DYLD_LIBRARY_PATH.
---- compile_test stdout ----
thread 'compile_test' panicked at 'Cannot link to dependencies. Problem with env var 'DYLD_LIBRARY_PATH': NotPresent', /Users/user/cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.22/src/common.rs:249:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
  1. Manually setting DYLD_LIBRARY_PATH to "" leads to another error
    because rustc is given two consecutive "-L" "-L":
DYLD_LIBRARY_PATH= cargo test

---- [run-pass] run-pass/lifetime4.rs stdout ----

error: compilation failed!
status: exit code: 1
command: "rustc" "tests/run-pass/lifetime4.rs" "-L" "/var/folders/qn/z1949f553jv89j0hnd5qzn9h0000gn/T/" "--target=x86_64-apple-darwin" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/var/folders/qn/z1949f553jv89j0hnd5qzn9h0000gn/T/lifetime4.stage-id" "-L" "-L" "/var/folders/qn/z1949f553jv89j0hnd5qzn9h0000gn/T/lifetime4.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple input filenames provided (first two filenames are `tests/run-pass/lifetime4.rs` and `/var/folders/qn/z1949f553jv89j0hnd5qzn9h0000gn/T/lifetime4.stage-id.aux`)","code":null,"level":"error","spans":[],"children":[],"rendered":"error: multiple input filenames provided (first two filenames are `tests/run-pass/lifetime4.rs` and `/var/folders/qn/z1949f553jv89j0hnd5qzn9h0000gn/T/lifetime4.stage-id.aux`)\n\n"}

------------------------------------------
  1. DYLD_LIBRARY_PATH=dummy cargo test complains that my lib crate is unresolved. I just migrated to 2018 Edition. extern crate my_lib didn't work. The snippet in Remove need for extern crate in 2018 Edition crates #150 didn't work. Can compiletest-rs be used in 2018 crates?
@joshlf
Copy link

joshlf commented Jun 21, 2019

It looks like this is related to this issue: nasa/europa#181. I don't understand compiletest's internals well, but it seems like it's relying on DYLD_LIBRARY_PATH, which isn't going to work on newer versions of macOS, and the code in question may need to be changed.

@aldanor
Copy link

aldanor commented Jul 14, 2019

Any ideas/workarounds re: this? Just hit this as well...

(Might also be somewhat related: #155)

antifuchs added a commit to antifuchs/nonzero_ext that referenced this issue Dec 14, 2019
The compiletest crate requires lots of flaming hoops, doesn't work if
you change features between cargo runs, and currently doesn't work in
macOS at all (see Manishearth/compiletest-rs#179).

The trybuild crate, on the other hand, seems to work quite well
everywhere and gives nice diagnostics. Let's use that instead.
@laumann
Copy link
Collaborator

laumann commented Mar 4, 2021

Doesn't #235 fix this? Looks like #233 is/was a dup of this one.

@joshlf
Copy link

joshlf commented Apr 12, 2021

It might fix it once it makes its way to crates.io 😛

@theypsilon
Copy link

This might be a good reason for a patch release.

@Munksgaard
Copy link
Collaborator

Yes, sorry about the delay. There's now a version 0.7.0 on crates.io which includes the fix in #235

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

6 participants