microsoft / igvm

MIT License
81 stars 17 forks source link

Igvm_c: fix pkgconfig #56

Closed osteffenrh closed 1 month ago

osteffenrh commented 1 month ago

Some small fixes for the pkgconfig file installed by igvm_c:

osteffenrh commented 1 month ago

Alternate way for getting the crate version:

$ cargo metadata --format-version=1 | jq -c '.packages[] | select (.name == "igvm").version'
"0.3.0"

But that requires jq to be installed.

chris-oo commented 1 month ago

LGTM. Does it make more sense to use grep vs jq because most folks will have grep but not jq? The jq is nicer to look at, but i'm not sure it matters too much if they accomplish the same thing?

osteffenrh commented 1 month ago

The approach with grep is more fragile since it does not parse the toml file. But jq is not very commonly installed, and a cli toml parser tool is even less common.

I had hoped that cargo would have a way to report the package version directly, but no.

I'd say let's use grep for now.

chris-oo commented 1 month ago

Okay sounds good. We can take a future change if we want to change strategy.