PMunch / futhark

Automatic wrapping of C headers in Nim
MIT License
355 stars 19 forks source link

Read version from nimble file #60

Closed daniel-j closed 1 year ago

daniel-j commented 1 year ago

To avoid having to update futhark.nim when version changes. Uses nimble dump.

PMunch commented 1 year ago

I tried systems like this, but they ended up failing when I did nimble upgrade. I think that was using a slightly different system though where both the nimble file and futhark.nim file would import a version.nim file and grab the version from there, so this approach might work. You could also use nimbleutils to simplify the call a bit.

PMunch commented 1 year ago

Can this be made to use https://github.com/PMunch/nimbleutils instead? That way any special cases for Nimble handling can just live in that repo

daniel-j commented 1 year ago

I think nimbleutils needs some tweaking, all the fields of NimblePkg are hidden for example. And the nimbleDump command doesn't use quoteShell. Why isn't it parsing the json output of nimble dump?

PMunch commented 1 year ago

Oh indeed, I just pushed a new version which fixes these problems. The reason why it isn't parsing the JSON output of Nimble dump is mostly because I didn't know it existed when I wrote that package. But the result is the same anyways so it doesn't matter terribly much, if anything this might even be a bit quicker since it's parsing it directly into the object and not into an intermediary format.

daniel-j commented 1 year ago

Updated to use latest nimbleutils version