Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ Please fill out either the individual or corporate [Contributor License Agreemen

Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.

## Contributing A Patch
## How to Build and Test

Look into `./test.sh` to understand how. Minimally,

1. Build `dpkg_parser.par` first, if not done so: `bazel build //package_manager:dpkg_parser.par` (You may need to provide `--host_force_python=PY2` as in `test.sh`.)

You don't have to repeat this step unless you cleaned your workspace or want to generate a new version of `dpkg_parser.par`.
1. `bazel build //...`
Comment thread
chanseokoh marked this conversation as resolved.

For running tests, do `bazel test //...`.

For building and loading images to your local Docker engine, do `bazel run //java:java11_debian10` for example. After successful build, `docker images` will list images like `bazel/java:java11_debian10`.

## Contributing a Patch

1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
Expand Down
3 changes: 0 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ go_rules_dependencies()

go_register_toolchains()

load("//package_manager:package_manager.bzl", "package_manager_repositories")
load("//package_manager:dpkg.bzl", "dpkg_list", "dpkg_src")

package_manager_repositories()

dpkg_src(
name = "debian_stretch",
arch = "amd64",
Expand Down
30 changes: 0 additions & 30 deletions package_manager/cloudbuild.yaml

This file was deleted.

16 changes: 4 additions & 12 deletions package_manager/dpkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ exports_files(deb_files + ["packages.bzl"])
""")

args = [
repository_ctx.path(repository_ctx.attr._dpkg_parser),
# dpkg_parser.par must be built separately beforehand (bazel build ... //package_manager:dpkg_parser.par)
str(repository_ctx.path(Label("//:WORKSPACE")).dirname) + "/bazel-bin/package_manager/dpkg_parser.par",
Comment thread
chanseokoh marked this conversation as resolved.
"--package-files",
",".join([str(repository_ctx.path(src_path)) for src_path in repository_ctx.attr.sources]),
"--packages",
Expand All @@ -26,11 +27,6 @@ _dpkg_list = repository_rule(
allow_files = True,
),
"packages": attr.string_list(),
"_dpkg_parser": attr.label(
executable = True,
default = Label("@dpkg_parser//file:downloaded"),
cfg = "host",
),
},
)

Expand All @@ -40,7 +36,8 @@ package(default_visibility = ["//visibility:public"])
exports_files(["Packages.json", "os_release.tar"])
""")
args = [
repository_ctx.path(repository_ctx.attr._dpkg_parser),
# dpkg_parser.par must be built separately beforehand (bazel build ... //package_manager:dpkg_parser.par)
str(repository_ctx.path(Label("//:WORKSPACE")).dirname) + "/bazel-bin/package_manager/dpkg_parser.par",
"--download-and-extract-only=True",
"--mirror-url=" + repository_ctx.attr.url,
"--arch=" + repository_ctx.attr.arch,
Expand All @@ -65,11 +62,6 @@ _dpkg_src = repository_rule(
"packages_gz_url": attr.string(),
"package_prefix": attr.string(),
"sha256": attr.string(),
"_dpkg_parser": attr.label(
executable = True,
default = Label("@dpkg_parser//file:downloaded"),
cfg = "host",
),
},
)

Expand Down
13 changes: 0 additions & 13 deletions package_manager/package_manager.bzl

This file was deleted.

4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
set -o errexit
set -o xtrace

# Linting
./buildifier.sh
find . -name "*.py" | xargs pylint --disable=R,C

# Bazel build and test
bazel clean --host_force_python=PY2 --curses=no
bazel build --host_force_python=PY2 --curses=no //package_manager:dpkg_parser.par
bazel build --host_force_python=PY2 --curses=no //...
bazel test --host_force_python=PY2 --curses=no --test_output=errors //...
Comment thread
chanseokoh marked this conversation as resolved.