diff options
author | 2017-02-17 14:48:48 +0000 | |
---|---|---|
committer | 2017-02-17 14:57:32 +0000 | |
commit | e36a66cd6e35e5b4b276f2b6ce63e1c691bcb02c (patch) | |
tree | 7d2b273bf2948aa350147a91da3a6b4ad0111e34 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | |
parent | 75639985d593f683ba13d2ceb38ec310662fb56b (diff) |
Rollback of commit 4b73e972d909bcd533f2f9940f95a00b9b73bdde.
*** Reason for rollback ***
Broke tests on CI: http://ci.bazel.io/job/bazel-tests/570/
*** Original change description ***
Roll forward execroot change
RELNOTES[INC]: Previously, an external repository would be symlinked into the
execution root at execroot/local_repo/external/remote_repo. This changes it to
be at execroot/remote_repo. This may break genrules/Skylark actions that
hardcode execution root paths. If this causes breakages for you, ensure that
genrules are using $(location :target) to access files and Skylark rules are
using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc.
functions. Cust...
--
PiperOrigin-RevId: 147833177
MOS_MIGRATED_REVID=147833177
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java index 1db3f3af5e..f5291b8311 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java @@ -519,6 +519,10 @@ public class CppConfiguration extends BuildConfiguration.Fragment { PathFragment defaultSysroot = toolchain.getBuiltinSysroot().length() == 0 ? null : new PathFragment(toolchain.getBuiltinSysroot()); + if ((defaultSysroot != null) && !defaultSysroot.isNormalized()) { + throw new IllegalArgumentException("The built-in sysroot '" + defaultSysroot + + "' is not normalized."); + } if ((cppOptions.libcTop != null) && (defaultSysroot == null)) { throw new InvalidConfigurationException("The selected toolchain " + toolchainIdentifier @@ -1061,7 +1065,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment { if (packageEndIndex != -1 && s.startsWith(PACKAGE_START)) { String packageString = s.substring(PACKAGE_START.length(), packageEndIndex); try { - pathPrefix = PackageIdentifier.parse(packageString).getPathUnderExecRoot(); + pathPrefix = PackageIdentifier.parse(packageString).getSourceRoot(); } catch (LabelSyntaxException e) { throw new InvalidConfigurationException("The package '" + packageString + "' is not valid"); } |