These are chat archives for rust-lang/rust

6th
Mar 2016
Remi Rampin
@remram44
Mar 06 2016 19:06
How do I pass an -L flag to cargo?
Something depends on freetype and it's not in the standard place on my system (it's in /opt/local/lib because of macports)
Remi Rampin
@remram44
Mar 06 2016 20:07
@retep998: Can I put that in a .cargo/config file?
I'm not changing the projects' build scripts to adapt cargo to my system
Remi Rampin
@remram44
Mar 06 2016 20:17
Yeah that's were it goes. Trying it now.
Totally doesn't work, the directory is not added to the final link command-line, and thus it fails in the exact same way.
Remi Rampin
@remram44
Mar 06 2016 20:29
Whatever I do it won't find this stupid dylib
Hmm I was using target.x86_64-apple-darwin.freetype-sys instead of target.x86_64-apple-darwin.freetype. Why is that not correct?
Peter Atashian
@retep998
Mar 06 2016 20:34
@remram44 You're not overriding based on the name of the crate or package. You're overriding based on the links = "foo" attribute
So you have to do target.x86_64-apple-darwin.freetype
Remi Rampin
@remram44
Mar 06 2016 20:36
I think I see but I fear that I don't really
this is also the exact settings that pkg-config --libs freetype2 returns, so I'm not sure why I needed all that
Remi Rampin
@remram44
Mar 06 2016 20:43
it looks like Cargo resets PATH before doing anything? More magic?
TBH it might be multirust
Peter Atashian
@retep998
Mar 06 2016 20:43
Probably is multirust
Are you using multirust the bash script or multirust-rs?
Remi Rampin
@remram44
Mar 06 2016 20:44
not sure, I'm guessing the bash script
Peter Atashian
@retep998
Mar 06 2016 20:45
PATH shouldn't really be relevant to the linker though
Remi Rampin
@remram44
Mar 06 2016 20:45
Well it prevents the build script from finding the pkg-config command
Peter Atashian
@retep998
Mar 06 2016 20:45
Ah, that would be an issue
Remi Rampin
@remram44
Mar 06 2016 20:45
multirust run nightly sh -c 'echo $PATH' is fine, so I blame cargo here
Peter Atashian
@retep998
Mar 06 2016 20:46
You should try multirust-rs https://github.com/Diggsey/multirust-rs
Remi Rampin
@remram44
Mar 06 2016 20:48
I will
Remi Rampin
@remram44
Mar 06 2016 20:55
I don't see what would alter PATH in cargo though
Peter Atashian
@retep998
Mar 06 2016 20:55
Neither do I, rustc and cargo should pass along PATH without modifying it. At most they'll add things to it.
Remi Rampin
@remram44
Mar 06 2016 20:57
Yeah PATH is definitely different when running from cargo run than from running the binary directly
it is multirust. Thanks for all the help!