From 818ad64b42714af36b077598c5a1e15e297f8502 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 5 Nov 2021 18:39:52 +0100 Subject: [PATCH] feat(bazel): expose toolchain aliases for exposed browsers Exposes toolchain alias targets for all exposed browsers by the dev-infra Bazel package. i.e. Chromium and Firefox. These can then be used within integration tests, or other e.g. webdriver tests using Bazel make variable expansion. --- bazel/browsers/chromium/BUILD.bazel | 11 +++++++++++ bazel/browsers/firefox/BUILD.bazel | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/bazel/browsers/chromium/BUILD.bazel b/bazel/browsers/chromium/BUILD.bazel index b450eaf09..85c4533e0 100644 --- a/bazel/browsers/chromium/BUILD.bazel +++ b/bazel/browsers/chromium/BUILD.bazel @@ -1,4 +1,5 @@ load("@io_bazel_rules_webtesting//web:web.bzl", "browser") +load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias") package(default_visibility = ["//visibility:public"]) @@ -27,6 +28,16 @@ browser( }), ) +browser_toolchain_alias( + name = "toolchain_alias", + metadata = select({ + "//bazel/constraints:linux_x64": "@org_chromium_chromium_linux_x64//:metadata", + "//bazel/constraints:macos_x64": "@org_chromium_chromium_macos_x64//:metadata", + "//bazel/constraints:macos_arm64": "@org_chromium_chromium_macos_arm64//:metadata", + "//bazel/constraints:windows_x64": "@org_chromium_chromium_windows//:metadata", + }), +) + # Make source files available for distribution via pkg_npm filegroup( name = "files", diff --git a/bazel/browsers/firefox/BUILD.bazel b/bazel/browsers/firefox/BUILD.bazel index 5133972dc..9ce2e6885 100644 --- a/bazel/browsers/firefox/BUILD.bazel +++ b/bazel/browsers/firefox/BUILD.bazel @@ -1,4 +1,5 @@ load("@io_bazel_rules_webtesting//web:web.bzl", "browser") +load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias") package(default_visibility = ["//visibility:public"]) @@ -34,6 +35,16 @@ browser( }), ) +browser_toolchain_alias( + name = "toolchain_alias", + metadata = select({ + "//bazel/constraints:linux_x64": "@org_mozilla_firefox_linux_x64//:metadata", + # Firefox has a launcher that conditionally starts x64/arm64 + "//bazel/constraints:macos_x64": "@org_mozilla_firefox_macos//:metadata", + "//bazel/constraints:macos_arm64": "@org_mozilla_firefox_macos//:metadata", + }), +) + # Make source files available for distribution via pkg_npm filegroup( name = "files",