Skip to content

rules_pkg breaks "bazel fetch" when using Bzlmod #953

Open
@srdo-humio

Description

@srdo-humio

The addition of local_repository in cc4b9c0#diff-6136fc12446089c3db7360e923203dd114b6a1466252e71667c6791c20fe6bdc appears to break "bazel fetch" when using rules_pkg as a Bazel module:

My MODULE.bazel

bazel_dep(name = "rules_pkg", version = "1.1.0")
$ bazel fetch
ERROR: The repository's path is "tests/mappings/external_repo" (absolute: "/home/sdoessing/my-project/tests/mappings/external_repo") but it does not exist or is not a directory.

It seems like Bazel assumes local_repository is relative to my project's root, rather than the root of rules_pkg.

Since WORKSPACE is on the way out, maybe this could be fixed by converting tests/mappings/external_repo into a module and using local_path_override instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions