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

Also emit DEP_Z_INCLUDE when using pkg-config #188

Merged
merged 1 commit into from Mar 21, 2024

Conversation

sfackler
Copy link
Member

Downstream build scripts use DEP_Z_INCLUDE to configure the builds of other native libraries (for example in libgit2-sys). Previously, if libz was found via pkg-config and didn't have a system-default include directory those builds would fail.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix!

It looks good to me, but I wouldn't know how to test it, nor do I think it would be easy to write a test for this.

Can I assume that you validated this works as expected so I can merge?

Also, if you'd like to see a new release with this fix so it can trickle downstream, you could open another PR with the manifest version update, as I think this repository doesn't allow self-approvals.

Thanks again.

@Byron Byron added the question label Mar 21, 2024
@sfackler
Copy link
Member Author

Yep, I validated it with [patch.crates-io] on an internal thing that was previously failing to build libgit2.

Will follow up with a version bump PR.

@Byron Byron merged commit fef3990 into rust-lang:main Mar 21, 2024
43 checks passed
@sfackler sfackler deleted the pkg-config-include branch March 21, 2024 19:58
@weihanglo
Copy link
Member

Would it be better using std::env::join_paths instead of commas to maximize the compatibility?

@Byron
Copy link
Member

Byron commented Apr 25, 2024

This could be a great catch!

cargo:include is seemingly unlisted in the docs, maybe I am not looking in the right place though.
With the docs it should be clear what separators can be used - it's surprising that , is support if : or ; would be supported as well. But then again, everything is possible if it's documented somewhere.

@sfackler
Copy link
Member Author

It is the old syntax for

cargo::metadata=KEY=VALUE — Metadata, used by links scripts.

@weihanglo
Copy link
Member

cargo:include is arbitrary user-defined cargo:KEY=VALUE, which is superseded by cargo::metadata=KEY=VALUE to have a better extensibility. I am looking at other -sys crate and some of them have the same (not ideal?) pattern.

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

Successfully merging this pull request may close these issues.

None yet

3 participants