build(bazel): fix bazel aio regressions after rebase

The aio-bazel-migration branch was rebased onto main to include runfiles
support on windows.
This commit is contained in:
Derek Cormier 2022-06-17 10:44:16 -07:00 committed by Joey Perrott
parent c5acfb2b33
commit 7642abfb7a
4 changed files with 50 additions and 4 deletions

View file

@ -182,7 +182,7 @@ architect(
name = "build",
args = [
"site:build:stable",
"--outputPath=../$(@D)",
"--output-path=../$(@D)",
],
chdir = package_name(),
configuration_env_vars = ["NG_BUILD_CACHE"],
@ -211,14 +211,14 @@ architect_test(
name = "e2e",
args = [
"site:e2e",
"--no-webdriverUpdate",
"--no-webdriver-update",
],
chdir = package_name(),
configuration_env_vars = ["NG_BUILD_CACHE"],
data = E2E_FILES + E2E_DEPS,
env = {
"CHROMEDRIVER_BIN": "../$(CHROMEDRIVER)",
"CHROME_BIN": "../$(CHROMIUM)",
"CHROMEDRIVER_BIN": "../$(CHROMEDRIVER)",
},
toolchains = [
"@aio_npm//@angular/dev-infra-private/bazel/browsers/chromium:toolchain_alias",

View file

@ -1,6 +1,29 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const os = require('os');
if (os.platform() === 'win32') {
/*
For some unknown reason, the symlinked copy of chromium under runfiles won't run under
karma on Windows. Instead, modify the CHROME_BIN env var to point to the chrome binary
under external/ in the execroot.
CHROME_BIN is set to the make var $(CHROMIUM) in aio/BUILD.bazel, which points to chrome
under runfiles and thus starts with ../. Because we run architect with a chdir into aio,
$(CHROMIUM) additionally has a second ../.
First, back out of
bazel-out/x64_windows-fastbuild/bin/aio/test.bat.runfiles/angular/aio
Then go into
external/
and then into
org_chromium_chromium_windows/chrome-win
to cancel out the leading ../../
*/
process.env.CHROME_BIN = `../../../../../../../external/org_chromium_chromium_windows/chrome-win/${process.env.CHROME_BIN}`;
}
module.exports = function (config) {
config.set({
basePath: '',

View file

@ -4,6 +4,29 @@
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
const path = require('path')
const os = require('os');
if (os.platform() === 'win32') {
/*
For some unknown reason, the symlinked copy of chromium under runfiles won't run under
karma on Windows. Instead, modify the CHROME_BIN env var to point to the chrome binary
under external/ in the execroot.
CHROME_BIN is set to the make var $(CHROMIUM) in aio/BUILD.bazel, which points to chrome
under runfiles and thus starts with ../. Because we run architect with a chdir into aio,
$(CHROMIUM) additionally has a second ../.
First, back out of
bazel-out/x64_windows-fastbuild/bin/aio/e2e.bat.runfiles/angular/aio
Then go into
external/
and then into
org_chromium_chromium_windows/chrome-win
to cancel out the leading ../../
*/
process.env.CHROME_BIN = `../../../../../../../external/org_chromium_chromium_windows/chrome-win/${process.env.CHROME_BIN}`;
}
/**
* @type { import("protractor").Config }
*/

View file

@ -6,7 +6,7 @@ module.exports = function getImageDimensions() {
let error;
for (const basePath of basePaths) {
try {
return sizeOf(resolve(basePath, path));
return sizeOf(join(basePath, path));
} catch (e) {
// Fall back to next basePath if not found
error = e;