6464import com .google .devtools .build .lib .skyframe .serialization .SkycacheMetadataParams ;
6565import com .google .devtools .build .lib .skyframe .serialization .analysis .ClientId .LongVersionClientId ;
6666import com .google .devtools .build .lib .skyframe .serialization .analysis .RemoteAnalysisCacheManager .AnalysisDeps ;
67- import com .google .devtools .build .lib .skyframe .serialization .analysis .RemoteAnalysisCachingOptions .RemoteAnalysisCacheMode ;
67+ import com .google .devtools .build .lib .skyframe .serialization .analysis .RemoteAnalysisCachingOptionsFields .RemoteAnalysisCacheMode ;
6868import com .google .devtools .build .lib .util .AbruptExitException ;
6969import com .google .devtools .build .lib .util .DetailedExitCode ;
7070import com .google .devtools .build .lib .vfs .PathFragment ;
@@ -100,7 +100,7 @@ public static AnalysisDeps create(
100100 var options = env .getOptions ().getOptions (RemoteAnalysisCachingOptions .class );
101101 if (options == null
102102 || !env .getCommand ().buildPhase ().executes ()
103- || options .mode == RemoteAnalysisCacheMode .OFF ) {
103+ || options .getMode () == RemoteAnalysisCacheMode .OFF ) {
104104 RemoteAnalysisCacheDeps disabledDeps = RemoteAnalysisCacheDeps .createDisabled ();
105105 return new AnalysisDeps (
106106 RemoteAnalysisCacheManager .createDisabled (), disabledDeps , disabledDeps );
@@ -109,7 +109,7 @@ public static AnalysisDeps create(
109109 // Set up active directory matcher
110110
111111 Optional <PathFragmentPrefixTrie > maybeActiveDirectoriesMatcherFromFlags =
112- finalizeActiveDirectoriesMatcher (env , maybeActiveDirectoriesMatcher , options .mode );
112+ finalizeActiveDirectoriesMatcher (env , maybeActiveDirectoriesMatcher , options .getMode () );
113113 Optional <Predicate <PackageIdentifier >> activeDirectoriesMatcher =
114114 maybeActiveDirectoriesMatcherFromFlags .map (v -> pi -> v .includes (pi .getPackageFragment ()));
115115
@@ -130,7 +130,7 @@ public static AnalysisDeps create(
130130 topLevelOptions .checksum (),
131131 blazeInstallMD5 ,
132132 workspaceInfoFromDiff .getEvaluatingVersion (),
133- nullToEmpty (options .analysisCacheKeyDistinguisherForTesting ),
133+ nullToEmpty (options .getAnalysisCacheKeyDistinguisherForTesting () ),
134134 env .getUseFakeStampData (),
135135 workspaceInfoFromDiff .getSnapshot ());
136136 env .getRemoteAnalysisCachingEventListener ().recordSkyValueVersion (frontierNodeVersion );
@@ -152,7 +152,7 @@ public static AnalysisDeps create(
152152
153153 SkycacheMetadataParams skycacheMetadataParams = servicesSupplier .getSkycacheMetadataParams ();
154154 boolean areMetadataQueriesEnabled =
155- skycacheMetadataParams != null && options .analysisCacheEnableMetadataQueries ;
155+ skycacheMetadataParams != null && options .getAnalysisCacheEnableMetadataQueries () ;
156156
157157 if (areMetadataQueriesEnabled ) {
158158 skycacheMetadataParams .init (
@@ -175,15 +175,15 @@ public static AnalysisDeps create(
175175 var deps =
176176 new RemoteAnalysisCacheDeps (
177177 env .getReporter (),
178- options .mode ,
179- options .analysisCacheBailOnMissingFingerprint ,
178+ options .getMode () ,
179+ options .getAnalysisCacheBailOnMissingFingerprint () ,
180180 servicesSupplier ,
181181 env .getRemoteAnalysisCachingEventListener (),
182182 jsonLogWriter ,
183183 objectCodecs ,
184184 frontierNodeVersion ,
185185 activeDirectoriesMatcher ,
186- options .serializedFrontierProfile );
186+ options .getSerializedFrontierProfile () );
187187
188188 ListenableFuture <AnalysisCacheInvalidator > analysisCacheInvalidator =
189189 createAnalysisCacheInvalidator (
@@ -196,19 +196,19 @@ public static AnalysisDeps create(
196196
197197 var manager =
198198 new RemoteAnalysisCacheManager (
199- options .mode ,
199+ options .getMode () ,
200200 areMetadataQueriesEnabled ,
201201 env .getReporter (),
202202 skycacheMetadataParams ,
203203 servicesSupplier .getAnalysisCacheClient (),
204204 analysisCacheInvalidator ,
205205 topLevelTargets ,
206206 activeDirectoriesMatcher ,
207- options .skycacheMinimizeMemory );
207+ options .getSkycacheMinimizeMemory () );
208208
209209 // Bail out if needed
210210
211- return switch (options .mode ) {
211+ return switch (options .getMode () ) {
212212 case RemoteAnalysisCacheMode .DUMP_UPLOAD_MANIFEST_ONLY , RemoteAnalysisCacheMode .UPLOAD ->
213213 new AnalysisDeps (manager , deps , deps );
214214 case RemoteAnalysisCacheMode .DOWNLOAD -> {
@@ -217,7 +217,7 @@ public static AnalysisDeps create(
217217 analysisCacheClient = deps .getAnalysisCacheClient ();
218218 }
219219 if (analysisCacheClient == null ) {
220- if (Strings .isNullOrEmpty (options .analysisCacheService )) {
220+ if (Strings .isNullOrEmpty (options .getAnalysisCacheService () )) {
221221 env .getReporter ()
222222 .handle (
223223 Event .warn (
@@ -239,7 +239,7 @@ yield new AnalysisDeps(
239239 yield new AnalysisDeps (manager , deps , deps );
240240 }
241241 default ->
242- throw new IllegalStateException ("Unknown RemoteAnalysisCacheMode: " + options .mode );
242+ throw new IllegalStateException ("Unknown RemoteAnalysisCacheMode: " + options .getMode () );
243243 };
244244 }
245245
@@ -345,11 +345,11 @@ private static ListenableFuture<AnalysisCacheInvalidator> createAnalysisCacheInv
345345
346346 private static HashCode computeBlazeInstallMD5 (
347347 CommandEnvironment env , RemoteAnalysisCachingOptions options ) throws AbruptExitException {
348- if (options .serverChecksumOverride == null ) {
348+ if (options .getServerChecksumOverride () == null ) {
349349 return requireNonNull (env .getDirectories ().getInstallMD5 ());
350350 }
351351
352- if (options .mode != RemoteAnalysisCacheMode .DOWNLOAD ) {
352+ if (options .getMode () != RemoteAnalysisCacheMode .DOWNLOAD ) {
353353 throw new AbruptExitException (
354354 DetailedExitCode .of (
355355 FailureDetail .newBuilder ()
@@ -368,15 +368,15 @@ private static HashCode computeBlazeInstallMD5(
368368 + " this binary. This may cause crashes or even silent incorrectness."
369369 + " You've been warned! (check the documentation of the command line "
370370 + " flag for more details)" ,
371- options .serverChecksumOverride , env .getDirectories ().getInstallMD5 ())));
371+ options .getServerChecksumOverride () , env .getDirectories ().getInstallMD5 ())));
372372
373- return options .serverChecksumOverride ;
373+ return options .getServerChecksumOverride () ;
374374 }
375375
376376 @ Nullable
377377 private static RemoteAnalysisJsonLogWriter createJsonLogWriterMaybe (
378378 CommandEnvironment env , RemoteAnalysisCachingOptions options ) throws AbruptExitException {
379- if (options .jsonLog == null ) {
379+ if (options .getJsonLog () == null ) {
380380 return null ;
381381 }
382382 try {
@@ -385,7 +385,7 @@ private static RemoteAnalysisJsonLogWriter createJsonLogWriterMaybe(
385385 .getInstrumentationOutputFactory ()
386386 .createInstrumentationOutput (
387387 "remote_cache_jsonlog" ,
388- PathFragment .create (options .jsonLog ),
388+ PathFragment .create (options .getJsonLog () ),
389389 DestinationRelativeTo .WORKING_DIRECTORY_OR_HOME ,
390390 env ,
391391 env .getReporter (),
@@ -397,7 +397,8 @@ private static RemoteAnalysisJsonLogWriter createJsonLogWriterMaybe(
397397 new OutputStreamWriter (
398398 new BufferedOutputStream (jsonLog .createOutputStream (), 262144 ), ISO_8859_1 )));
399399 env .getReporter ()
400- .handle (Event .info (String .format ("Writing Skycache JSON log to '%s'" , options .jsonLog )));
400+ .handle (
401+ Event .info (String .format ("Writing Skycache JSON log to '%s'" , options .getJsonLog ())));
401402 return result ;
402403 } catch (IOException e ) {
403404 throw new AbruptExitException (
@@ -406,7 +407,7 @@ private static RemoteAnalysisJsonLogWriter createJsonLogWriterMaybe(
406407 .setMessage (
407408 String .format (
408409 "Cannot open remote analysis JSON log file '%s': %s" ,
409- options .jsonLog , e .getMessage ()))
410+ options .getJsonLog () , e .getMessage ()))
410411 .setRemoteAnalysisCaching (
411412 RemoteAnalysisCaching .newBuilder ()
412413 .setCode (RemoteAnalysisCaching .Code .CANNOT_OPEN_LOG_FILE ))
0 commit comments