diff options
author | John Cater <jcater@google.com> | 2018-02-28 07:52:21 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-28 07:53:50 -0800 |
commit | e959e44a4363fc12ae2df2c5bc0cd0d12f80bbd9 (patch) | |
tree | 70f26ae98d7c8d0457e9c79236480124580d4988 /src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java | |
parent | e7d9e1f8aae459ec71cdb31f988661f4c3975ca8 (diff) |
Update ToolchainUtil to properly load and use the available execution
platforms, and correctly merge together the results from TRF.
Part of #4442.
Change-Id: I31d83fa73a93d39a0e18d05a43a1c8666ac5a2d2
PiperOrigin-RevId: 187324257
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java index d7e6e21bae..9837589f01 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java @@ -24,6 +24,7 @@ import com.google.devtools.build.lib.analysis.platform.PlatformProviderUtils; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.ConfiguredValueCreationException; +import com.google.devtools.build.lib.skyframe.ToolchainUtil.InvalidPlatformException; import com.google.devtools.build.skyframe.SkyFunction; import com.google.devtools.build.skyframe.SkyFunctionException; import com.google.devtools.build.skyframe.SkyFunctionException.Transience; @@ -127,11 +128,11 @@ public class RegisteredExecutionPlatformsFunction implements SkyFunction { if (platformInfo == null) { throw new RegisteredExecutionPlatformsFunctionException( - new InvalidExecutionPlatformLabelException(platformLabel), Transience.PERSISTENT); + new InvalidPlatformException(platformLabel), Transience.PERSISTENT); } } catch (ConfiguredValueCreationException e) { throw new RegisteredExecutionPlatformsFunctionException( - new InvalidExecutionPlatformLabelException(platformLabel, e), Transience.PERSISTENT); + new InvalidPlatformException(platformLabel, e), Transience.PERSISTENT); } } @@ -148,44 +149,13 @@ public class RegisteredExecutionPlatformsFunction implements SkyFunction { } /** - * Used to indicate that the given {@link Label} represents a {@link ConfiguredTarget} which is - * not a valid {@link PlatformInfo} provider. - */ - static final class InvalidExecutionPlatformLabelException extends Exception { - - private final Label invalidLabel; - - private InvalidExecutionPlatformLabelException(Label invalidLabel) { - super( - String.format( - "invalid registered execution platform '%s': " - + "target does not provide the PlatformInfo provider", - invalidLabel)); - this.invalidLabel = invalidLabel; - } - - private InvalidExecutionPlatformLabelException( - Label invalidLabel, ConfiguredValueCreationException e) { - super( - String.format( - "invalid registered execution platform '%s': %s", invalidLabel, e.getMessage()), - e); - this.invalidLabel = invalidLabel; - } - - public Label getInvalidLabel() { - return invalidLabel; - } - } - - /** * Used to declare all the exception types that can be wrapped in the exception thrown by {@link * #compute}. */ private static class RegisteredExecutionPlatformsFunctionException extends SkyFunctionException { private RegisteredExecutionPlatformsFunctionException( - InvalidExecutionPlatformLabelException cause, Transience transience) { + InvalidPlatformException cause, Transience transience) { super(cause, transience); } } |