From f8b5c91cfe695b63bcba6e28993101be784101f6 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Fri, 16 Jun 2023 13:42:11 -0400 Subject: [PATCH 1/3] create the hackiest smoke test that the distribution builds --- distro/check_build.sh | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 distro/check_build.sh diff --git a/distro/check_build.sh b/distro/check_build.sh new file mode 100755 index 0000000..77d1ab7 --- /dev/null +++ b/distro/check_build.sh @@ -0,0 +1,61 @@ +#!/bin/bash -ef +# +# This is a temporary hack. +# The intent is to create a rule which does this and add to +# rules_pkg. Comments within it are mostly for future me +# while writing that. + +TARBALL=$(bazel build //distro:distro 2>&1 | grep 'rules_license-.*\.tar\.gz' | sed -e 's/ //g') +REPO_NAME='rules_license' + +# This part can be standard from the rule + + +TARNAME=$(basename "$TARBALL") + +TMP=$(mktemp -d) +trap '/bin/rm -rf "$TMP"; exit 0' 0 1 2 3 15 + +cp "$TARBALL" "$TMP" + +cd "$TMP" +cat >WORKSPACE <BUILD <LICENSE + +# Then a list of commands to run. This can be a template +# too so we can substitute the path to bazel. +bazel build ... +bazel build @rules_license//rules/... +bazel build @rules_license//licenses/... +bazel query @rules_license//licenses/generic/... +bazel query ... + +# We do the cleanup +/bin/rm -rf "$TMP" From 3807bcc24ef49243c7fe64eb7a6ce61e7dc6cf12 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Fri, 16 Jun 2023 15:38:49 -0400 Subject: [PATCH 2/3] comment --- distro/check_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distro/check_build.sh b/distro/check_build.sh index 77d1ab7..2ae8e0e 100755 --- a/distro/check_build.sh +++ b/distro/check_build.sh @@ -1,6 +1,7 @@ #!/bin/bash -ef # -# This is a temporary hack. +# This is a temporary hack to verify the distribution archive is sound. +# # The intent is to create a rule which does this and add to # rules_pkg. Comments within it are mostly for future me # while writing that. From 42ed8a91a864b6ede3c02e0de0f90cdac7d6ccdd Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Fri, 16 Jun 2023 17:00:33 -0400 Subject: [PATCH 3/3] reviews --- distro/check_build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/distro/check_build.sh b/distro/check_build.sh index 2ae8e0e..bfcae6d 100755 --- a/distro/check_build.sh +++ b/distro/check_build.sh @@ -57,6 +57,3 @@ bazel build @rules_license//rules/... bazel build @rules_license//licenses/... bazel query @rules_license//licenses/generic/... bazel query ... - -# We do the cleanup -/bin/rm -rf "$TMP"