From 1c05cd3224a48859857c371438261ac1ce19505e Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Mon, 23 Sep 2024 18:43:45 -0700 Subject: [PATCH] fix: declare host_platform as non-dev dep (#945) Fix https://github.com/bazel-contrib/bazel-lib/issues/944 --- MODULE.bazel | 2 +- e2e/api_entries/.bazeliskrc | 1 + e2e/api_entries/.bazelrc | 15 +++++++++ e2e/api_entries/.bazelversion | 1 + e2e/api_entries/BUILD.bazel | 57 ++++++++++++++++++++++++++++++++ e2e/api_entries/MODULE.bazel | 7 ++++ e2e/api_entries/WORKSPACE | 27 +++++++++++++++ e2e/api_entries/WORKSPACE.bzlmod | 0 8 files changed, 109 insertions(+), 1 deletion(-) create mode 120000 e2e/api_entries/.bazeliskrc create mode 100644 e2e/api_entries/.bazelrc create mode 120000 e2e/api_entries/.bazelversion create mode 100644 e2e/api_entries/BUILD.bazel create mode 100644 e2e/api_entries/MODULE.bazel create mode 100644 e2e/api_entries/WORKSPACE create mode 100644 e2e/api_entries/WORKSPACE.bzlmod diff --git a/MODULE.bazel b/MODULE.bazel index 95c3ddf..c5135a0 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -73,7 +73,7 @@ host = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "host", dev_depend host.host() use_repo(host, "aspect_bazel_lib_host") -host_platform = use_extension("@platforms//host:extension.bzl", "host_platform", dev_dependency = True) +host_platform = use_extension("@platforms//host:extension.bzl", "host_platform") use_repo(host_platform, "host_platform") bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc10", dev_dependency = True) diff --git a/e2e/api_entries/.bazeliskrc b/e2e/api_entries/.bazeliskrc new file mode 120000 index 0000000..0fbe20f --- /dev/null +++ b/e2e/api_entries/.bazeliskrc @@ -0,0 +1 @@ +../../.bazeliskrc \ No newline at end of file diff --git a/e2e/api_entries/.bazelrc b/e2e/api_entries/.bazelrc new file mode 100644 index 0000000..e1b3ea1 --- /dev/null +++ b/e2e/api_entries/.bazelrc @@ -0,0 +1,15 @@ +# Import Aspect bazelrc presets +try-import %workspace%/../../.aspect/bazelrc/local/bazel7.bazelrc +import %workspace%/../../.aspect/bazelrc/convenience.bazelrc +import %workspace%/../../.aspect/bazelrc/correctness.bazelrc +import %workspace%/../../.aspect/bazelrc/debug.bazelrc +import %workspace%/../../.aspect/bazelrc/javascript.bazelrc +import %workspace%/../../.aspect/bazelrc/performance.bazelrc + +### YOUR PROJECT SPECIFIC OPTIONS GO HERE ### + +# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`. +# This file should appear in `.gitignore` so that settings are not shared with team members. This +# should be last statement in this config so the user configuration is able to overwrite flags from +# this file. See https://bazel.build/configure/best-practices#bazelrc-file. +try-import %workspace%/../../.aspect/bazelrc/user.bazelrc diff --git a/e2e/api_entries/.bazelversion b/e2e/api_entries/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/api_entries/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/api_entries/BUILD.bazel b/e2e/api_entries/BUILD.bazel new file mode 100644 index 0000000..22e5a24 --- /dev/null +++ b/e2e/api_entries/BUILD.bazel @@ -0,0 +1,57 @@ +load("@bazel_skylib//rules:build_test.bzl", "build_test") + +# Ensure all lib:* bzl_target libraries can be loaded from a MODULE +# Targets from: `bazel query "kind('bzl_library', //lib:*)"` +build_test( + name = "api_bzl_entries", + targets = [ + "@aspect_bazel_lib//lib:base64", + "@aspect_bazel_lib//lib:bats", + "@aspect_bazel_lib//lib:bats_toolchain_type", + "@aspect_bazel_lib//lib:bazelrc_presets", + "@aspect_bazel_lib//lib:bzlmod", + "@aspect_bazel_lib//lib:copy_directory", + "@aspect_bazel_lib//lib:copy_directory_toolchain_type", + "@aspect_bazel_lib//lib:copy_file", + "@aspect_bazel_lib//lib:copy_to_bin", + "@aspect_bazel_lib//lib:copy_to_directory", + "@aspect_bazel_lib//lib:copy_to_directory_toolchain_type", + "@aspect_bazel_lib//lib:coreutils_toolchain_type", + "@aspect_bazel_lib//lib:diff_test", + "@aspect_bazel_lib//lib:directory_path", + "@aspect_bazel_lib//lib:docs", + "@aspect_bazel_lib//lib:enable_runfiles", + "@aspect_bazel_lib//lib:expand_make_vars", + "@aspect_bazel_lib//lib:expand_template", + "@aspect_bazel_lib//lib:expand_template_toolchain_type", + "@aspect_bazel_lib//lib:extensions", + "@aspect_bazel_lib//lib:flag_bzlmod", + "@aspect_bazel_lib//lib:glob_match", + "@aspect_bazel_lib//lib:host_repo", + "@aspect_bazel_lib//lib:jq", + "@aspect_bazel_lib//lib:jq_toolchain_type", + "@aspect_bazel_lib//lib:lists", + "@aspect_bazel_lib//lib:output_files", + "@aspect_bazel_lib//lib:params_file", + "@aspect_bazel_lib//lib:paths", + "@aspect_bazel_lib//lib:platform_utils", + "@aspect_bazel_lib//lib:repo_utils", + "@aspect_bazel_lib//lib:repositories", + "@aspect_bazel_lib//lib:resource_sets", + "@aspect_bazel_lib//lib:run_binary", + "@aspect_bazel_lib//lib:stamp", + "@aspect_bazel_lib//lib:stamp_detect", + "@aspect_bazel_lib//lib:stamping", + "@aspect_bazel_lib//lib:strings", + "@aspect_bazel_lib//lib:tar", + "@aspect_bazel_lib//lib:tar_toolchain_type", + "@aspect_bazel_lib//lib:testing", + "@aspect_bazel_lib//lib:transitions", + "@aspect_bazel_lib//lib:utils", + "@aspect_bazel_lib//lib:windows_utils", + "@aspect_bazel_lib//lib:write_source_files", + "@aspect_bazel_lib//lib:yq", + "@aspect_bazel_lib//lib:yq_toolchain_type", + "@aspect_bazel_lib//lib:zstd_toolchain_type", + ], +) diff --git a/e2e/api_entries/MODULE.bazel b/e2e/api_entries/MODULE.bazel new file mode 100644 index 0000000..58575a3 --- /dev/null +++ b/e2e/api_entries/MODULE.bazel @@ -0,0 +1,7 @@ +bazel_dep(name = "aspect_bazel_lib", version = "0.0.0", dev_dependency = True) +local_path_override( + module_name = "aspect_bazel_lib", + path = "../..", +) + +bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True) diff --git a/e2e/api_entries/WORKSPACE b/e2e/api_entries/WORKSPACE new file mode 100644 index 0000000..7b95d75 --- /dev/null +++ b/e2e/api_entries/WORKSPACE @@ -0,0 +1,27 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "bazel_skylib", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + ], +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() + +local_repository( + name = "aspect_bazel_lib", + path = "../..", +) + +load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_coreutils_toolchains") + +aspect_bazel_lib_dependencies() + +# Registering coreutils is required under WORKSPACE for the copy action to work +# Under bzlmod, this is done automatically by just depending on the bazel-lib module. +register_coreutils_toolchains() diff --git a/e2e/api_entries/WORKSPACE.bzlmod b/e2e/api_entries/WORKSPACE.bzlmod new file mode 100644 index 0000000..e69de29