diff options
author | 2017-02-17 14:48:48 +0000 | |
---|---|---|
committer | 2017-02-17 14:57:32 +0000 | |
commit | e36a66cd6e35e5b4b276f2b6ce63e1c691bcb02c (patch) | |
tree | 7d2b273bf2948aa350147a91da3a6b4ad0111e34 /src/test/java/com/google/devtools/build/lib/rules | |
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/test/java/com/google/devtools/build/lib/rules')
4 files changed, 6 insertions, 19 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java index 25aa5b208c..466e06166a 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java @@ -708,7 +708,7 @@ public class CcCommonTest extends BuildViewTestCase { checkError( "test", "bad_relative_include", - "../.. references a path above the execution root (..).", + "Path references a path above the execution root.", "cc_library(name='bad_relative_include', srcs=[], includes=['../..'])"); } diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java index bda5f6cbad..0765419165 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java @@ -1050,8 +1050,8 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase { @Test public void testSystemIncludePathsOutsideExecutionRoot() throws Exception { checkError("root", "a", - "The include path '../../system' references a path outside of the execution root.", - "cc_library(name='a', srcs=['a.cc'], copts=['-isystem../../system'])"); + "The include path '../system' references a path outside of the execution root.", + "cc_library(name='a', srcs=['a.cc'], copts=['-isystem../system'])"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/proto/CcProtoLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/proto/CcProtoLibraryTest.java index 6f5ee31a88..2a8290a0c8 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/proto/CcProtoLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/proto/CcProtoLibraryTest.java @@ -167,7 +167,7 @@ public class CcProtoLibraryTest extends BuildViewTestCase { assertThat(protoCompileAction.getArguments()) .contains( String.format( - "--cpp_out=../bla/%s", + "--cpp_out=%s/external/bla", getTargetConfiguration().getGenfilesFragment().toString())); } diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java index 788488e077..2bb3800eb6 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java @@ -34,7 +34,6 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.ProtoCommandLineArgv; import com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.ToolchainInvocation; import com.google.devtools.build.lib.util.LazyString; -import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem; import org.junit.Test; import org.junit.runner.RunWith; @@ -303,24 +302,12 @@ public class ProtoCompileActionBuilderTest { */ @Test public void testIncludeMapsOfExternalFiles() throws Exception { - Label externalLabel = Label.parseAbsolute("@bla//foo:bar"); - Root externalRoot = Root.asSourceRoot( - root.getPath().getRelative( - externalLabel.getPackageIdentifier().getRepository().getSourceRoot()), - false); - PathFragment externalPath = new PathFragment("foo/bar.proto"); - System.out.println("Root: " + externalRoot + " path: " + externalPath); - Artifact externalArtifact = new Artifact( - externalRoot.getPath().getRelative(externalPath), - externalRoot, - externalRoot.getExecPath().getRelative(externalPath), - new LabelArtifactOwner(externalLabel)); assertThat( new ProtoCommandLineArgv( null /* protosInDirectoDependencies */, - ImmutableList.of(externalArtifact)) + ImmutableList.of(artifact("@bla//foo:bar", "external/bla/foo/bar.proto"))) .argv()) - .containsExactly("-Ifoo/bar.proto=../bla/foo/bar.proto"); + .containsExactly("-Ifoo/bar.proto=external/bla/foo/bar.proto"); } private Artifact artifact(String ownerLabel, String path) { |