Permalink
Browse files

Make //tols/cpp/test start from the distribution artifact

The docker tests in //tools/cpp/test still assume that the sources
are enough to just compile.sh to bootstrap a bazel binary. Fix this,
by using the distribution archive instead.

While there, also add a target for the distribution archive as tar.

--
Change-Id: Ic31bb95da0165f83a14537a1719c27e5067d0d65
Reviewed-on: https://cr.bazel.build/7531
MOS_MIGRATED_REVID=140134322
  • Loading branch information...
1 parent cc428bc commit 52b03d1845714d2cdb7cd7e7697ff026c4d40c75 @aehlig aehlig committed with dslomov Nov 24, 2016
Showing with 21 additions and 2 deletions.
  1. +13 −0 BUILD
  2. +7 −1 combine_distfiles.sh
  3. +1 −1 tools/cpp/test/BUILD
View
@@ -71,3 +71,16 @@ genrule(
# Public but bazel-only visibility.
visibility = ["//:__subpackages__"],
)
+
+genrule(
+ name = "bazel-distfile-tar",
+ srcs = [
+ ":bazel-srcs",
+ "//src:derived_java_srcs",
+ ],
+ outs = ["bazel-distfile.tar"],
+ cmd = "env USE_TAR=YES $(location :combine_distfiles.sh) $@ $(SRCS)",
+ tools = ["combine_distfiles.sh"],
+ # Public but bazel-only visibility.
+ visibility = ["//:__subpackages__"],
+)
@@ -40,4 +40,10 @@ do
(cd "${PACKAGE_DIR}" && ${UNPACK} "${ARCHIVE}")
done
-(cd "${PACKAGE_DIR}" && find . -type f | sort | zip -qDX@ "${OUTPUT}")
+if [ -n "${USE_TAR}" ]
+then
+ (cd "${PACKAGE_DIR}" && tar -c -f "${OUTPUT}" --group=0 --owner=0 \
+ $(find . -type f | sort))
+else
+ (cd "${PACKAGE_DIR}" && find . -type f | sort | zip -qDX@ "${OUTPUT}")
+fi
@@ -43,7 +43,7 @@ pkg_tar(
name = "bazel_cc_configure",
package_dir = "/opt/workspace",
strip_prefix = "/",
- deps = ["//:bazel-srcs"],
+ deps = ["//:bazel-distfile-tar"],
)
[

0 comments on commit 52b03d1

Please sign in to comment.