@@ -1023,34 +1023,34 @@ func testWithBazelAtCommit(bazelCommit string, args []string, bazeliskHome strin
1023
1023
func migrate (bazelPath string , baseArgs []string , flags []string , config config.Config ) {
1024
1024
var startupOptions = parseStartupOptions (baseArgs )
1025
1025
1026
- // 1. Try with all the flags.
1027
- args := insertArgs ( baseArgs , flags )
1028
- fmt .Printf ("\n \n --- Running Bazel with all incompatible flags\n \n " )
1026
+ // 1. Try without any incompatible flags, as a sanity check .
1027
+ args := baseArgs
1028
+ fmt .Printf ("\n \n --- Running Bazel with no incompatible flags\n \n " )
1029
1029
shutdownIfNeeded (bazelPath , startupOptions , config )
1030
1030
cleanIfNeeded (bazelPath , startupOptions , config )
1031
1031
fmt .Printf ("bazel %s\n " , strings .Join (args , " " ))
1032
1032
exitCode , err := runBazel (bazelPath , args , nil , config )
1033
1033
if err != nil {
1034
1034
log .Fatalf ("could not run Bazel: %v" , err )
1035
1035
}
1036
- if exitCode = = 0 {
1037
- fmt .Printf ("Success: No migration needed .\n " )
1038
- os .Exit (0 )
1036
+ if exitCode ! = 0 {
1037
+ fmt .Printf ("Failure: Command failed, even without incompatible flags .\n " )
1038
+ os .Exit (exitCode )
1039
1039
}
1040
1040
1041
- // 2. Try with no flags, as a sanity check .
1042
- args = baseArgs
1043
- fmt .Printf ("\n \n --- Running Bazel with no incompatible flags\n \n " )
1041
+ // 2. Try with all the flags .
1042
+ args = insertArgs ( baseArgs , flags )
1043
+ fmt .Printf ("\n \n --- Running Bazel with all incompatible flags\n \n " )
1044
1044
shutdownIfNeeded (bazelPath , startupOptions , config )
1045
1045
cleanIfNeeded (bazelPath , startupOptions , config )
1046
1046
fmt .Printf ("bazel %s\n " , strings .Join (args , " " ))
1047
1047
exitCode , err = runBazel (bazelPath , args , nil , config )
1048
1048
if err != nil {
1049
1049
log .Fatalf ("could not run Bazel: %v" , err )
1050
1050
}
1051
- if exitCode ! = 0 {
1052
- fmt .Printf ("Failure: Command failed, even without incompatible flags .\n " )
1053
- os .Exit (exitCode )
1051
+ if exitCode = = 0 {
1052
+ fmt .Printf ("Success: No migration needed .\n " )
1053
+ os .Exit (0 )
1054
1054
}
1055
1055
1056
1056
// 3. Try with each flag separately.
@@ -1087,7 +1087,8 @@ func migrate(bazelPath string, baseArgs []string, flags []string, config config.
1087
1087
fmt .Printf ("Migration is needed for the following flags:\n " )
1088
1088
print (failList )
1089
1089
1090
- os .Exit (1 )
1090
+ // Return an unique exit code for incompatible flag test failure
1091
+ os .Exit (73 )
1091
1092
}
1092
1093
1093
1094
func dirForURL (url string ) string {
0 commit comments