prql
prql copied to clipboard
Add build information into build
What's up?
It could be useful to have the commit & date of a build in the comment, rather than just the version number.
IIUC vergen enables that, with a build.rs
If anyone would like an interesting addition which involves cargo, this could be a good one. It looks like it's not that much code.
Probably we want lots of info on prqlc --version like this example, and then in the comment in the SQL we want the commit hash in addition to the latest tag iff it's not on a tag.
IIUC vergen enables that, with a
build.rs
I think I looked into this a long time ago, but I suspect that if we have cache enabled this may not work as well as we think.
I suspect that if we have cache enabled this may not work as well as we think.
Interesting.
It looks like it'll rerun the build (I think just for the specific crate) if the current HEAD changes:
Will emit cargo:rerun-if-changed=.git/HEAD if the git feature is enabled. This is done to ensure any git instructions are regenerated when commits are made.
So committing will rerun the build. That's not too bad, I guess depending on often folks commit code locally. I think it's equivalent to making a no-op change to a file, which recompiling from takes 6.48s locally. (NB: compiling all our crates takes 40 seconds in CI, but doesn't take advantage of incremental builds)
If that's correct, and that's all the costs we'd bear (or am I missing others?), I'd say it's worthwhile, but not a particularly strong view.