From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- remote/mach_commands.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'remote/mach_commands.py') diff --git a/remote/mach_commands.py b/remote/mach_commands.py index abf5615ce0..797f313dda 100644 --- a/remote/mach_commands.py +++ b/remote/mach_commands.py @@ -139,6 +139,14 @@ def vendor_puppeteer(command_context, repository, commitish, install): "PUPPETEER_SKIP_DOWNLOAD": "1", # Don't download any build } + run_npm( + "run", + "clean", + cwd=puppeteer_dir, + env=env, + exit_on_fail=False, + ) + run_npm( "install", cwd=os.path.join(command_context.topsrcdir, puppeteer_dir), @@ -398,7 +406,7 @@ class PuppeteerRunner(MozbuildObject): """ setup() - binary = params.get("binary") or self.get_binary_path() + binary = params.get("binary") headless = params.get("headless", False) product = params.get("product", "firefox") with_cdp = params.get("cdp", False) @@ -432,10 +440,12 @@ class PuppeteerRunner(MozbuildObject): } if product == "firefox": - env["BINARY"] = binary + env["BINARY"] = binary or self.get_binary_path() env["PUPPETEER_PRODUCT"] = "firefox" env["MOZ_WEBRENDER"] = "%d" % params.get("enable_webrender", False) else: + if binary: + env["BINARY"] = binary env["PUPPETEER_CACHE_DIR"] = os.path.join( self.topobjdir, "_tests", @@ -727,6 +737,7 @@ def install_puppeteer(command_context, product, ci): puppeteer_test_dir = os.path.join(puppeteer_dir, "test") if product == "chrome": + env["PUPPETEER_PRODUCT"] = "chrome" env["PUPPETEER_CACHE_DIR"] = os.path.join( command_context.topobjdir, "_tests", puppeteer_dir, ".cache" ) @@ -744,6 +755,8 @@ def install_puppeteer(command_context, product, ci): # Always use the `ci` command to not get updated sub-dependencies installed. run_npm("ci", cwd=puppeteer_dir_full_path, env=env) + + # Build Puppeteer and the code to download browsers. run_npm( "run", "build", @@ -751,6 +764,9 @@ def install_puppeteer(command_context, product, ci): env=env, ) + # Run post install steps, including downloading the Chrome browser if requested + run_npm("run", "postinstall", cwd=puppeteer_dir_full_path, env=env) + def exit(code, error=None): if error is not None: -- cgit v1.2.3