commit:     b83522144da3cfd9ddc460c2cb1b8c5e5be51540
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Mon Nov 24 15:12:50 2025 +0000
Commit:     Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Mon Nov 24 15:42:11 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=b8352214

chore: make building explicitly wipe objects to ensure it's regenerated

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

 py_build.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/py_build.py b/py_build.py
index f211eb45..0a3917a4 100644
--- a/py_build.py
+++ b/py_build.py
@@ -45,8 +45,16 @@ def write_const(cleanup_files):
         )
 
 
+def get_objects_path():
+    return Path.cwd() / "src/pkgcheck/_objects.py"
+
+
+def wipe_objects_on_disk():
+    get_objects_path().unlink(missing_ok=True)
+
+
 def write_objects(cleanup_files):
-    cleanup_files.append(path := Path.cwd() / "src/pkgcheck/_objects.py")
+    cleanup_files.append(path := get_objects_path())
     print(f"writing objects to {path}")
 
     with sys_path():
@@ -96,6 +104,9 @@ def write_files(cleanup_files):
 
 @contextmanager
 def create_generated_files():
+    # the objects registry isn't hot reloadable, and it's fragile for wiping
+    # it if it already loaded the _objects_file.  Thus just shoot it first 
thing.
+    wipe_objects_on_disk()
     cleanup_files = []
     try:
         write_verinfo(cleanup_files)

Reply via email to