Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mark internal deps as dev_depenencies so that downstream modules don't require those #1640

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

Merged
merged 6 commits into from
Jul 31, 2023

Conversation

macandy13
Copy link
Contributor

bzlmod module dependencies support tagging specific upstream modules as internal. That means those are only used when actually working within the project, but those deps are not needed by other downstream modules depending on that said module.

This change will allow to directly use the MODULE.bazel file of the google-benchmark project in the Bazel Central Registry.

@macandy13 macandy13 marked this pull request as ready for review July 24, 2023 13:27
@@ -1,22 +1,22 @@
module(name = "com_github_google_benchmark", version="1.8.2")
module(name = "google_benchmark", version="1.8.2")
Copy link
Member

Choose a reason for hiding this comment

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

will this break anything anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, actually it is the other way round - in the Bazel Central Registry, the module name must match the directory, and the convention there is not to use 'com_github' prefixes. So the unified name now is 'google_benchmark'.


bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_foreign_cc", version = "0.9.0")
bazel_dep(name = "rules_cc", version = "0.0.6")
bazel_dep(name = "rules_python", version = "0.24.0")
bazel_dep(name = "googletest", version = "1.12.1", repo_name = "com_google_googletest")
bazel_dep(name = "rules_python", version = "0.24.0", dev_dependency = True)
Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure this is a "dev" dependency as it's required to build the bindings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I am torn on this as well. The question is how people will use the Python library in their projects (iff they rely on Bazel).

Since there is a PyPI package for this module, my assumption was this would be the preferred way of depending on the library, instead of pulling in the github source code and depending on the BUILD targets directly. But that is my personal speculation.

If you think the preferred way should be the second option, I am happy to remove it here.
WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

i think you're right. leave it as a dev dependency. thanks.

@dmah42 dmah42 merged commit 6e80474 into google:main Jul 31, 2023
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

Successfully merging this pull request may close these issues.

2 participants