Skip to content

Commit

Permalink
fix: remove module_ctx.extension_metadata
Browse files Browse the repository at this point in the history
In the current Bzlmod setup, all repositories generated by the `graalvm`
extension may or may not be used by users and whether they should be
can't be predicted based on the given tags: Users that want to generate
toolchains need the `<name>_toolchains` repo, users that rely on SDK
files need the `<name>` repo.

For now, remove the use of `module_ctx.extension_metadata` so that no
warning is shown when users register toolchains in `<name>_toolchains`.
In the future, we should improve the way toolchains are registered with
Bzlmod by automatically registering a toolchain configured via tags.

Signed-off-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
fmeum authored and sgammon committed Sep 11, 2023
1 parent b990774 commit 7759849
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ def _gvm_impl(mctx):
setup_actions = selected.setup_actions,
)

_extension_meta = {}
if not mctx.root_module_has_non_dev_dependency:
_extension_meta["root_module_direct_dev_deps"] = [selected.name]
_extension_meta["root_module_direct_deps"] = []
else:
_extension_meta["root_module_direct_deps"] = [selected.name]
_extension_meta["root_module_direct_dev_deps"] = []

return mctx.extension_metadata(
**_extension_meta
)

_graalvm = tag_class(attrs = {
"name": attr.string(mandatory = True),
"version": attr.string(mandatory = True),
Expand Down

0 comments on commit 7759849

Please sign in to comment.