Skip to content

Commit

Permalink
fix(examples): fix jest example on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Holzer committed Sep 17, 2020
1 parent f7819fc commit a090e56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions common.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ build:debug --compilation_mode=dbg
# This prevents accidentally depending on this feature, which Bazel will remove.
build --nolegacy_external_runfiles

# Do not build runfile forests by default. If an execution strategy relies on runfile
# forests, the forest is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
# and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
build --nobuild_runfile_links

# Turn on --incompatible_strict_action_env which was on by default
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
Expand Down
4 changes: 0 additions & 4 deletions examples/jest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jest_test(
] + glob(["__snapshots__/*.snap"]),
jest_config = ":jest.config.js",
tags = [
# Need to set the pwd to avoid jest needing a runfiles helper
# Windows users with permissions can use --enable_runfiles
# to make this test work
"no-bazelci-windows",
# TODO: why does this fail almost all the time, but pass on local Mac?
"no-bazelci-mac",
],
Expand Down
8 changes: 6 additions & 2 deletions internal/node/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,18 @@ fi

# Export the location of the runfiles helpers script
export BAZEL_NODE_RUNFILES_HELPER=$(rlocation "TEMPLATED_runfiles_helper_script")
if [[ "${BAZEL_NODE_RUNFILES_HELPER}" != /* ]] && [[ ! "${BAZEL_NODE_RUNFILES_HELPER}" =~ ^[A-Z]:[\\/] ]]; then
# Paths can be with lower and upper case on windows because of the msys64 package in the powershell
# https://regex101.com/r/c0Gjn8/1/
if [[ "${BAZEL_NODE_RUNFILES_HELPER}" != /* ]] && [[ ! "${BAZEL_NODE_RUNFILES_HELPER}" =~ ^[A-Za-z]:[\/\\]; then
export BAZEL_NODE_RUNFILES_HELPER=$(pwd)/${BAZEL_NODE_RUNFILES_HELPER}
fi

# Export the location of the require patch script as it can be used to bootstrap
# node require patch if needed
export BAZEL_NODE_PATCH_REQUIRE=$(rlocation "TEMPLATED_require_patch_script")
if [[ "${BAZEL_NODE_PATCH_REQUIRE}" != /* ]] && [[ ! "${BAZEL_NODE_PATCH_REQUIRE}" =~ ^[A-Z]:[\\/] ]]; then
# Paths can be with lower and upper case on windows because of the msys64 package in the powershell
# https://regex101.com/r/c0Gjn8/1/
if [[ "${BAZEL_NODE_PATCH_REQUIRE}" != /* ]] && [[ ! "${BAZEL_NODE_PATCH_REQUIRE}" =~ ^[A-Za-z]:[\/\\]; then
export BAZEL_NODE_PATCH_REQUIRE=$(pwd)/${BAZEL_NODE_PATCH_REQUIRE}
fi

Expand Down

0 comments on commit a090e56

Please sign in to comment.