brizental pushed to branch mullvad-browser-140.4.0esr-15.0-1 at The Tor Project 
/ Applications / Mullvad Browser


Commits:
28473216 by Beatriz Rizental at 2025-10-14T16:26:51+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
=====================================
@@ -221,11 +221,7 @@ def bootstrap_path(path, **kwargs):
                 log.info("no path found in tbb/out for %s", artifact)
                 return False
 
-            # We will use the name of the artifact as the index.
-            #
-            # It's usually unique to the artifact version, but each artifact 
follows
-            # a different naming convention, so we can't really get more 
specific here.
-            artifact_index = artifact_path.rsplit("/", 1)[-1]
+            artifact_index = 
mozbuild.tbbutils.get_artifact_index(artifact_path)
             index_file = os.path.join(toolchains_base_dir, "indices", artifact)
             try:
                 with open(index_file) as fh:


=====================================
python/mozbuild/mozbuild/tbbutils.py
=====================================
@@ -41,6 +41,17 @@ ARTIFACT_NAME_MAP = {
 }
 
 
+def get_artifact_index(artifact_path):
+    """
+    Return a unique identifier for the given artifact based on its path.
+
+    In most cases, artifacts built by tor-browser-build include part of their
+    SHA sum or version in the filename, so the file name itself serves as a 
unique
+    identifier.
+    """
+    return artifact_path.rsplit("/", 1)[-1]
+
+
 def get_artifact_name(original_artifact_name, host):
     # These are not build artifacts, they are pre-built artifacts to be added 
to the final build,
     # therefore this check can come before the host check.


=====================================
python/mozbuild/mozbuild/test/test_tbbutils.py
=====================================
@@ -4,7 +4,7 @@ from unittest.mock import MagicMock, patch
 
 import mozunit
 
-from mozbuild.tbbutils import get_artifact_path, list_files_http
+from mozbuild.tbbutils import get_artifact_index, get_artifact_path, 
list_files_http
 
 
 class TestGetArtifactName(unittest.TestCase):
@@ -34,6 +34,13 @@ class TestGetArtifactName(unittest.TestCase):
         self.assertEqual(result, self.artifact[::-1])
 
 
+class TestGetArtifactIndex(unittest.TestCase):
+    def test_regular_artifact(self):
+        path = 
"https://tb-build-06.torproject.org/~tb-builder/tor-browser-build/out/tor/tor-b1f9824464dc-linux-x86_64-b0ffe2.tar.gz";
+        expected = "tor-b1f9824464dc-linux-x86_64-b0ffe2.tar.gz"
+        self.assertEqual(get_artifact_index(path), expected)
+
+
 class TestGetArtifactPath(unittest.TestCase):
     def setUp(self):
         self.url = "http://example.com";



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/284732167456f49127c9cd9895b398be8125a099

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/284732167456f49127c9cd9895b398be8125a099
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