Skip to content

refactor: Minor compatibility fixes #1044

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ bzl_library(
srcs = [
"platform_utils.bzl",
"@host_platform//:constraints.bzl", # keep
"@local_config_platform//:constraints.bzl", # keep
"@platforms//host:constraints.bzl", # keep
],
visibility = ["//lib:__subpackages__"],
Expand Down
2 changes: 1 addition & 1 deletion lib/private/bats_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ BATS_FILE_VERSIONS = {
}

BATS_CORE_TEMPLATE = """\
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
load("@aspect_bazel_lib//lib/private:bats_toolchain.bzl", "bats_toolchain")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")

copy_to_directory(
name = "core",
Expand Down
1 change: 0 additions & 1 deletion lib/private/copy_directory_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:copy_directory_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
1 change: 0 additions & 1 deletion lib/private/copy_to_directory_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:copy_to_directory_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
1 change: 0 additions & 1 deletion lib/private/coreutils_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:coreutils_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
1 change: 0 additions & 1 deletion lib/private/expand_template_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:expand_template_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
1 change: 0 additions & 1 deletion lib/private/jq_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:jq_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
2 changes: 1 addition & 1 deletion lib/private/platform_utils.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Utility functions for platforms"""

load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")

def _host_platform_is_darwin():
return "@platforms//os:osx" in HOST_CONSTRAINTS
Expand Down
1 change: 0 additions & 1 deletion lib/private/source_toolchains_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["{toolchain_type}"],
incompatible_use_toolchain_transition = True,
)
"""

Expand Down
3 changes: 1 addition & 2 deletions lib/private/tar_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,13 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:tar_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)

build_content = """# @generated by @aspect_bazel_lib//lib/private:tar_toolchain.bzl
load(":defs.bzl", "resolved_toolchain")
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")

resolved_toolchain(name = "resolved_toolchain", visibility = ["//visibility:public"])"""

Expand Down
2 changes: 1 addition & 1 deletion lib/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _is_bazel_7_or_greater():

def is_bzlmod_enabled():
"""Detect the value of the --enable_bzlmod flag"""
return str(Label("@//:BUILD.bazel")).startswith("@@")
return str(Label("//:BUILD.bazel")).startswith("@@")

def _maybe_http_archive(**kwargs):
"""Adapts a maybe(http_archive, ...) to look like an http_archive.
Expand Down
1 change: 0 additions & 1 deletion lib/private/yq_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:yq_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)
Expand Down
3 changes: 1 addition & 2 deletions lib/private/zstd_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@ def _resolved_toolchain_impl(ctx):
resolved_toolchain = rule(
implementation = _resolved_toolchain_impl,
toolchains = ["@aspect_bazel_lib//lib:zstd_toolchain_type"],
incompatible_use_toolchain_transition = True,
)
"""
rctx.file("defs.bzl", starlark_content)

build_content = """# @generated by @aspect_bazel_lib//lib/private:zstd_toolchain.bzl
load(":defs.bzl", "resolved_toolchain")
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")

resolved_toolchain(name = "resolved_toolchain", visibility = ["//visibility:public"])"""

Expand Down
Loading