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

Use metadeps to specify pkg-config dependencies declaratively #12

Closed
wants to merge 1 commit into from
Closed

Use metadeps to specify pkg-config dependencies declaratively #12

wants to merge 1 commit into from

Conversation

joshtriplett
Copy link
Member

This makes it easier for distribution packaging tools to generate
appropriate package dependencies.

This makes it easier for distribution packaging tools to generate
appropriate package dependencies.
@alexcrichton
Copy link
Member

Thanks for the PRs! (here and across other repos)

I'm somewhat uneasy about adding these dependencies so deep in others' dependency graphs, though. Would it be possible to just add this metadata for now and eschew the metadeps dependency?

@joshtriplett
Copy link
Member Author

The metadata would help, but in many cases I'd be concerned that it'd get out of sync. (Less an issue with something as stable as zlib, but still.)

I've tried to minimize the amount of additional dependencies introduced by metadeps; in particular, I eliminated the pile of dependencies that error-chain's backtrace pulls in by disabling default-features. Switching to metadeps now only pulls in four crates: metadeps itself, toml, rustc-serialize, and error-chain.

And I just realized that the toml crate has a feature to disable rustc-serialize support as well, so I just uploaded metadeps 1.1.1 with that disabled.

So, switching to metadeps only involves three crates: metadeps itself, toml, and error-chain. Does that seem sufficiently uninvasive to consider?

@alexcrichton
Copy link
Member

Perhaps a comment could suffice? The previous iteration of this didn't even have .atleast_version or the equivalent, so there's not really anything to keep in sync for this crate even?

@joshtriplett
Copy link
Member Author

@alexcrichton The problem is that we're trying to build packages in a mostly automatic fashion for numerous crates, and a freeform comment doesn't help an automated packaging tool.

Would eliminating the error-chain dependency help at all (reducing it to just metadeps and toml, which seems as minimal as possible)?

If that still seems like too much, then yes, having the metadata would help even if not actually used by the build.rs script.

@alexcrichton
Copy link
Member

This is a pretty low-down-the-stack dependency, so I'm wary to pick up even more deps as a result. TOML nowadays depends on serde itself which I'd prefer to avoid. I'd be fine though just adding the annotation and keeping them in sync.

@joshtriplett
Copy link
Member Author

@alexcrichton metadeps doesn't actually depend on a version of toml that pulls in serde. I made an internals post seeking further metadeps feedback, and I'd welcome your input: https://internals.rust-lang.org/t/metadeps-and-dependencies/5349

@joshtriplett joshtriplett reopened this Aug 14, 2020
@joshtriplett joshtriplett changed the base branch from master to main August 14, 2020 22:04
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

Successfully merging this pull request may close these issues.

2 participants