-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NA): downgrades rules nodejs into v4.7.0 (#130347)
* chore(NA): downgrade rules nodejs into v4.0.0 * chore(NA): include windows patch * chore(NA): polish downgrade code * chore(NA): include yarn.lock
- Loading branch information
Showing
7 changed files
with
69 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/dev/bazel/rules_nodejs_patches/exclude_npm_directory_copies_from_remote_cache.patch
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
src/dev/bazel/rules_nodejs_patches/normalized_paths_for_windows_runfiles.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh | ||
index fd832d02..64820f48 100644 | ||
--- a/internal/node/launcher.sh | ||
+++ b/internal/node/launcher.sh | ||
@@ -13,6 +13,32 @@ | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
+# It helps to determine if we are running on a Windows environment (excludes WSL as it acts like Unix) | ||
+function isWindows { | ||
+ case "$(uname -s)" in | ||
+ CYGWIN*) local IS_WINDOWS=1 ;; | ||
+ MINGW*) local IS_WINDOWS=1 ;; | ||
+ MSYS_NT*) local IS_WINDOWS=1 ;; | ||
+ *) local IS_WINDOWS=0 ;; | ||
+ esac | ||
+ | ||
+ echo $IS_WINDOWS | ||
+ return | ||
+} | ||
+ | ||
+# It helps to normalizes paths when running on Windows. | ||
+# | ||
+# Example: | ||
+# C:/Users/XUser/_bazel_XUser/7q7kkv32/execroot/A/b/C -> /c/users/xuser/_bazel_xuser/7q7kkv32/execroot/a/b/c | ||
+function normalizeWindowsPath { | ||
+ # Apply the followings paths transformations to normalize paths on Windows | ||
+ # -process driver letter | ||
+ # -convert path separator | ||
+ # -lowercase everything | ||
+ echo $(sed -e 's#^\(.\):#/\L\1#' -e 's#\\#/#g' -e 's/[A-Z]/\L&/g' <<< "$1") | ||
+ return | ||
+} | ||
+ | ||
# --- begin runfiles.bash initialization v2 --- | ||
# Copy-pasted from the Bazel Bash runfiles library v2. | ||
set -uo pipefail; f=build_bazel_rules_nodejs/third_party/github.com/bazelbuild/bazel/tools/bash/runfiles/runfiles.bash | ||
@@ -49,7 +75,13 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ | ||
# Case 6a is handled like case 3. | ||
if [[ -n "${RUNFILES_MANIFEST_ONLY:-}" ]]; then | ||
# Windows only has a manifest file instead of symlinks. | ||
- RUNFILES=${RUNFILES_MANIFEST_FILE%/MANIFEST} | ||
+ if [[ $(isWindows) -eq "1" ]]; then | ||
+ # If Windows normalizing the path and case insensitive removing the `/MANIFEST` part of the path | ||
+ NORMALIZED_RUNFILES_MANIFEST_FILE_PATH=$(normalizeWindowsPath $RUNFILES_MANIFEST_FILE) | ||
+ RUNFILES=$(sed 's|\/MANIFEST$||i' <<< $NORMALIZED_RUNFILES_MANIFEST_FILE_PATH) | ||
+ else | ||
+ RUNFILES=${RUNFILES_MANIFEST_FILE%/MANIFEST} | ||
+ fi | ||
elif [[ -n "${TEST_SRCDIR:-}" ]]; then | ||
# Case 4, bazel has identified runfiles for us. | ||
RUNFILES="${TEST_SRCDIR:-}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters