Skip to content

Conversation

rivos-eblot
Copy link

  • other small fixes

@AlexJones0
Copy link

AlexJones0 commented Oct 8, 2025

I looked into the CI failure for you, we use cfggen.py in Bazel, which is often building in a cache directory and not within the OpenTitan checkout. I think that retrieve_git_version is designed to gracefully fail, but the problem is that dirname("/") = "/", so we get stuck in an infinite loop if the .git dir cannot be found and we traverse all the way to root.

This is maybe the easiest fix?

diff --git a/python/qemu/ot/util/misc.py b/python/qemu/ot/util/misc.py
index eccb3c49ab..519c542ca7 100644
--- a/python/qemu/ot/util/misc.py
+++ b/python/qemu/ot/util/misc.py
@@ -237,7 +237,7 @@ def retrieve_git_version(path: str, max_tag_dist: int = 100) \
         cfgdir = path
     else:
         return None
-    while cfgdir and isdir(cfgdir):
+    while cfgdir and cfgdir != dirname(cfgdir) and isdir(cfgdir):
         gitdir = joinpath(cfgdir, '.git')
         if exists(gitdir):  # either a dir or a file for worktree
             break

@rivos-eblot
Copy link
Author

I looked into the CI failure for you, we use cfggen.py in Bazel, which is often building in a cache directory and not within the OpenTitan checkout. I think that retrieve_git_version is designed to gracefully fail,

I thought I had tested it, but it seems I failed :-(
Thanks for tracking down the issue, I'll add a fix.

…on non git dir hierarchy

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…fig file.

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…w size limit

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…-able space.

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
@rivos-eblot
Copy link
Author

It seems that one single test is failing. Can I merge this PR?

@AlexJones0
Copy link

It seems that one single test is failing. Can I merge this PR?

Yes, this has failed a couple times so should probably be marked flaky but you can merge.

@rivos-eblot rivos-eblot merged commit 9b4f333 into lowRISC:ot-9.2.0 Oct 9, 2025
8 of 9 checks passed
@rivos-eblot rivos-eblot deleted the dev/ebl/py_git_ver branch October 9, 2025 13:35
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.

2 participants