Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelnaranjo committed Dec 10, 2024
1 parent d8d739f commit da7af3d
Show file tree
Hide file tree
Showing 14 changed files with 680 additions and 433 deletions.
9 changes: 0 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ gazelle_binary(
)

# gazelle:prefix github.com/rmohr/bazeldnf
# gazelle:resolve go github.com/bazelbuild/buildtools/build @com_github_bazelbuild_buildtools//build:go_default_library
# gazelle:resolve go github.com/bazelbuild/buildtools/edit @com_github_bazelbuild_buildtools//edit:go_default_library
gazelle(
name = "gazelle",
args = [
Expand Down Expand Up @@ -84,13 +82,6 @@ cc_library(
srcs = ["//:something_libs/usr/lib64"],
)

bzl_library(
name = "build_deps",
srcs = ["build_deps.bzl"],
visibility = ["//visibility:public"],
deps = ["@gazelle//:deps"],
)

bzl_library(
name = "def",
srcs = ["def.bzl"],
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bazel_dep(name = "rules_go", version = "0.49.0")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")

use_repo(
go_deps,
"com_github_adrg_xdg",
Expand Down
6 changes: 5 additions & 1 deletion bazeldnf/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def _alias_repository_impl(repository_ctx):
)
for rpm in repository_ctx.attr.rpms:
actual_name = rpm.repo_name
if not repository_ctx.attr.repository_prefix:
continue
name = actual_name.split(repository_ctx.attr.repository_prefix, 1)[-1]

repository_ctx.file(
"%s/BUILD.bazel" % name,
_ALIAS_TEMPLATE.format(
Expand Down Expand Up @@ -144,8 +147,9 @@ def _handle_lock_file(config, module_ctx, registered_rpms = {}):
return config.name

def _toolchain_extension(module_ctx):
# make sure all our dependencies are registered as those may be needed when those
# dependening in this repo build the toolchain from sources
repos = []

for mod in module_ctx.modules:
for toolchain in mod.tags.toolchain:
if toolchain.name != _DEFAULT_NAME and not mod.is_root:
Expand Down
Loading

0 comments on commit da7af3d

Please sign in to comment.