Skip to content

Commit

Permalink
chore: run buildifer
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Sep 8, 2023
1 parent 79ddbc2 commit 77c9c05
Show file tree
Hide file tree
Showing 21 changed files with 133 additions and 131 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ register_toolchains(
"@graalvm//:jvm",
dev_dependency = True,
)

register_toolchains(
"@graalvm//:sdk",
dev_dependency = True,
Expand Down
8 changes: 4 additions & 4 deletions docs/api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"Aliases to documentation targets for the package API."

load(
"@io_bazel_stardoc//stardoc:stardoc.bzl",
"stardoc",
)
load(
"@bazel_skylib//:bzl_library.bzl",
"bzl_library",
)
load(
"@io_bazel_stardoc//stardoc:stardoc.bzl",
"stardoc",
)

bzl_library(
name = "repo_tools",
Expand Down
1 change: 1 addition & 0 deletions example/integration_tests/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ use_repo(
)

register_toolchains("@graalvm//:jvm")

register_toolchains("@graalvm//:sdk")
7 changes: 4 additions & 3 deletions example/integration_tests/components-ce/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ local_path_override(
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm")
gvm.graalvm(
name = "graalvm",
distribution = "ce",
java_version = "20",
version = "20.0.2",
components = [
"js", # should automatically install `regex` and other dependencies
"wasm",
],
distribution = "ce",
java_version = "20",
version = "20.0.2",
)
use_repo(
gvm,
"graalvm",
)

register_toolchains("@graalvm//:jvm")

register_toolchains("@graalvm//:sdk")
4 changes: 2 additions & 2 deletions example/integration_tests/components-ce/sample/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ java_binary(

native_image(
name = "main-native",
main_class = "Main",
deps = [":java"],
extra_args = [
"--language:js",
],
main_class = "Main",
deps = [":java"],
)

alias(
Expand Down
7 changes: 4 additions & 3 deletions example/integration_tests/components-oracle/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ local_path_override(
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm")
gvm.graalvm(
name = "graalvm",
distribution = "oracle",
java_version = "20",
version = "20.0.2",
components = [
"js", # should automatically install `regex` and other dependencies
"wasm",
],
distribution = "oracle",
java_version = "20",
version = "20.0.2",
)
use_repo(
gvm,
"graalvm",
)

register_toolchains("@graalvm//:jvm")

register_toolchains("@graalvm//:sdk")
8 changes: 4 additions & 4 deletions example/legacy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load(
"@rules_graalvm//graal:graal.bzl",
"graal_binary",
)
load(
"@rules_java//java:defs.bzl",
"java_binary",
"java_library",
)
load(
"@rules_graalvm//graal:graal.bzl",
"graal_binary",
)

package(default_visibility = [
"//tests:__subpackages__",
Expand Down
8 changes: 4 additions & 4 deletions example/native/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load(
"@rules_graalvm//graalvm:defs.bzl",
"native_image",
)
load(
"@rules_java//java:defs.bzl",
"java_binary",
"java_library",
)
load(
"@rules_graalvm//graalvm:defs.bzl",
"native_image",
)

package(default_visibility = [
"//tests:__subpackages__",
Expand Down
4 changes: 2 additions & 2 deletions graal/graal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ load(
)
load(
"//internal/native_image:classic.bzl",
_DEBUG = "DEBUG_CONDITION",
_OPTIMIZATION_MODE = "OPTIMIZATION_MODE_CONDITION",
_BAZEL_CPP_TOOLCHAIN_TYPE = "BAZEL_CPP_TOOLCHAIN_TYPE",
_BAZEL_CURRENT_CPP_TOOLCHAIN = "BAZEL_CURRENT_CPP_TOOLCHAIN",
_DEBUG = "DEBUG_CONDITION",
_DEFAULT_GVM_REPO = "DEFAULT_GVM_REPO",
_NATIVE_IMAGE_ATTRS = "NATIVE_IMAGE_ATTRS",
_OPTIMIZATION_MODE = "OPTIMIZATION_MODE_CONDITION",
_graal_binary_implementation = "graal_binary_implementation",
)

Expand Down
2 changes: 1 addition & 1 deletion graalvm/nativeimage/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ load(
"//internal/native_image:rules.bzl",
_BAZEL_CPP_TOOLCHAIN_TYPE = "BAZEL_CPP_TOOLCHAIN_TYPE",
_DEBUG = "DEBUG_CONDITION",
_OPTIMIZATION_MODE = "OPTIMIZATION_MODE_CONDITION",
_GVM_TOOLCHAIN_TYPE = "GVM_TOOLCHAIN_TYPE",
_NATIVE_IMAGE_ATTRS = "NATIVE_IMAGE_ATTRS",
_OPTIMIZATION_MODE = "OPTIMIZATION_MODE_CONDITION",
_graal_binary_implementation = "graal_binary_implementation",
)
load(
Expand Down
38 changes: 19 additions & 19 deletions internal/graalvm_bindist.bzl
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
"Describes binary distribution coordinates for GraalVM releases."

load(
"@bazel_skylib//lib:versions.bzl",
"versions",
"@bazel_skylib//lib:new_sets.bzl",
"sets",
)
load(
"@bazel_skylib//lib:paths.bzl",
"paths",
)
load(
"@bazel_skylib//lib:new_sets.bzl",
"sets",
"@bazel_skylib//lib:versions.bzl",
"versions",
)
load(
"//internal:jdk_build_file.bzl",
_JDK_BUILD_TEMPLATE = "JDK_BUILD_TEMPLATE",
_JDK_BUILD_TEMPLATE_BAZEL5 = "JDK_BUILD_TEMPLATE_BAZEL5",
"//internal:graalvm_bindist_legacy.bzl",
_graal_archive_internal_prefixes = "graal_archive_internal_prefixes",
_graal_native_image_version_configs = "graal_native_image_version_configs",
_graal_version_configs = "graal_version_configs",
)
load(
"//internal:graalvm_bindist_map.bzl",
Expand All @@ -27,10 +28,9 @@ load(
Distribution = "DistributionType",
)
load(
"//internal:graalvm_bindist_legacy.bzl",
_graal_archive_internal_prefixes = "graal_archive_internal_prefixes",
_graal_native_image_version_configs = "graal_native_image_version_configs",
_graal_version_configs = "graal_version_configs",
"//internal:jdk_build_file.bzl",
_JDK_BUILD_TEMPLATE = "JDK_BUILD_TEMPLATE",
_JDK_BUILD_TEMPLATE_BAZEL5 = "JDK_BUILD_TEMPLATE_BAZEL5",
)

_graal_v2_archive_internal_prefixes = {
Expand Down Expand Up @@ -569,7 +569,7 @@ OpenJDK release versions only for newer releases; in some cases, the
This version is required in order to properly resolve artifacts for a given
GraalVM engine version.
"""
""",
),
"java_version": attr.string(
mandatory = True,
Expand All @@ -582,7 +582,7 @@ for multiple Java versions.
Early versions of GraalVM provide Java 8 and 11. This window slides as the
GraalVM release approaches current; at the time of this writing, Java 17
and Java 20 are provided, with Java 17 and Java 21 being the next release.
"""
""",
),
"distribution": attr.string(
mandatory = False,
Expand All @@ -598,7 +598,7 @@ Before the Java 17/20 release (known internally as `23.0.1`), Oracle GraalVM
was known as GraalVM Enterprise Edition, or "GraalVM EE." To use an EE
distribution of GraalVM, use the `artifacts` attribute with a custom artifact
coordinate definition.
"""
""",
),
"toolchain_prefix": attr.string(
mandatory = False,
Expand All @@ -620,7 +620,7 @@ build --tool_java_runtime_version=graalvm_20
```
Both flags are optional, and each are required for the related use case.
"""
""",
),
"components": attr.string_list(
mandatory = False,
Expand All @@ -638,7 +638,7 @@ dependencies (`regex` and `icu4j`).
If you want to define your own components or use third-party components which
are not shipped with GraalVM, see the `artifacts` attribute.
"""
""",
),
"setup_actions": attr.string_list(
mandatory = False,
Expand All @@ -649,15 +649,15 @@ component installation is complete.
Some components need after-installation actions, like Espresso, which requires the
user to run `gu rebuild-images`. These commands can be defined and performed using
this attribute.
"""
""",
),
"enable_toolchain": attr.bool(
mandatory = False,
doc = """
Whether to define Java and GraalVM toolchain targets. These toolchain targets are
used by the modern version of the Native Image rules, and optionally by Baazel as
a Java Toolchain.
"""
""",
),
"toolchain_config": attr.string(
mandatory = True,
Expand All @@ -667,7 +667,7 @@ up with GraalVM and Java toolchains. This repository is used as the actual host
these toolchain configurations, with aliases from the main GraalVM repository.
Normally this name is generated and the user does not have to provide it.
"""
""",
),
},
implementation = _graal_bindist_repository_impl,
Expand Down
1 change: 0 additions & 1 deletion internal/native_image/builder.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def assemble_native_build_options(
if not ctx.attr.allow_fallback:
args.add("--no-fallback")


args.add(ctx.attr.main_class, format = "-H:Class=%s")
args.add(binary.basename.replace(".exe", ""), format = "-H:Name=%s")
args.add(binary.dirname, format = "-H:Path=%s")
Expand Down
4 changes: 2 additions & 2 deletions internal/native_image/classic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ load(
"//internal/native_image:common.bzl",
_BAZEL_CPP_TOOLCHAIN_TYPE = "BAZEL_CPP_TOOLCHAIN_TYPE",
_BAZEL_CURRENT_CPP_TOOLCHAIN = "BAZEL_CURRENT_CPP_TOOLCHAIN",
_DEFAULT_GVM_REPO = "DEFAULT_GVM_REPO",
_DEBUG_CONDITION = "DEBUG_CONDITION",
_OPTIMIZATION_MODE_CONDITION = "OPTIMIZATION_MODE_CONDITION",
_DEFAULT_GVM_REPO = "DEFAULT_GVM_REPO",
_GVM_TOOLCHAIN_TYPE = "GVM_TOOLCHAIN_TYPE",
_NATIVE_IMAGE_ATTRS = "NATIVE_IMAGE_ATTRS",
_OPTIMIZATION_MODE_CONDITION = "OPTIMIZATION_MODE_CONDITION",
_RULES_REPO = "RULES_REPO",
_prepare_native_image_rule_context = "prepare_native_image_rule_context",
)
Expand Down
2 changes: 1 addition & 1 deletion internal/native_image/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ load(
_BAZEL_CPP_TOOLCHAIN_TYPE = "BAZEL_CPP_TOOLCHAIN_TYPE",
_BAZEL_CURRENT_CPP_TOOLCHAIN = "BAZEL_CURRENT_CPP_TOOLCHAIN",
_DEBUG_CONDITION = "DEBUG_CONDITION",
_OPTIMIZATION_MODE_CONDITION = "OPTIMIZATION_MODE_CONDITION",
_DEFAULT_GVM_REPO = "DEFAULT_GVM_REPO",
_GVM_TOOLCHAIN_TYPE = "GVM_TOOLCHAIN_TYPE",
_NATIVE_IMAGE_ATTRS = "NATIVE_IMAGE_ATTRS",
_OPTIMIZATION_MODE_CONDITION = "OPTIMIZATION_MODE_CONDITION",
_RULES_REPO = "RULES_REPO",
_prepare_native_image_rule_context = "prepare_native_image_rule_context",
)
Expand Down
8 changes: 4 additions & 4 deletions internal/native_image/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ load(
"@bazel_skylib//lib:paths.bzl",
"paths",
)
load(
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
"find_cpp_toolchain",
)
load(
"@bazel_tools//tools/build_defs/cc:action_names.bzl",
"CPP_LINK_DYNAMIC_LIBRARY_ACTION_NAME",
"CPP_LINK_EXECUTABLE_ACTION_NAME",
"CPP_LINK_STATIC_LIBRARY_ACTION_NAME",
"C_COMPILE_ACTION_NAME",
)
load(
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
"find_cpp_toolchain",
)

def resolve_cc_toolchain(ctx, transitive_inputs, *, is_windows):
"""Build a context struct for accessing the native C toolchain.
Expand Down
Loading

0 comments on commit 77c9c05

Please sign in to comment.