Skip to content

Commit

Permalink
Reduce differences between repo and release archive; add experimental…
Browse files Browse the repository at this point in the history
…/ tree

The release packages currently do not share the same file structure as the git
source tree, causing confusion when one switches from the git repository
structure to the archive structure.  Unfortunately, this doesn't really work
with rules_pkg right now due to bazelbuild/bazel#10062.

Further, the `experimental/` tree containing `pkgfilegroup` was missing from the
0.2.5 release archive.  It will be present in future releases (in
`pkg/experimental/`).

Additional changes in the future will involve changing the entire structure of
rules_pkg to match existing best practices (#111).  Given that this is somewhat
invasive change, this one is made for now to favor consistency with that
currently exists.

Testing was done by building the archive, extracting its contents, and
performing a diff (`//distro:rules_pkg-0.2.5`), further confirming that
`pkgfilegroup` was available with a custom project importing rules_pkg.

Fixes #104.
  • Loading branch information
Andrew Psaltis committed Mar 25, 2020
1 parent b60dabf commit 1e5d153
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion pkg/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ exports_files(

filegroup(
name = "standard_package",
srcs = glob(["BUILD", "*.bzl", "*.py", "*.md"]),
srcs = glob([
"*.bzl",
"*.py",
"*.md",
]) + [
"BUILD",
"WORKSPACE",
"//experimental:standard_package",
],
visibility = ["@//distro:__pkg__"],
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pkg_tar(
mode = "0444",
# Make it owned by root so it does not have the uid of the CI robot.
owner = "0.0",
package_dir = ".",
package_dir = "pkg",
strip_prefix = ".",
)

Expand Down
8 changes: 8 additions & 0 deletions pkg/experimental/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ exports_files(
glob(["*.bzl"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "standard_package",
srcs = glob(["*.bzl"]) + [
"BUILD",
],
visibility = ["@//:__pkg__"],
)

0 comments on commit 1e5d153

Please sign in to comment.