From 651018c6e7052b08959625d89badea8516a2c0a1 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sun, 13 Aug 2023 02:32:58 -0700 Subject: [PATCH] fix: fixes for bzlmod test --- .bazelignore | 2 + MODULE.bazel.lock | 38 ++++++++++++++----- .../{ => integration_tests}/bzlmod/.bazelrc | 0 .../bzlmod/.bazelversion | 0 .../bzlmod/MODULE.bazel | 4 +- .../bzlmod/MODULE.bazel.lock | 2 +- .../bzlmod/WORKSPACE.bazel | 0 .../bzlmod/WORKSPACE.bzlmod | 0 .../bzlmod/sample/BUILD.bazel | 0 .../bzlmod/sample/Main.java | 0 tools/bazel/base.bazelrc | 1 + 11 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 .bazelignore rename example/{ => integration_tests}/bzlmod/.bazelrc (100%) rename example/{ => integration_tests}/bzlmod/.bazelversion (100%) rename example/{ => integration_tests}/bzlmod/MODULE.bazel (95%) rename example/{ => integration_tests}/bzlmod/MODULE.bazel.lock (99%) rename example/{ => integration_tests}/bzlmod/WORKSPACE.bazel (100%) rename example/{ => integration_tests}/bzlmod/WORKSPACE.bzlmod (100%) rename example/{ => integration_tests}/bzlmod/sample/BUILD.bazel (100%) rename example/{ => integration_tests}/bzlmod/sample/Main.java (100%) diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..da441ac7 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,2 @@ +example/integration_tests +example/integration_tests/bzlmod diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 36c9f87d..0c9a8757 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 1, - "moduleFileHash": "6ed7671e2df32e1059871436f14f0b8420ac45c9f4dd6a5586008ee969ef40bc", + "moduleFileHash": "618d7112f0da53485db4528465e4f51516c4653069d5247a66abbaf819446878", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -54,25 +54,27 @@ "hasNonDevUseExtension": true }, { - "extensionBzlFile": "@apple_rules_lint//lint:extensions.bzl", - "extensionName": "linter", + "extensionBzlFile": ":extensions.bzl", + "extensionName": "graalvm", "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 143, - "column": 23 + "line": 139, + "column": 20 + }, + "imports": { + "graalvm": "graalvm" }, - "imports": {}, "devImports": [], "tags": [ { - "tagName": "register", - "attributeValues": {"name":"--java-checkstyle"}, + "tagName": "graalvm", + "attributeValues": {"name":"--graalvm","version":"--20.0.2","distribution":"--oracle","java_version":"--20"}, "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 144, - "column": 16 + "line": 141, + "column": 12 } } ], @@ -3343,6 +3345,22 @@ "attributes": {"name":"--buildifier_prebuilt~6.1.2.1~buildifier_prebuilt_deps_extension~buildifier_linux_arm64","urls":["--https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-arm64"],"downloaded_file_path":"--buildifier","executable":true,"sha256":"--0ba6e8e3208b5a029164e542ddb5509e618f87b639ffe8cc2f54770022853080"} } } + }, + "//:extensions.bzl%graalvm": { + "bzlTransitiveDigest": "yKSZqFgZDsBQJ7idxvtiuwWuk7K9Ym2V3xNPD2f4I4c=", + "envVariables": {}, + "generatedRepoSpecs": { + "graalvm": { + "bzlFile": "@@//internal:graalvm_bindist.bzl", + "ruleClassName": "_graalvm_bindist_repository", + "attributes": {"name":"--_main~graalvm~graalvm","version":"--20.0.2","java_version":"--20","distribution":"--oracle","components":[],"setup_actions":[],"enable_toolchain":true,"toolchain_config":"--graalvm_toolchain_config_repo","sha256":"--"} + }, + "graalvm_toolchain_config_repo": { + "bzlFile": "@@//internal:graalvm_bindist.bzl", + "ruleClassName": "_toolchain_config", + "attributes": {"name":"--_main~graalvm~graalvm_toolchain_config_repo","build_file":"--\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"graalvm_20\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"20\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"gvm\",\n target_compatible_with = [],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@rules_graalvm//graalvm/toolchain:graalvm\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"native_image\",\n target_compatible_with = [],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@rules_graalvm//graalvm/toolchain:graalvm_native_image\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n"} + } + } } } } \ No newline at end of file diff --git a/example/bzlmod/.bazelrc b/example/integration_tests/bzlmod/.bazelrc similarity index 100% rename from example/bzlmod/.bazelrc rename to example/integration_tests/bzlmod/.bazelrc diff --git a/example/bzlmod/.bazelversion b/example/integration_tests/bzlmod/.bazelversion similarity index 100% rename from example/bzlmod/.bazelversion rename to example/integration_tests/bzlmod/.bazelversion diff --git a/example/bzlmod/MODULE.bazel b/example/integration_tests/bzlmod/MODULE.bazel similarity index 95% rename from example/bzlmod/MODULE.bazel rename to example/integration_tests/bzlmod/MODULE.bazel index 175d9be5..21c108b6 100644 --- a/example/bzlmod/MODULE.bazel +++ b/example/integration_tests/bzlmod/MODULE.bazel @@ -17,7 +17,7 @@ bazel_dep( local_path_override( module_name = "rules_graalvm", - path = "../..", + path = "../../..", ) gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm") @@ -31,4 +31,4 @@ gvm.graalvm( use_repo( gvm, "graalvm", -) \ No newline at end of file +) diff --git a/example/bzlmod/MODULE.bazel.lock b/example/integration_tests/bzlmod/MODULE.bazel.lock similarity index 99% rename from example/bzlmod/MODULE.bazel.lock rename to example/integration_tests/bzlmod/MODULE.bazel.lock index 20a4aee3..516694b7 100644 --- a/example/bzlmod/MODULE.bazel.lock +++ b/example/integration_tests/bzlmod/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 1, - "moduleFileHash": "fa529415d9c8038fa5faa74fc6a472bacd5a8d26b4bd32be00c68c1e2218dd6e", + "moduleFileHash": "6be84de15badc5396a07a1fb21af5fcef4bac5f5368efd8aeb1b098effc794bb", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" diff --git a/example/bzlmod/WORKSPACE.bazel b/example/integration_tests/bzlmod/WORKSPACE.bazel similarity index 100% rename from example/bzlmod/WORKSPACE.bazel rename to example/integration_tests/bzlmod/WORKSPACE.bazel diff --git a/example/bzlmod/WORKSPACE.bzlmod b/example/integration_tests/bzlmod/WORKSPACE.bzlmod similarity index 100% rename from example/bzlmod/WORKSPACE.bzlmod rename to example/integration_tests/bzlmod/WORKSPACE.bzlmod diff --git a/example/bzlmod/sample/BUILD.bazel b/example/integration_tests/bzlmod/sample/BUILD.bazel similarity index 100% rename from example/bzlmod/sample/BUILD.bazel rename to example/integration_tests/bzlmod/sample/BUILD.bazel diff --git a/example/bzlmod/sample/Main.java b/example/integration_tests/bzlmod/sample/Main.java similarity index 100% rename from example/bzlmod/sample/Main.java rename to example/integration_tests/bzlmod/sample/Main.java diff --git a/tools/bazel/base.bazelrc b/tools/bazel/base.bazelrc index d543590d..c1b6de0f 100644 --- a/tools/bazel/base.bazelrc +++ b/tools/bazel/base.bazelrc @@ -1,3 +1,4 @@ build --collect_code_coverage build --instrumentation_filter="//graalvm" +