experimental_objc_library uses ImmutableSortedSet to avoid muddling input
order.
MOS_MIGRATED_REVID=146159313
@@ -25,8 +25,8 @@ import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleContext;
@@ -247,10 +247,12 @@ public class CrosstoolCompilationSupport extends CompilationSupport {
private CcLibraryHelper createCcLibraryHelper(ObjcProvider objcProvider,
VariablesExtension extension) {
PrecompiledFiles precompiledFiles = new PrecompiledFiles(ruleContext);
- Collection<Artifact> arcSources = Sets.newHashSet(compilationArtifacts.getSrcs());
- Collection<Artifact> nonArcSources = Sets.newHashSet(compilationArtifacts.getNonArcSrcs());
- Collection<Artifact> privateHdrs = Sets.newHashSet(compilationArtifacts.getPrivateHdrs());
- Collection<Artifact> publicHdrs = Sets.newHashSet(attributes.hdrs());
+ Collection<Artifact> arcSources = ImmutableSortedSet.copyOf(compilationArtifacts.getSrcs());
+ Collection<Artifact> nonArcSources =
+ ImmutableSortedSet.copyOf(compilationArtifacts.getNonArcSrcs());
+ Collection<Artifact> privateHdrs =
+ ImmutableSortedSet.copyOf(compilationArtifacts.getPrivateHdrs());
+ Collection<Artifact> publicHdrs = ImmutableSortedSet.copyOf(attributes.hdrs());
Artifact pchHdr = ruleContext.getPrerequisiteArtifact("pch", Mode.TARGET);
ImmutableList<Artifact> pchHdrList =
(pchHdr != null) ? ImmutableList.<Artifact>of(pchHdr) : ImmutableList.<Artifact>of();
