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

refactor: depend on bazel-skylib at runtime #3056

Merged
merged 1 commit into from
Nov 1, 2021
Merged

refactor: depend on bazel-skylib at runtime #3056

merged 1 commit into from
Nov 1, 2021

Conversation

alexeagle
Copy link
Collaborator

This allows us to always publish regular bzl_library targets. We can also stop carefully vendoring skylib and shipping our own copy.
Eventually we would run into a provider problem, where our vendored copy doesn't have the same provider symbol as the real repo.

BREAKING CHANGE:

build_bazel_rules_nodejs now depends on bazel_skylib.
You can install it in your WORKSPACE directly, or use our helper macro like so:

This allows us to always publish regular bzl_library targets.
We can also stop carefully vendoring skylib and shipping our own copy.
Eventually we would run into a provider problem, where our vendored copy
doesn't have the same provider symbol as the real repo.

BREAKING CHANGE:

build_bazel_rules_nodejs now depends on bazel_skylib.
You can install it in your WORKSPACE directly, or use our helper macro like so:
@@ -25,6 +25,10 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_dependencies")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this pattern around. rules_docker uses it

load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", rules_nodejs_dependencies = "dependencies")
rules_nodejs_dependencies()

It avoids the unnecessary scoping in the rnj repo. Wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rules_docker:

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)
container_repositories()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes users use the re-assignment syntax in the load statement that they may not have seen, and is overall more complex to have a second name for the thing (some users might not re-assign)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rules_docker kinda needs it since they have so many language ecosystems to namespace?

@gregmagolan gregmagolan self-requested a review November 1, 2021 18:59
Copy link
Collaborator

@gregmagolan gregmagolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👾

@alexeagle alexeagle merged commit e5d4803 into 5.x Nov 1, 2021
@alexeagle alexeagle deleted the dep_on_skylib branch November 1, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants