From 9174b52bca2837a8a472403f332a0501980fa54e Mon Sep 17 00:00:00 2001 From: ccalvarin Date: Mon, 9 Apr 2018 08:44:02 -0700 Subject: Remove alphabetical sorting of options in the canonical list. This was broken for --config. Doing this properly requires keeping the order in which the options were given, which could be done either by filtering the ordered list according to which values affect the final outcome or by tracking the order correctly. I picked the later: the option order was not explicitly tracked for expansions before but now it is. RELNOTES: canonicalize-flags no longer reorders the flags PiperOrigin-RevId: 192132260 GitOrigin-RevId: aa98bc29dae14119797febd447302842f4ac68af Change-Id: I82fb65d38569d4e5a9808f032da1ccc2304e2f18 --- java/com/google/devtools/common/options/OptionsProvider.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'java/com/google/devtools/common/options/OptionsProvider.java') diff --git a/java/com/google/devtools/common/options/OptionsProvider.java b/java/com/google/devtools/common/options/OptionsProvider.java index d467fe5..ece5d5d 100644 --- a/java/com/google/devtools/common/options/OptionsProvider.java +++ b/java/com/google/devtools/common/options/OptionsProvider.java @@ -73,11 +73,13 @@ public interface OptionsProvider extends OptionsClassProvider { List asListOfOptionValues(); /** - * Canonicalizes the list of options that this OptionsParser has parsed. The - * contract is that if the returned set of options is passed to an options - * parser with the same options classes, then that will have the same effect - * as using the original args (which are passed in here), except for cosmetic - * differences. + * Canonicalizes the list of options that this OptionsParser has parsed. + * + *

The contract is that if the returned set of options is passed to an options parser with the + * same options classes, then that will have the same effect as using the original args (which are + * passed in here), except for cosmetic differences. We do not guarantee that the 'canonical' list + * is unique, since some flags may have effects unknown to the parser (--config, for Bazel), so we + * do not reorder flags to further simplify the list. */ List canonicalize(); } -- cgit v1.2.3