Closed aiuto closed 1 year ago
Thanks @aiuto for the heads up! Seems like an easy fix, I'll do that.
Oh boy, I had some fun here. I kept getting errors using load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
, it kept saying pkg
is not a package. Using load("@rules_pkg//:pkg.bzl", "pkg_tar")
worked, but that clearly means I'm using an old version of rules_pkg. Looking into the cached directories, I found the reason: io_bazel_rules_docker
also calls rules_pkg, but with the 0.2.6 version.
Aliasing my import to rules_pkg_070 fixed it, but seems ugly. I am really surprised bazel let me shadow a version of a dependency with the same name.
What you can normally do is just make sure the newer rules_pkg is loaded before rules_docker, then both will pick up the new version. Do you have a PR for this? I could take a look at that.
Uploaded my changes as #75. I'd appreciate your look @aiuto.
Doing the versioned pkg_tar is super ugly.
Once https://github.com/bazelbuild/rules_docker/pull/2125 goes in, and rules_docker cuts a new release, you can unify them again.
Or, like I said, put rules_pkg before rules_docker so you get the one you want.
Updated #75, PTAL.
example_bazel/BULID.bazel contains the line `load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar").
That should be changed to
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
and rules_license added to the WORKSPACE as per https://github.com/bazelbuild/rules_pkg/releases/tag/0.7.0In Bazel 6.0 your example may cease to work, either because pkg_tar is removed, or simply because the mode and ownername attributes are removed.