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

v: add @VMODHASH comptime variable to store the commit sha of a V module #21091

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Mar 25, 2024

The PR should implement the possibility to store a commit hash of a vmodule as a compile time variable. Similar to Similar to @VHASH / @VCURRENTHASH for V itself. The reason for it is that I encountered multiple scenarios where it would be useful and function calls in constants are not yet evaluated at comptime.

@ttytm ttytm changed the title v: add @VMODHASH comptime for the commit sha v: add @VMODHASH comptime variable to store the commit sha of a V module Mar 25, 2024
cmd/tools/vup.v Outdated Show resolved Hide resolved
vlib/v/checker/checker.v Outdated Show resolved Hide resolved
vlib/v/checker/checker.v Outdated Show resolved Hide resolved
@spytheman
Copy link
Member

spytheman commented Mar 25, 2024

Please do not make breaking changes, in PRs that introduce new features, like @VMODHASH .
It is much better, if you make such PRs standalone, without changes unrelated to them, then when they are merged, make other subsequent PRs, that will use the new features, or refactor code etc.

Bootstrapping can get very entangled and tricky otherwise.

@spytheman
Copy link
Member

Note, I do agree that a @VMODHASH feature will be very useful to have, just not with introducing it in the same PR as other changes.

@ttytm ttytm marked this pull request as ready for review April 4, 2024 04:16
@spytheman spytheman merged commit 254250d into vlang:master Apr 5, 2024
54 checks passed
@spytheman
Copy link
Member

Excellent work 🥳 !
The new @VMODHASH will be very useful for build scripts like the one in v-analyzer.

@ttytm
Copy link
Member Author

ttytm commented Apr 5, 2024

Imho it's a super cool feature. It's a little hassle in other languages to implement. It's nice to have 😄

@ttytm ttytm deleted the v/vmodhash-comptime-var branch April 16, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants