use of com.facebook.buck.distributed.thrift.BuildJobStateBuckConfig in project buck by facebook.
the class DistBuildCellIndexer method dumpConfig.
private static BuildJobStateBuckConfig dumpConfig(BuckConfig buckConfig) {
BuildJobStateBuckConfig jobState = new BuildJobStateBuckConfig();
jobState.setUserEnvironment(buckConfig.getEnvironment());
Map<String, List<OrderedStringMapEntry>> rawConfig = Maps.transformValues(buckConfig.getRawConfigForDistBuild(), input -> {
List<OrderedStringMapEntry> result = new ArrayList<>();
for (Map.Entry<String, String> entry : input.entrySet()) {
result.add(new OrderedStringMapEntry(entry.getKey(), entry.getValue()));
}
return result;
});
jobState.setRawBuckConfig(rawConfig);
jobState.setArchitecture(buckConfig.getArchitecture().name());
jobState.setPlatform(buckConfig.getPlatform().name());
return jobState;
}
use of com.facebook.buck.distributed.thrift.BuildJobStateBuckConfig in project buck by facebook.
the class DistBuildState method createBuckConfig.
private static BuckConfig createBuckConfig(Config config, ProjectFilesystem projectFilesystem, BuildJobStateBuckConfig remoteBuckConfig) {
Architecture remoteArchitecture = Architecture.valueOf(remoteBuckConfig.getArchitecture());
Architecture localArchitecture = Architecture.detect();
Preconditions.checkState(remoteArchitecture.equals(localArchitecture), "Trying to load config with architecture %s on a machine that is %s. " + "This is not supported.", remoteArchitecture, localArchitecture);
Platform remotePlatform = Platform.valueOf(remoteBuckConfig.getPlatform());
Platform localPlatform = Platform.detect();
Preconditions.checkState(remotePlatform.equals(localPlatform), "Trying to load config with platform %s on a machine that is %s. This is not supported.", remotePlatform, localPlatform);
return new BuckConfig(config, projectFilesystem, remoteArchitecture, remotePlatform, ImmutableMap.copyOf(remoteBuckConfig.getUserEnvironment()), new DefaultCellPathResolver(projectFilesystem.getRootPath(), config));
}
Aggregations