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

Remove implicit dependency on buildifier #44

Open
ian-h-chamberlain opened this issue Dec 27, 2019 · 0 comments
Open

Remove implicit dependency on buildifier #44

ian-h-chamberlain opened this issue Dec 27, 2019 · 0 comments

Comments

@ian-h-chamberlain
Copy link
Contributor

Only loading com_apt_itude_rules_pip and calling pip_repository rules, e.g.

load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@com_apt_itude_rules_pip//rules:repository.bzl", "pip_repository")
load("//python:versions.bzl", "PYTHON2", "PYTHON3")

maybe(
    pip_repository,
    name = "pip2",
    python_interpreter = PYTHON2,
    requirements_per_platform = {
        "//thirdparty/pip/2:requirements-linux.txt": "linux",
        "//thirdparty/pip/2:requirements-osx.txt": "osx",
    },
)

maybe(
    pip_repository,
    name = "pip3",
    python_interpreter = PYTHON3,
    requirements_per_platform = {
        "//thirdparty/pip/3:requirements-linux.txt": "linux",
        "//thirdparty/pip/3:requirements-osx.txt": "osx",
    },
)

Results in the following error:

ERROR: Analysis of target '//thirdparty/pip/3:compile' failed; build aborted: error loading package '@com_apt_itude_rules_pip//': Unable to find pa
ckage for @com_github_bazelbuild_buildtools//buildifier:def.bzl: The repository '@com_github_bazelbuild_buildtools' could not be resolved.
INFO: Elapsed time: 0.233s

The problem seems to be caused by https://github.com/apt-itude/rules_pip/blob/master/BUILD where buildifier is being loaded. This should be moved to a private BUILD file instead of being publicly visible in the top level, so that other libraries depending on rules_pip are not required to depend on buildifier (and therefore go toolchains, etc).

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

No branches or pull requests

1 participant