gdesmott / system-deps

Run pkg-config from declarative dependencies in Cargo.toml
Apache License 2.0
87 stars 21 forks source link

Implement support for requiring dependency version ranges #82

Closed sdroege closed 10 months ago

sdroege commented 10 months ago

This now supports expressions in the form

Fixes https://github.com/gdesmott/system-deps/issues/60


@gdesmott Does this look reasonable to you? As discussed, semver can't really be used here because pkg-config versions don't follow semver. A version of "1.2" is semver ">= 1.2, < 2.0" and that is more semantics than pkg-config versions have.

gdesmott commented 10 months ago

Does this look reasonable to you?

I think so. Let's go for that then. I didn't look at the implementation yet but the syntax is ok.

Could you please add some tests as well?

sdroege commented 10 months ago

Could you please add some tests as well?

Sure, I was waiting for an OK for the syntax before spending time on writing tests :)

gdesmott commented 10 months ago

This MR does not break API right? Just so I know how to version the release once it's merged.

sdroege commented 10 months ago

It doesn't break API. If a crate starts using more complex version expressions then it needs to be able to actually handle them though: it will get them passed as version to the closure for building the dependency internally. That doesn't seem like API breakage though as it only happens once the crate uses the new feature.

sdroege commented 10 months ago

Added two simple tests for this.

gdesmott commented 10 months ago

Looks like this test is failing on CI: https://github.com/gdesmott/system-deps/actions/runs/6695863075/job/18192357484?pr=82

(Yeah I need the fix the other jobs)

gdesmott commented 10 months ago

(Yeah I need the fix the other jobs)

I just did so you can rebase your branch for easy CI testing.

sdroege commented 10 months ago

Looks like this test is failing on CI

Because pkgconf and pkg-config have completely different error messages. I've added both of them now.

gdesmott commented 10 months ago

Thanks for the patch. I just released 6.2.0 with it.