brizental pushed to branch tor-browser-140.2.0esr-15.0-1 at The Tor Project / 
Applications / Tor Browser


Commits:
e3afce24 by Beatriz Rizental at 2025-09-08T18:43:45+02:00
fixup! BB 43564: Modify ./mach bootstrap for Base Browser

- - - - -


3 changed files:

- build/moz.configure/bootstrap.configure
- python/mozbuild/mozbuild/tbbutils.py
- python/mozbuild/mozbuild/test/test_tbbutils.py


Changes:

=====================================
build/moz.configure/bootstrap.configure
=====================================
@@ -211,7 +211,11 @@ def bootstrap_path(path, **kwargs):
                 return False
 
             artifact_path = mozbuild.tbbutils.get_artifact_path(
-                tor_browser_build_out, artifact, target, prefix=path_prefix
+                tor_browser_build_out,
+                artifact,
+                target,
+                prefix=path_prefix,
+                log=log.warning,
             )
             if not artifact_path:
                 log.info("no path found in tbb/out for %s", artifact)


=====================================
python/mozbuild/mozbuild/tbbutils.py
=====================================
@@ -58,7 +58,7 @@ def get_artifact_name(original_artifact_name, host):
     return ARTIFACT_NAME_MAP.get(original_artifact_name)
 
 
-def get_artifact_path(url, artifact, target, prefix=""):
+def get_artifact_path(url, artifact, target, prefix="", log=lambda *args, 
**kwargs: {}):
     if prefix:
         path = prefix
     else:
@@ -71,6 +71,7 @@ def get_artifact_path(url, artifact, target, prefix=""):
     files = list_files_http(f"{url}/{path}?C=M;O=D")
 
     if not files:
+        log(f"No files found in {url} for {artifact}.")
         return None
 
     def filter_files(files, keyword):
@@ -78,6 +79,10 @@ def get_artifact_path(url, artifact, target, prefix=""):
 
     artifact_files = [file for file in files if file.startswith(artifact)]
 
+    if len(artifact_files) == 0:
+        log(f"No files found in {url} for {artifact}.")
+        return None
+
     if len(artifact_files) == 1:
         return f"{url}/{path}/{artifact_files[0]}"
 


=====================================
python/mozbuild/mozbuild/test/test_tbbutils.py
=====================================
@@ -48,6 +48,12 @@ class TestGetArtifactPath(unittest.TestCase):
         result = get_artifact_path(self.url, self.artifact, self.target)
         self.assertIsNone(result)
 
+    @patch("mozbuild.tbbutils.list_files_http")
+    def test_no_matching_files_returns_none(self, mock_list_files):
+        mock_list_files.return_value = ["somethingelse.zip", 
"yetanotherthing.zip"]
+        result = get_artifact_path(self.url, self.artifact, self.target)
+        self.assertIsNone(result)
+
     @patch("mozbuild.tbbutils.list_files_http")
     def test_single_artifact_match(self, mock_list_files):
         mock_list_files.return_value = ["artifact-1.zip"]



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e3afce24b679ea8243e2177abcea7bc31aa51662

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e3afce24b679ea8243e2177abcea7bc31aa51662
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to