diff options
author | 2016-09-07 13:34:06 +0000 | |
---|---|---|
committer | 2016-09-08 08:43:34 +0000 | |
commit | 09cb1a72fecade911b14208801c95a9f4f8ac83a (patch) | |
tree | 909ead83105ddac9284643850dd1ee371ab0e75b /src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java | |
parent | d295f80c5cfd000ed7325fae59c90b87fb063226 (diff) |
Remove some dead code from PythonConfigurationLoader.
There doesn't seem to be any need for a C++ toolchain to create a Python config
anymore. I looked through the change history, but didn't find any obvious
culprits / reasons for the current code.
--
MOS_MIGRATED_REVID=132429818
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java index ff49b2d9b3..d85c586412 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonConfigurationLoader.java @@ -13,7 +13,6 @@ // limitations under the License. package com.google.devtools.build.lib.rules.python; -import com.google.common.base.Function; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.Fragment; import com.google.devtools.build.lib.analysis.config.BuildOptions; @@ -21,59 +20,22 @@ import com.google.devtools.build.lib.analysis.config.ConfigurationEnvironment; import com.google.devtools.build.lib.analysis.config.ConfigurationFragmentFactory; import com.google.devtools.build.lib.analysis.config.FragmentOptions; import com.google.devtools.build.lib.analysis.config.InvalidConfigurationException; -import com.google.devtools.build.lib.cmdline.Label; -import com.google.devtools.build.lib.rules.cpp.CppConfiguration; -import com.google.devtools.build.lib.rules.cpp.CppOptions; -import com.google.devtools.build.lib.rules.cpp.CrosstoolConfigurationLoader; -import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig; -import javax.annotation.Nullable; /** * A factory implementation for {@link PythonConfiguration} objects. */ public class PythonConfigurationLoader implements ConfigurationFragmentFactory { - private final Function<String, String> cpuTransformer; - - public PythonConfigurationLoader(Function<String, String> cpuTransformer) { - this.cpuTransformer = cpuTransformer; - } - @Override public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() { - return ImmutableSet.of(PythonOptions.class, CppOptions.class); - } - - @Nullable - private CrosstoolConfig.CToolchain getToolchain( - ConfigurationEnvironment env, BuildOptions buildOptions, Label crosstoolTop) - throws InvalidConfigurationException, InterruptedException { - CrosstoolConfigurationLoader.CrosstoolFile file = - CrosstoolConfigurationLoader.readCrosstool(env, crosstoolTop); - if (file == null) { - return null; - } - return CrosstoolConfigurationLoader.selectToolchain( - file.getProto(), buildOptions, cpuTransformer); + return ImmutableSet.<Class<? extends FragmentOptions>>of(PythonOptions.class); } @Override public PythonConfiguration create(ConfigurationEnvironment env, BuildOptions buildOptions) throws InvalidConfigurationException, InterruptedException { PythonOptions pythonOptions = buildOptions.get(PythonOptions.class); - CppConfiguration cppConfiguration = env.getFragment(buildOptions, CppConfiguration.class); - if (cppConfiguration == null) { - return null; - } - - CrosstoolConfig.CToolchain toolchain = getToolchain( - env, buildOptions, buildOptions.get(CppOptions.class).crosstoolTop); - if (toolchain == null) { - return null; - } - boolean ignorePythonVersionAttribute = pythonOptions.forcePython != null; PythonVersion pythonVersion = pythonOptions.getPythonVersion(); - return new PythonConfiguration(pythonVersion, ignorePythonVersionAttribute); } |