-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
compile requires zlib.h in default location #69552
Comments
The two things that depend on |
From a cursory glance at its build script, looks like the Assuming you have Reading a bit further in build.rs, it looks like you can set |
Thank you very much for the response. I've tried the
Note that pkg-config is providing the right cflags for libssh2, which are not used:
I will now try the |
If you check the source of the compilation, you'll see that you're getting a compilation error when building This may sound incredibly familiar. You have two options -- either set It sucks to have to keep playing dependency whack-a-mole. It may be worth to filing bugs with the maintainers of |
To answer your second question, I don't see equivalent environment variables to specify library paths, but it's likely that only the headers are necessary to compile the bundled versions of |
It looks like setting I'm now going to test with Should an issue with https://github.com/rust-lang/git2-rs also be created? |
…nd libssh2, see rust-lang/rust#69552 for details
It would definitely be worthwhile, at least to make the issue known to them. Their build script is similar to |
I believe it's OK to close this issue now, or after rust-lang/git2-rs#525 is merged. Thank you very much @Tyg13 for your helpful comments and suggestions in solving this! |
Of course! Glad to be of help. |
I don't think we've really fixed anything; the libssh2 PR caused other breakages; discussion is on alexcrichton/ssh2-rs#174 |
This caused fairly widespread problems and it seems that the original issue that led to this change (rust-lang/rust#69552) should really be fixed by better defining the data exported from eg: libz-sys rather than having downstream crates replicating the same logic from inside that crate. refs: #174 refs: #170 refs: #169 refs: rust-lang/rust#69552
I believe that a proper fix for this requires changes in the If the official way to deal with this is to use pkg-config then care needs to be taken to disable the automatic emission of cargo options using: |
It looks like this is an upstream bug in libz-sys, so I'm going to close this. Feel free to reopen it on their issue tracker. |
When compiling rust-1.41.1 (
x.py build
) build fails ifzlib.h
is not present in a default location. Typically,pkg-config --cflags zlib
would provide the appropriate location for zlib in case it is not in/usr/include
, however rust does not make use of this. Also, editingconfig.toml
to add include path incflags
orcxxflags
under[llvm]
will not solve this issue either.I could find no documented way to alter cflags that works. During research I stumbled upon rust-lang/cargo#2112 which seems somewhat related, but altering
RUSTFLAGS
didn't solve this issue.I expected to see this happen: Rust compiling successfully.
Instead, this happened: x.py build fails
Meta
python3 ./x.py build --exclude src/tools/miri
:In this specific context, zlib is not installed in the default path, but
pkg-config --cflags zlib
will return the appropriate flags to pass tocc
for a successful build.The text was updated successfully, but these errors were encountered: