tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c72557b7aa9ffb5de4ef75c46dda35d36321d745
parent 218f7be64ff8bfc8e0870e252f90ac38c31051b3
Author: Mike Hommey <mh+mozilla@glandium.org>
Date:   Tue,  9 Dec 2025 08:14:36 +0000

Bug 2004178 - Avoid errors running repack_rust.py on Windows. r=firefox-build-system-reviewers,ahochheiden

When invoking repack_rust.py to build a rust compiler rather than
download one, neither the requests nor the toml modules are used.
However, the Windows workers don't have those modules preinstalled,
and we run repack_rust.py outside a mach site that would have them.

Moving the imports to the local scope works around the issue.

Somehow, while gpg is available on the Windows workers, it doesn't work
properly, but, like above, it's only used for the download code path,
so move the call to setup_gpg to where it's relevant.

Differential Revision: https://phabricator.services.mozilla.com/D275155

Diffstat:
Mtaskcluster/scripts/misc/repack_rust.py | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/taskcluster/scripts/misc/repack_rust.py b/taskcluster/scripts/misc/repack_rust.py @@ -20,8 +20,6 @@ import tempfile import textwrap from contextlib import contextmanager -import requests -import toml import zstandard @@ -33,6 +31,8 @@ def fetch_file(url): """Download a file from the given url if it's not already present. Returns the SHA-2 256-bit hash of the received file.""" + import requests + filename = os.path.basename(url) sha = hashlib.sha256() size = 4096 @@ -299,6 +299,9 @@ def build_tar_package(name, base, directory): def fetch_manifest(channel="stable", host=None, targets=()): + import requests + import toml + if channel.startswith("bors-"): assert host rev = channel[len("bors-") :] @@ -500,6 +503,7 @@ def repack( 'Patch specified, but channel "%s" is not "dev"!' "\nPatches are only for building from source." % channel ) + setup_gpg() log("Repacking rust for %s supporting %s..." % (host, targets)) manifest = fetch_manifest(channel, host, targets) log("Using manifest for rust %s as of %s." % (channel, manifest["date"])) @@ -662,5 +666,4 @@ def args(): if __name__ == "__main__": args = vars(args()) - setup_gpg() repack(**args)