(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PLATFORM) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(uname)} {(-s)}) (C {(tr)} {(SQ <A-Z>)} {(SQ <a-z>)})] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [66 82] ) ) } spids: [64] ) ] spids: [64] ) (FuncDef name: is_windows body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_EqualTilde left: {(DQ (${ VSub_Name PLATFORM))} right: {(msys_nt) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(true)})] spids: [-1 116] ) ] else_action: [(C {(false)})] spids: [122 128] ) ] spids: [91] ) spids: [85 90] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH_TO_BAZEL_BIN) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(rlocation)} {(io_bazel/src/bazel)})]) left_token: <Left_CommandSub "$("> spids: [137 141] ) } spids: [136] ) ] spids: [136] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH_TO_BAZEL_WRAPPER) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(dirname)} { (CommandSubPart command_list: (CommandList children: [(C {(rlocation)} {(io_bazel/src/test/shell/bin/bazel)})] ) left_token: <Left_CommandSub "$("> spids: [148 152] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [145 153] ) ) } spids: [143] ) ] spids: [143] ) (If arms: [ (if_arm cond: [(Sentence child:(C {(is_windows)}) terminator:<Op_Semi ";">)] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH_TO_BAZEL_WRAPPER) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(cygpath)} {(-u)} {(DQ ($ VSub_Name "$PATH_TO_BAZEL_WRAPPER"))}) ] ) left_token: <Left_CommandSub "$("> spids: [175 183] ) ) } spids: [173] ) ] spids: [173] ) ] spids: [-1 170] ) ] spids: [-1 186] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ (${ VSub_Name PATH_TO_BAZEL_WRAPPER) (/bazel))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Unable to find the Bazel binary at ") ($ VSub_Name "$PATH_TO_BAZEL_WRAPPER") (/bazel) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[217])] ) (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">) ] spids: [-1 206] ) ] spids: [-1 226] ) (C {(export)} {(Lit_VarLike "PATH=") (DQ ($ VSub_Name "$PATH_TO_BAZEL_WRAPPER") (":") ($ VSub_Name "$PATH"))} ) (AndOr children: [ (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$TEST_SRCDIR"))} {(Lit_Other "]")}) (BraceGroup children: [ (Sentence child: (SimpleCommand words: [{(echo)} {(DQ ("TEST_SRCDIR not set!"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[267])] ) terminator: <Op_Semi ";"> ) (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">) ] spids: [259] ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BAZEL_RUNFILES) op: Equal rhs: {(DQ ($ VSub_Name "$TEST_SRCDIR") (/io_bazel))} spids: [278] ) ] spids: [278] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(type)} {(rlocation)})] negated:True) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[294])] ) terminator: <Op_Semi ";"> ) ] action: [ (FuncDef name: rlocation body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Number "$1"))} right: {(/) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(echo)} {($ VSub_Number "$1")})] spids: [-1 327] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_Name "$TEST_SRCDIR") (/) ($ VSub_Number "$1"))}) ] spids: [335 347] ) ] spids: [308] ) spids: [302 307] ) (C {(export)} {(-f)} {(rlocation)}) ] spids: [-1 299] ) ] spids: [-1 359] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:workspace_file) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/WORKSPACE))} spids: [365] ) ] spids: [365] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazel_tree) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(rlocation)} {(io_bazel/src/test/shell/bazel/doc-srcs.zip)})] ) left_token: <Left_CommandSub "$("> spids: [379 383] ) ) } spids: [377] ) ] spids: [377] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazel_data) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES))} spids: [386] ) ] spids: [386] ) (If arms: [ (if_arm cond: [(Sentence child:(C {(is_windows)}) terminator:<Op_Semi ";">)] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:jdk_dir) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(cygpath)} {(-m)} { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(cd)} { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(local_jdk/bin/java.exe)}) ] ) left_token: <Left_CommandSub "$("> spids: [415 419] ) (/../..) } ) terminator: <Op_Semi ";"> ) (C {(pwd)}) ] ) left_token: <Left_CommandSub "$("> spids: [412 424] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [407 425] ) ) } spids: [405] ) ] spids: [405] ) ] spids: [-1 402] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:jdk_dir) op: Equal rhs: {(DQ (${ VSub_Name TEST_SRCDIR) (/local_jdk))} spids: [431] ) ] spids: [431] ) ] spids: [428 439] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:langtools) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(rlocation)} {(io_bazel/src/test/shell/bazel/langtools.jar)})] ) left_token: <Left_CommandSub "$("> spids: [443 447] ) ) } spids: [441] ) ] spids: [441] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tools_dir) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(dirname)} { (CommandSubPart command_list: (CommandList children: [(C {(rlocation)} {(io_bazel/tools/BUILD)})] ) left_token: <Left_CommandSub "$("> spids: [459 463] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [456 464] ) ) } spids: [454] ) ] spids: [454] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:langtools_dir) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(dirname)} { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(io_bazel/third_party/java/jdk/langtools/BUILD)}) ] ) left_token: <Left_CommandSub "$("> spids: [472 476] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [469 477] ) ) } spids: [467] ) ] spids: [467] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:javabuilder_path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(find)} {(${ VSub_Name BAZEL_RUNFILES)} {(-name)} {(JavaBuilder_) (Lit_Other "*") (.jar)} ) ] ) left_token: <Left_CommandSub "$("> spids: [486 498] ) ) } spids: [484] ) ] spids: [484] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:langtools_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/java/jdk/langtools/javac.jar))} spids: [501] ) ] spids: [501] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:singlejar_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/java_tools/singlejar/SingleJar_deploy.jar))} spids: [509] ) ] spids: [509] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:genclass_path) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) ( /src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/GenClass_deploy.jar ) ) } spids: [517] ) ] spids: [517] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:junitrunner_path) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) ( /src/java_tools/junitrunner/java/com/google/testing/junit/runner/Runner_deploy.jar ) ) } spids: [525] ) ] spids: [525] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ijar_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/ijar/ijar))} spids: [533] ) ] spids: [533] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:process_wrapper) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/main/tools/process-wrapper))} spids: [545] ) ] spids: [545] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:linux_sandbox) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/main/tools/linux-sandbox))} spids: [553] ) ] spids: [553] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:actoolwrapper_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/actoolwrapper/actoolwrapper.sh))} spids: [565] ) ] spids: [565] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ibtoolwrapper_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/ibtoolwrapper/ibtoolwrapper.sh))} spids: [573] ) ] spids: [573] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:swiftstdlibtoolwrapper_path) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh) ) } spids: [581] ) ] spids: [581] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:momcwrapper_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/momcwrapper/momcwrapper.sh))} spids: [589] ) ] spids: [589] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bundlemerge_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/objc_tools/bundlemerge/bundlemerge_deploy.jar))} spids: [597] ) ] spids: [597] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plmerge_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/objc_tools/plmerge/plmerge_deploy.jar))} spids: [605] ) ] spids: [605] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:xcodegen_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/objc_tools/xcodegen/xcodegen_deploy.jar))} spids: [613] ) ] spids: [613] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stdredirect_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/stdredirect/StdRedirect.dylib))} spids: [621] ) ] spids: [621] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:realpath_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/realpath/realpath))} spids: [629] ) ] spids: [629] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:environment_plist_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/environment/environment_plist.sh))} spids: [637] ) ] spids: [637] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:xcrunwrapper_path) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/tools/xcode/xcrunwrapper/xcrunwrapper.sh))} spids: [645] ) ] spids: [645] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:testdata_path) op: Equal rhs: {(${ VSub_Name BAZEL_RUNFILES) (/src/test/shell/bazel/testdata)} spids: [657] ) ] spids: [657] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:python_server) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) (/src/test/shell/bazel/testing_server.py))} spids: [663] ) ] spids: [663] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MACHINE_TYPE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(uname)} {(-m)})]) left_token: <Left_CommandSub "$("> spids: [677 681] ) ) } spids: [675] ) ] spids: [675] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:MACHINE_IS_64BIT) op:Equal rhs:{(SQ <no>)} spids:[684])] spids: [684] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name MACHINE_TYPE))} {(Lit_Other "=")} {(SQ <amd64>)} {(-o)} {(DQ (${ VSub_Name MACHINE_TYPE))} {(Lit_Other "=")} {(SQ <x86_64>)} {(-o)} {(DQ (${ VSub_Name MACHINE_TYPE))} {(Lit_Other "=")} {(SQ <s390x>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MACHINE_IS_64BIT) op: Equal rhs: {(SQ <yes>)} spids: [739] ) ] spids: [739] ) ] spids: [-1 736] ) ] spids: [-1 744] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:MACHINE_IS_Z) op:Equal rhs:{(SQ <no>)} spids:[747])] spids: [747] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name MACHINE_TYPE))} {(Lit_Other "=")} {(SQ <s390x>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MACHINE_IS_Z) op: Equal rhs: {(SQ <yes>)} spids: [774] ) ] spids: [774] ) ] spids: [-1 771] ) ] spids: [-1 779] ) (Case to_match: {(DQ (${ VSub_Name PLATFORM))} arms: [ (case_arm pat_list: [{(darwin)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name MACHINE_IS_64BIT))} {(Lit_Other "=")} {(SQ <yes>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_compiler) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/protobuf/protoc-osx-x86_64.exe) ) } spids: [819] ) ] spids: [819] ) ] spids: [-1 816] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_compiler) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/protobuf/protoc-osx-x86_32.exe) ) } spids: [831] ) ] spids: [831] ) ] spids: [828 840] ) ] spids: [793 794 843 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name MACHINE_IS_64BIT))} {(Lit_Other "=")} {(SQ <yes>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name MACHINE_IS_Z))} {(Lit_Other "=")} {(SQ <yes>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_compiler) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (//third_party/protobuf/protoc-linux-s390x_64.exe) ) } spids: [894] ) ] spids: [894] ) ] spids: [-1 891] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_compiler) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/protobuf/protoc-linux-x86_64.exe) ) } spids: [906] ) ] spids: [906] ) ] spids: [903 915] ) ] spids: [-1 869] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_compiler) op: Equal rhs: { (DQ (${ VSub_Name BAZEL_RUNFILES) (/third_party/protobuf/protoc-linux-x86_32.exe) ) } spids: [921] ) ] spids: [921] ) ] spids: [918 930] ) ] spids: [846 847 933 -1] ) ] spids: [782 790 935] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} { (BracedVarSub token: <VSub_Name RUNFILES_MANIFEST_ONLY> suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(x)}) spids: [944 948] ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_jar) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) ("/third_party/protobuf/protobuf-*.jar"))} spids: [956] ) ] spids: [956] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:junit_jar) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) ("/third_party/junit/junit-*.jar"))} spids: [965] ) ] spids: [965] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hamcrest_jar) op: Equal rhs: {(DQ (${ VSub_Name BAZEL_RUNFILES) ("/third_party/hamcrest/hamcrest-*.jar"))} spids: [974] ) ] spids: [974] ) ] spids: [-1 953] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:protoc_jar) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(io_bazel/third_party/protobuf/protobuf-.) (Lit_Other "*") (.jar)} ) ] ) left_token: <Left_CommandSub "$("> spids: [986 992] ) } spids: [985] ) ] spids: [985] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:junit_jar) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(io_bazel/third_party/junit/junit-.) (Lit_Other "*") (.jar)} ) ] ) left_token: <Left_CommandSub "$("> spids: [996 1002] ) } spids: [995] ) ] spids: [995] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hamcrest_jar) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(io_bazel/third_party/hamcrest/hamcrest-.) (Lit_Other "*") (.jar)} ) ] ) left_token: <Left_CommandSub "$("> spids: [1006 1012] ) } spids: [1005] ) ] spids: [1005] ) ] spids: [982 1014] ) (FuncDef name: copy_tools_directory body: (BraceGroup children: [ (C {(cp)} {(-RL)} {(${ VSub_Name tools_dir) (/) (Lit_Other "*")} {(tools)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(tools/jdk/BUILD.) (Lit_Other "*")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(cp)} {(tools/jdk/BUILD.) (Lit_Other "*")} {(tools/jdk/BUILD)}) (C {(chmod)} {(Lit_Other "+") (w)} {(tools/jdk/BUILD)}) ] spids: [-1 1058] ) ] spids: [-1 1077] ) (C {(cp)} {(${ VSub_Name langtools)} {(tools/jdk/langtools.jar)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(tools/jdk/BUILD)} spids: [1095] ) (HereDoc op_id: Redir_DLess fd: -1 body: {("filegroup(name = \"test-langtools\", srcs = [\"langtools.jar\"])\n")} do_expansion: False here_end: EOF was_filled: True spids: [1098] ) ] ) (C {(mkdir)} {(-p)} {(third_party/java/jdk/langtools)}) (C {(cp)} {(-R)} {(${ VSub_Name langtools_dir) (/) (Lit_Other "*")} {(third_party/java/jdk/langtools)} ) (C {(chmod)} {(-R)} {(Lit_Other "+") (w)} {(.)}) (C {(mkdir)} {(-p)} {(tools/defaults)}) (C {(touch)} {(tools/defaults/BUILD)}) (C {(mkdir)} {(-p)} {(third_party/py/gflags)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(third_party/py/gflags/BUILD)} spids: [1158] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("licenses([") (Right_DoubleQuote "\"") (notice) (Right_DoubleQuote "\"") ("])\n") ("package(default_visibility = [") (Right_DoubleQuote "\"") ("//visibility:public") (Right_DoubleQuote "\"") ("])\n") ("\n") ("py_library(\n") (" name = ") (Right_DoubleQuote "\"") (gflags) (Right_DoubleQuote "\"") (",\n") (")\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1162] ) ] ) ] spids: [1026] ) spids: [1020 1025] ) (FuncDef name: is_tools_directory body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(third_party)} {(tools)} {(src)}] action: [(C {(true)})] spids: [1207 1212 1218 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(false)})] spids: [1221 1222 1228 -1] ) ] spids: [1198 1204 1231] ) ] spids: [1195] ) spids: [1189 1194] ) (FuncDef name: copy_examples body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:EXAMPLE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(cd)} { (CommandSubPart command_list: (CommandList children: [ (C {(dirname)} { (CommandSubPart command_list: (CommandList children: [ (C {(rlocation)} {(io_bazel/examples/cpp/BUILD)} ) ] ) left_token: <Left_CommandSub "$("> spids: [1256 1260] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [1253 1261] ) (/..) } ) terminator: <Op_Semi ";"> ) (C {(pwd)}) ] ) left_token: <Left_CommandSub "$("> spids: [1250 1266] ) ) } spids: [1248] ) ] spids: [1248] ) (C {(cp)} {(-RL)} {(${ VSub_Name EXAMPLE)} {(.)}) (C {(chmod)} {(-R)} {(Lit_Other "+") (w)} {(.)}) ] spids: [1245] ) spids: [1239 1244] ) (FuncDef name: pick_random_unused_tcp_port body: (BraceGroup children: [ (C {(perl)} {(-MSocket)} {(-e)} { (SQ <"\n"> <"sub CheckPort {\n"> <" my ($port) = @_;\n"> <" socket(TCP_SOCK, PF_INET, SOCK_STREAM, getprotobyname(\"tcp\"))\n"> <" || die \"socket(TCP): $!\";\n"> <" setsockopt(TCP_SOCK, SOL_SOCKET, SO_REUSEADDR, 1)\n"> <" || die \"setsockopt(TCP): $!\";\n"> <" return 0 unless bind(TCP_SOCK, sockaddr_in($port, INADDR_ANY));\n"> <" socket(UDP_SOCK, PF_INET, SOCK_DGRAM, getprotobyname(\"udp\"))\n"> <" || die \"socket(UDP): $!\";\n"> <" return 0 unless bind(UDP_SOCK, sockaddr_in($port, INADDR_ANY));\n"> <" return 1;\n"> <"}\n"> <"for (1 .. 128) {\n"> <" my ($port) = int(rand() * 27000 + 32760);\n"> <" if (CheckPort($port)) {\n"> <" print \"$port\\n\";\n"> <" exit 0;\n"> <" }\n"> <"}\n"> <"print \"NO_FREE_PORT_FOUND\\n\";\n"> <"exit 1;\n"> ) } ) ] spids: [1307] ) spids: [1302 1306] ) (Case to_match: {(DQ (${ VSub_Name PLATFORM))} arms: [ (case_arm pat_list: [{(darwin)}] action: [ (FuncDef name: sha256sum body: (BraceGroup children: [ (Pipeline children: [ (C {(cat)} {(DQ ($ VSub_Number "$1"))}) (C {(shasum)} {(-a)} {(256)}) (C {(cut)} {(-f)} {(1)} {(-d)} {(DQ (" "))}) ] negated: False ) ] spids: [1374] ) spids: [1368 1373] ) ] spids: [1364 1365 1409 -1] ) (case_arm pat_list:[{(Lit_Other "*")}] spids:[141214131420-1]) ] spids: [1353 1361 1422] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazel_root) op: Equal rhs: {(DQ (${ VSub_Name TEST_TMPDIR) (/root))} spids: [1438] ) ] spids: [1438] ) (C {(mkdir)} {(-p)} {(DQ (${ VSub_Name bazel_root))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazel_javabase) op: Equal rhs: {(DQ (${ VSub_Name jdk_dir))} spids: [1457] ) ] spids: [1457] ) (C {(echo)} {(DQ ("bazel binary is at ") ($ VSub_Name "$PATH_TO_BAZEL_WRAPPER"))}) (C {(unset)} {(JAVA_RUNFILES)}) (FuncDef name: setup_bazelrc body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$TEST_TMPDIR") (/bazelrc)} spids: [1492] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("# Set the user root properly for this test invocation.\n") ("startup --output_user_root=") (${ VSub_Name bazel_root) ("\n") ("# Set the correct javabase from the outer bazel invocation.\n") ("startup --host_javabase=") (${ VSub_Name bazel_javabase) ("\n") ("\n") ( "# Print all progress messages because we regularly grep the output in tests.\n" ) ("common --show_progress_rate_limit=-1\n") ("\n") ("# Disable terminal-specific features.\n") ("common --color=no --curses=no\n") ("\n") ("build -j 8\n") (BracedVarSub token: <VSub_Name EXTRA_BAZELRC> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [1519 1522] ) ("\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1496] ) ] ) ] spids: [1487] ) spids: [1481 1486] ) (FuncDef name: setup_android_support body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ANDROID_NDK) op: Equal rhs: {($ VSub_Name "$PWD") (/android_ndk)} spids: [1536] ) ] spids: [1536] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ANDROID_SDK) op: Equal rhs: {($ VSub_Name "$PWD") (/android_sdk)} spids: [1541] ) ] spids: [1541] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NDK_SRCDIR) op: Equal rhs: {($ VSub_Name "$TEST_SRCDIR") (/androidndk/ndk)} spids: [1559] ) ] spids: [1559] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SDK_SRCDIR) op: Equal rhs: {($ VSub_Name "$TEST_SRCDIR") (/androidsdk)} spids: [1564] ) ] spids: [1564] ) (C {(mkdir)} {(-p)} {($ VSub_Name "$ANDROID_NDK")}) (C {(mkdir)} {(-p)} {($ VSub_Name "$ANDROID_SDK")}) (ForEach iter_name: i iter_words: [{($ VSub_Name "$NDK_SRCDIR") (/) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Name "$i")})] ) left_token: <Left_CommandSub "$("> spids: [1604 1608] ) ) } right: {(DQ (BUILD))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(ln)} {(-s)} {(DQ ($ VSub_Name "$i"))} { (DQ ($ VSub_Name "$ANDROID_NDK") (/) (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Name "$i")})] ) left_token: <Left_CommandSub "$("> spids: [1634 1638] ) ) } ) ] spids: [-1 1620] ) ] spids: [-1 1642] ) ] spids: [1596 1645] ) spids: [1590 1594] ) (ForEach iter_name: i iter_words: [{($ VSub_Name "$SDK_SRCDIR") (/) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [ (C {(ln)} {(-s)} {(DQ ($ VSub_Name "$i"))} { (DQ ($ VSub_Name "$ANDROID_SDK") (/) (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Name "$i")})] ) left_token: <Left_CommandSub "$("> spids: [1674 1678] ) ) } ) ] spids: [1660 1682] ) spids: [1654 1658] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ANDROID_SDK_API_LEVEL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(ls)} {($ VSub_Name "$SDK_SRCDIR") (/platforms)}) (C {(cut)} {(-d)} {(SQ <->)} {(-f)} {(2)}) (C {(sort)} {(-n)}) (C {(tail)} {(-1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1690 1721] ) } spids: [1689] ) ] spids: [1687] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ANDROID_NDK_API_LEVEL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(ls)} {($ VSub_Name "$NDK_SRCDIR") (/platforms)}) (C {(cut)} {(-d)} {(SQ <->)} {(-f)} {(2)}) (C {(sort)} {(-n)}) (C {(tail)} {(-1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1727 1758] ) } spids: [1726] ) ] spids: [1724] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ANDROID_SDK_TOOLS_VERSION) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(ls)} {($ VSub_Name "$SDK_SRCDIR") (/build-tools)}) (C {(sort)} {(-n)}) (C {(tail)} {(-1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1764 1781] ) } spids: [1763] ) ] spids: [1761] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(WORKSPACE)} spids:[1786]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("android_ndk_repository(\n") (" name = ") (Right_DoubleQuote "\"") (androidndk) (Right_DoubleQuote "\"") (",\n") (" path = ") (Right_DoubleQuote "\"") ($ VSub_Name "$ANDROID_NDK") (Right_DoubleQuote "\"") (",\n") (" api_level = ") ($ VSub_Name "$ANDROID_NDK_API_LEVEL") (",\n") (")\n") ("\n") ("android_sdk_repository(\n") (" name = ") (Right_DoubleQuote "\"") (androidsdk) (Right_DoubleQuote "\"") (",\n") (" path = ") (Right_DoubleQuote "\"") ($ VSub_Name "$ANDROID_SDK") (Right_DoubleQuote "\"") (",\n") (" build_tools_version = ") (Right_DoubleQuote "\"") ($ VSub_Name "$ANDROID_SDK_TOOLS_VERSION") (Right_DoubleQuote "\"") (",\n") (" api_level = ") ($ VSub_Name "$ANDROID_SDK_API_LEVEL") (",\n") (")\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1790] ) ] ) ] spids: [1533] ) spids: [1527 1532] ) (FuncDef name: setup_javatest_common body: (BraceGroup children: [ (C {(mkdir)} {(-p)} {(third_party)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(third_party/BUILD)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("package(default_visibility = [") (Right_DoubleQuote "\"") ("//visibility:public") (Right_DoubleQuote "\"") ("])\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1870] ) (Redir op_id: Redir_Great fd: -1 arg_word: {(third_party/BUILD)} spids: [1873] ) ] ) ] spids: [-1 1865] ) ] spids: [-1 1882] ) (AndOr children: [ (C {(Lit_Other "[")} {(-e)} {(third_party/junit.jar)} {(Lit_Other "]")}) (C {(ln)} {(-s)} {(${ VSub_Name junit_jar)} {(third_party/junit.jar)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other "[")} {(-e)} {(third_party/hamcrest.jar)} {(Lit_Other "]")}) (C {(ln)} {(-s)} {(${ VSub_Name hamcrest_jar)} {(third_party/hamcrest.jar)}) ] op_id: Op_DPipe ) ] spids: [1838] ) spids: [1832 1837] ) (FuncDef name: setup_javatest_support body: (BraceGroup children: [ (C {(setup_javatest_common)}) (AndOr children: [ (C {(grep)} {(-q)} {(SQ <"name = \"junit4\"">)} {(third_party/BUILD)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("java_import(\n") (" name = ") (Right_DoubleQuote "\"") (junit4) (Right_DoubleQuote "\"") (",\n") (" jars = [\n") (" ") (Right_DoubleQuote "\"") (junit.jar) (Right_DoubleQuote "\"") (",\n") (" ") (Right_DoubleQuote "\"") (hamcrest.jar) (Right_DoubleQuote "\"") (",\n") (" ],\n") (")\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1960] ) (Redir op_id: Redir_DGreat fd: -1 arg_word: {(third_party/BUILD)} spids: [1963] ) ] ) ] op_id: Op_DPipe ) ] spids: [1938] ) spids: [1932 1937] ) (FuncDef name: setup_skylark_javatest_support body: (BraceGroup children: [ (C {(setup_javatest_common)}) (AndOr children: [ (C {(grep)} {(-q)} { (DQ ("name = ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (junit4-jars) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } {(third_party/BUILD)} ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("filegroup(\n") (" name = ") (Right_DoubleQuote "\"") (junit4-jars) (Right_DoubleQuote "\"") (",\n") (" srcs = [\n") (" ") (Right_DoubleQuote "\"") (junit.jar) (Right_DoubleQuote "\"") (",\n") (" ") (Right_DoubleQuote "\"") (hamcrest.jar) (Right_DoubleQuote "\"") (",\n") (" ],\n") (")\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [2019] ) (Redir op_id: Redir_DGreat fd: -1 arg_word: {(third_party/BUILD)} spids: [2022] ) ] ) ] op_id: Op_DPipe ) ] spids: [1994] ) spids: [1988 1993] ) (FuncDef name: setup_objc_test_support body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:IOS_SDK_VERSION) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(xcrun)} {(--sdk)} {(iphoneos)} {(--show-sdk-version)})] ) left_token: <Left_CommandSub "$("> spids: [2060 2068] ) } spids: [2059] ) ] spids: [2059] ) ] spids: [2056] ) spids: [2050 2055] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:workspaces) op: Equal rhs: {(ArrayLiteralPart)} spids: [2073] ) ] spids: [2073] ) (FuncDef name: create_new_workspace body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_workspace_dir) op: Equal rhs: { (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: { (CommandSubPart command_list: (CommandList children: [ (C {(mktemp)} {(-d)} {(${ VSub_Name TEST_TMPDIR) (/workspace.XXXXXXXX)} ) ] ) left_token: <Left_CommandSub "$("> spids: [2093 2102] ) } ) spids: [2090 2103] ) } spids: [2089] ) ] spids: [2089] ) (C {(rm)} {(-fr)} {(${ VSub_Name new_workspace_dir)}) (C {(mkdir)} {(-p)} {(${ VSub_Name new_workspace_dir)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:workspaces) op: PlusEqual rhs: {(ArrayLiteralPart words:[{(${ VSub_Name new_workspace_dir)}])} spids: [2124] ) ] spids: [2124] ) (C {(cd)} {(${ VSub_Name new_workspace_dir)}) (C {(mkdir)} {(tools)}) (C {(mkdir)} {(-p)} {(third_party/java/jdk/langtools)}) (C {(copy_tools_directory)}) (AndOr children: [ (C {(Lit_Other "[")} {(-e)} {(third_party/java/jdk/langtools/javac.jar)} {(Lit_Other "]")} ) (C {(ln)} {(-s)} {(DQ (${ VSub_Name langtools_path))} {(third_party/java/jdk/langtools/javac.jar)} ) ] op_id: Op_DPipe ) (C {(touch)} {(WORKSPACE)}) ] spids: [2086] ) spids: [2080 2085] ) (FuncDef name: setup_clean_workspace body: (BraceGroup children: [ (C {(export)} {(Lit_VarLike "WORKSPACE_DIR=") (${ VSub_Name TEST_TMPDIR) (/workspace)}) (SimpleCommand words: [{(echo)} {(DQ ("setting up client in ") (${ VSub_Name WORKSPACE_DIR))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2219] ) ] ) (C {(rm)} {(-fr)} {(${ VSub_Name WORKSPACE_DIR)}) (C {(create_new_workspace)} {(${ VSub_Name WORKSPACE_DIR)}) (AndOr children: [ (C {(Lit_Other "[")} {(DQ (${ VSub_Name new_workspace_dir))} {(Lit_Other "=")} {(DQ (${ VSub_Name WORKSPACE_DIR))} {(Lit_Other "]")} ) (BraceGroup children: [ (Sentence child: (SimpleCommand words: [{(echo)} {(DQ ("Failed to create workspace"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2270])] ) terminator: <Op_Semi ";"> ) (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">) ] spids: [2262] ) ] op_id: Op_DPipe ) (C {(export)} {(Lit_VarLike "BAZEL_INSTALL_BASE=") (CommandSubPart command_list: (CommandList children:[(C {(bazel)} {(info)} {(install_base)})]) left_token: <Left_CommandSub "$("> spids: [2285 2291] ) } ) (C {(export)} {(Lit_VarLike "BAZEL_GENFILES_DIR=") (CommandSubPart command_list: (CommandList children:[(C {(bazel)} {(info)} {(bazel-genfiles)})]) left_token: <Left_CommandSub "$("> spids: [2297 2303] ) } ) (C {(export)} {(Lit_VarLike "BAZEL_BIN_DIR=") (CommandSubPart command_list: (CommandList children:[(C {(bazel)} {(info)} {(bazel-bin)})]) left_token: <Left_CommandSub "$("> spids: [2309 2315] ) } ) (If arms: [ (if_arm cond: [(Sentence child:(C {(is_windows)}) terminator:<Op_Semi ";">)] action: [ (C {(export)} {(Lit_VarLike "BAZEL_SH=") (DQ (CommandSubPart command_list: (CommandList children: [(C {(cygpath)} {(--windows)} {(/bin/bash)})] ) left_token: <Left_CommandSub "$("> spids: [2330 2336] ) ) } ) ] spids: [-1 2323] ) ] spids: [-1 2340] ) ] spids: [2198] ) spids: [2192 2197] ) (FuncDef name: cleanup_workspace body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} { (DQ (BracedVarSub token: <VSub_Name WORKSPACE_DIR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2367 2370] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Cleaning up workspace"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2385] ) ] ) (C {(cd)} {(${ VSub_Name WORKSPACE_DIR)}) (SimpleCommand words: [{(bazel)} {(clean)}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2401] ) ] ) (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children:[(C {(ls)})]) left_token: <Left_CommandSub "$("> spids: [2416 2418] ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(is_tools_directory)} {(DQ ($ VSub_Name "$i"))}) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [(C {(rm)} {(-fr)} {(DQ ($ VSub_Name "$i"))})] spids: [-1 2435] ) ] spids: [-1 2447] ) ] spids: [2421 2450] ) spids: [2415 2419] ) (C {(touch)} {(WORKSPACE)}) ] spids: [-1 2376] ) ] spids: [-1 2458] ) (ForEach iter_name: i iter_words: [{(${ VSub_Name workspaces)}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$i"))} {(KW_Bang "!") (Lit_Other "=")} { (DQ (BracedVarSub token: <VSub_Name WORKSPACE_DIR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2487 2490] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(C {(rm)} {(-fr)} {($ VSub_Name "$i")})] spids: [-1 2496] ) ] spids: [-1 2506] ) ] spids: [2472 2509] ) spids: [2466 2470] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:workspaces) op: Equal rhs: {(ArrayLiteralPart)} spids: [2512] ) ] spids: [2512] ) ] spids: [2357] ) spids: [2351 2356] ) (FuncDef name: cleanup body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} { (DQ (BracedVarSub token: <VSub_Name BAZEL_INSTALL_BASE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(__does_not_exists__)} ) spids: [2538 2542] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(C {(rm)} {(-fr)} {(DQ (${ VSub_Name BAZEL_INSTALL_BASE))})] spids: [-1 2548] ) ] spids: [-1 2562] ) ] spids: [2528] ) spids: [2522 2527] ) (FuncDef name: tear_down body: (BraceGroup children:[(C {(cleanup_workspace)})] spids:[2573]) spids: [2567 2572] ) (FuncDef name: assert_build body: (BraceGroup children: [ (AndOr children: [ (C {(bazel)} {(build)} {(-s)} {(--verbose_failures)} {($ VSub_Star "$*")}) (C {(fail)} {(DQ ("Failed to build ") ($ VSub_Star "$*"))}) ] op_id: Op_DPipe ) ] spids: [2596] ) spids: [2590 2595] ) (FuncDef name: assert_build_output body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:OUTPUT) op: Equal rhs: {($ VSub_Number "$1")} spids: [2632] ) ] spids: [2630] ) (C {(shift)}) (C {(assert_build)} {(DQ ($ VSub_Star "$*"))}) (AndOr children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name "$OUTPUT"))}) (C {(fail)} { (DQ ("Output ") ($ VSub_Name "$OUTPUT") (" not found for target ") ($ VSub_Star "$*") ) } ) ] op_id: Op_DPipe ) ] spids: [2627] ) spids: [2621 2626] ) (FuncDef name: assert_build_fails body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [{(bazel)} {(build)} {(-s)} {($ VSub_Number "$1")}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2685] ) ] ) (AndOr children: [ (C {(fail)} {(DQ ("Test ") ($ VSub_Number "$1") (" succeed while expecting failure"))} ) (C {(true)}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2715 2718] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(C {(expect_log)} {(DQ ($ VSub_Number "$2"))})] spids: [-1 2724] ) ] spids: [-1 2734] ) ] spids: [2674] ) spids: [2668 2673] ) (FuncDef name: assert_test_ok body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [ {(bazel)} {(test)} {(--test_output) (Lit_Other "=") (errors)} {($ VSub_Star "$*")} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2758] ) ] ) (C {(fail)} {(DQ ("Test ") ($ VSub_Number "$1") (" failed while expecting success"))}) ] op_id: Op_DPipe ) ] spids: [2745] ) spids: [2739 2744] ) (FuncDef name: assert_test_fails body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [ {(bazel)} {(test)} {(--test_output) (Lit_Other "=") (errors)} {($ VSub_Star "$*")} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2796] ) ] ) (AndOr children: [ (C {(fail)} {(DQ ("Test ") ($ VSub_Star "$*") (" succeed while expecting failure"))}) (C {(true)}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) (C {(expect_log)} {(DQ ($ VSub_Number "$1") (".*FAILED"))}) ] spids: [2783] ) spids: [2777 2782] ) (FuncDef name: assert_binary_run body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [{($ VSub_Number "$1")}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2840] ) ] ) (C {(fail)} {(DQ ("Failed to run ") ($ VSub_Number "$1"))}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other "[")} {(-z)} { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2859 2862] ) ) } {(Lit_Other "]")} ) (C {(expect_log)} {(DQ ($ VSub_Number "$2"))}) ] op_id: Op_DPipe ) ] spids: [2835] ) spids: [2829 2834] ) (FuncDef name: assert_bazel_run body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [{(bazel)} {(run)} {($ VSub_Number "$1")}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {($ VSub_Name "$TEST_log")} spids: [2893] ) ] ) (C {(fail)} {(DQ ("Failed to run ") ($ VSub_Number "$1"))}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other "[")} {(-z)} { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2912 2915] ) ) } {(Lit_Other "]")} ) (C {(expect_log)} {(DQ ($ VSub_Number "$2"))}) ] op_id: Op_DPipe ) (C {(assert_binary_run)} { (DQ (./bazel-bin/) (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Number "$1"))}) (C {(sed)} {(SQ <"s|^//||">)}) (C {(sed)} {(SQ <"s|:|/|">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [2934 2956] ) ) } { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2960 2963] ) ) } ) ] spids: [2884] ) spids: [2878 2883] ) (C {(setup_bazelrc)}) (C {(setup_clean_workspace)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:PRODUCT_NAME) op:Equal rhs:{(bazel)} spids:[2983])] spids: [2983] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:WORKSPACE_NAME) op:Equal rhs:{(main)} spids:[2986])] spids: [2986] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazelrc) op: Equal rhs: {($ VSub_Name "$TEST_TMPDIR") (/bazelrc)} spids: [2989] ) ] spids: [2989] ) (FuncDef name: put_bazel_on_path body: (BraceGroup children:[(C {(true)})] spids:[3000]) spids: [2994 2999] ) (FuncDef name: write_default_bazelrc body: (BraceGroup children:[(C {(setup_bazelrc)})] spids:[3018]) spids: [3012 3017] ) (FuncDef name: add_to_bazelrc body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At "$@"))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$bazelrc")} spids: [3041] ) ] ) ] spids: [3032] ) spids: [3026 3031] ) (FuncDef name: create_and_cd_client body: (BraceGroup children: [ (C {(setup_clean_workspace)}) (SimpleCommand words: [{(echo)} {(DQ ("workspace(name = '") ($ VSub_Name "$WORKSPACE_NAME") ("')"))}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(WORKSPACE)} spids:[3068])] ) (C {(touch)} {(.bazelrc)}) ] spids: [3054] ) spids: [3048 3053] ) (C {(create_and_cd_client)}) ] )