Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_tar rule does not work. #907

Open
jtillwickEA opened this issue Dec 20, 2024 · 1 comment
Open

pkg_tar rule does not work. #907

jtillwickEA opened this issue Dec 20, 2024 · 1 comment
Labels

Comments

@jtillwickEA
Copy link

jtillwickEA commented Dec 20, 2024

My WORKSPACE file has this:

http_archive(
    name = "rules_pkg",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz",
        "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz",
    ],
    sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

My BUILD.bazel file has this:

load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

pkg_tar(
    name = "assets",
    srcs = ["//assets:files"],
    strip_prefix = "."
)

I get the following error:

Label '@rules_pkg//pkg:tar.bzl' is invalid because 'pkg' is not a package; perhaps you meant to put the colon here: '@rules_pkg//:pkg/tar.bzl'?

I am using bazel 5.2.0.

How do I get this to work? There is ZERO documentation on this.

@tonyaiuto
Copy link
Collaborator

That should work. My only hunch is that your WORKSPACE ordering brings in an older version of rules_pkg later on.
There is no way to tell without examining your WORKSPACE file to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants