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

Add build information into build #3393

Open
max-sixty opened this issue Aug 24, 2023 · 2 comments
Open

Add build information into build #3393

max-sixty opened this issue Aug 24, 2023 · 2 comments
Labels
good first issue Tasks suited for learning the compiler codebase rust Pull requests that update Rust code

Comments

@max-sixty
Copy link
Member

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.

@max-sixty max-sixty added good first issue Tasks suited for learning the compiler codebase rust Pull requests that update Rust code labels Aug 24, 2023
@eitsupi
Copy link
Member

eitsupi commented Aug 25, 2023

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.

@max-sixty
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Tasks suited for learning the compiler codebase rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

2 participants