-
Notifications
You must be signed in to change notification settings - Fork 325
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 executable mkosi.version
support for generating the version dynamically
#2954
Add executable mkosi.version
support for generating the version dynamically
#2954
Conversation
Having both
Maybe that's not necessary? Could we run it just before the configure script? |
I can fold them into one
I theoretically might be possible, just it would be a bit bigger of a change since |
37a3072
to
92be77c
Compare
That's true, though thinking about it, that's a problem we already have with configure scripts, since they could potentially change the version. That's probably not a solvable problem, since expansions can't be unmade. So, yes, for least surprise having the version as early as possible seems reasonable. |
To be fair, this isn't the first user script that is run unsandboxed on the host system, the same is done in Lines 899 to 902 in d53f31b
Should I change those lines to use |
mkosi.version.run
support for generating the version dynamicallymkosi.version
support for generating the version dynamically
Pushed the cleanup commit from #2905 since I had to add the error handling for when |
03b1667
to
566db05
Compare
The CI failures seem unrelated? |
I'm travelling over the weekend. Will have a closer look when I have time, Monday at the latest. The CI failures for Fedora at least are unrelated. We have issues with the Fedora keys about once every release. Haven't looked at the Arch failures. |
566db05
to
c7145d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it yet, but looks reasonable to me. A few last nits
371a698
to
44fc5a8
Compare
44fc5a8
to
8fa3125
Compare
6270f44
to
8dc5771
Compare
`mkosi.version` is executed during configuration parsing, as opposed to reading the contents of `mkosi.version`. This allows querying the version before the build without needing to manually adjust the version beforehand. This allows using date based versioning by writing a script outputting `date '+%Y-%m-%d'` or using git tag based versioning by outputting `git describe --tags`.
8dc5771
to
077eff4
Compare
Thanks for implementing this Nekko 🎉 |
The script is executed unsandboxed (not a fan of this, but unsure how this should be done before any configuration even exists) and reads
stdout
to figure out the version.First commit allows more configurable handling of "standard config paths". Maybe this change should also be extended to
mkosi.rootpw
to allow generating it dynamically?Closes #2915