From d5649814525d62d787a1dbeb596ef6ac5d2c7d38 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Thu, 2 Feb 2017 11:26:15 +0000 Subject: Rollback of commit 46dacc9f9407065bc3db0938dfda97724911cee2. *** Reason for rollback *** Introduced some code that doesn't work on macOS blaze-out/host/bin/tools/objc/xcodegen: line 181: mapfile: command not found blaze-out/host/bin/tools/objc/xcodegen: line 184: declare: -A: invalid option *** Original change description *** Automated [] rollback of commit 00ac342f386be8b8ce1bdb11515c7828e86903c0. *** Reason for rollback *** Roll forward commit bbfa9fa5ad1dd66ecedcb136a4ff3d0f8d397b9b with fix *** Original change description *** Automated [] rollback of commit bbfa9fa5ad1dd66ecedcb136a4ff3d0f8d397b9b. *** Reason for rollback *** Wrong submit with unresolved issues *** Original change description *** Java template windows performance Address issue #2426 Closes #2427. -- PiperOrigin-RevId: 146347067 MOS_MIGRATED_REVID=146347067 --- .../build/lib/bazel/rules/java/java_stub_template.txt | 17 +++-------------- .../lib/bazel/rules/java/java_stub_template_windows.txt | 3 ++- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt index 3659d93b01..36575d52ab 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt @@ -74,10 +74,10 @@ die() { } # Windows -PLATFORM="$OSTYPE" +PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" function is_windows() { # On windows, the shell test actually running on msys - if [[ "${PLATFORM}" =~ msys* ]]; then + if [[ "${PLATFORM}" =~ msys_nt* ]]; then true else false @@ -177,22 +177,11 @@ if [ -z "$RUNFILES_MANIFEST_ONLY" ]; then fi } else - # Read file into my_array - mapfile -t my_array < $RUNFILES_MANIFEST_FILE - - # Process each runfile line into a [key,value] entry in runfiles_array - declare -A runfiles_array - for line in "${my_array[@]}" - do - line_split=($line) - runfiles_array[${line_split[0]}]=${line_split[1]} - done - function rlocation() { if [[ "$1" = /* ]]; then echo $1 else - echo ${runfiles_array[$1]} + echo $(grep "^$1 " $RUNFILES_MANIFEST_FILE | awk '{ print $2 }') fi } fi diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt index b367f86dd7..179d55cdee 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt @@ -20,12 +20,13 @@ @SETLOCAL ENABLEEXTENSIONS @set bash_path=%bash_exe_path% +@set cygpath_path=%cygpath_exe_path% @rem launcher=${$0%.cmd} @set launcher=%~dp0%~n0 @rem sh_path=$($cygpath_path -m $launcher) -@set sh_path=%launcher:\=/% +@for /f %%i in ('%cygpath_path% -m %launcher%') do @set sh_path=%%i @rem replaces $ with \$ in $*, then puts it on the command line @rem Cribbed from here: http://ss64.com/nt/syntax-replace.html -- cgit v1.2.3