-
Notifications
You must be signed in to change notification settings - Fork 792
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
Cherry-pick to earlgrey_es_sival: Rework how bazel stamping work in the repository #21168
Merged
jwnrt
merged 10 commits into
earlgrey_es_sival
from
backport-20881-to-earlgrey_es_sival
Feb 20, 2024
Merged
Cherry-pick to earlgrey_es_sival: Rework how bazel stamping work in the repository #21168
jwnrt
merged 10 commits into
earlgrey_es_sival
from
backport-20881-to-earlgrey_es_sival
Feb 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Several tools need to extract some information from bazel's version file so create small library for that purpose to avoid duplicating code. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit adebfaa)
The purpose of this module is to enabled rules to detect whether stamping is enabled on the command-line or not. It requires some hackery inspired by a bazel bug thread and which is very similar to how rules_rust handles this as well. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit bc4fd07)
Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 62dcd3f)
With this change, `autogen_hjson_header` will now only pass stamping information to regtool if required on the command-line. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit f0ec914)
With this change, `autogen_chip_info_src` will only pass version information if stamping is enabled on the command-line. This commit changes the meaning of the `--ot_version_file` flag of `//util:rom_chip_info`. Previously, it was a path to a file that contains the git sha. It is now a path to the bazel version info file which is parsed using the `version_info` library. Note: with this change, unless stamping is enabled, the ROM will not contained the git sha in the chip_info anymore. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 375a037)
This dependency is not used because the version information comes from `stamp-env.txt` which is handled directly by `rust_binary`. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 4df546f)
With the previous changes, those targets have become useless and can be removed. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit bc22e8b)
If stamping is disable, version_stamp will be an empty dictionary and the code will print something like ``` // Generated register constants for rv_plic. // Built for <unknown> // https://github.com/lowRISC/opentitan/tree/<unknown> // Tree status: <unknown> // Build date: <current date> ``` This is unhelpful and still prints the current time which is defeats the point of not stamping. The new code will not print anything when a piece of information is not available. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 24903e9)
Instead of treating version_stamp like a dictionary with specific name entries, turn it into a class with proper accessors so that the particular representation of the version information is abstracted. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 595d28c)
Allow opentitantool to be built with stamping disabled, and disable it by default. Update the `version` command to handle the case of missing information. The build time/date is removed since it adds no useful information. Signed-off-by: Amaury Pouly <[email protected]> (cherry picked from commit 97cf2c7)
github-actions
bot
requested review from
msfschaffner,
cfrantz and
a team
as code owners
February 2, 2024 13:04
~~CC @andreaskurth ~~
Sorry I misread this - this is going to the sival branch, so LGTM. |
msfschaffner
requested review from
andreaskurth and
neeraj-rv
and removed request for
andreaskurth and
neeraj-rv
February 5, 2024 17:30
jwnrt
approved these changes
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automatic cherry-pick of #20881 to branch
earlgrey_es_sival
.