Skip to content

Commit

Permalink
Use the same .bazelrc as lucidsoftware/rules_scala
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaden Peterson committed Jan 23, 2025
1 parent b80e65a commit 3323e25
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
31 changes: 28 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
# Java options
build --java_language_version="21"
build --java_runtime_version="remotejdk_21"
build --javacopt="-source 21 -target 21"
build --tool_java_language_version="21"
build --tool_java_runtime_version="remotejdk_21"

# Other options
build --experimental_use_hermetic_linux_sandbox
build --experimental_worker_cancellation
build --incompatible_strict_action_env
build --experimental_worker_multiplex_sandboxing
build --strategy=worker,sandboxed,local
build --verbose_failures
build --worker_max_instances=4
build --worker_sandboxing

# Disable multiplex sandboxing because there is a bug that causes files which
# should be in the sandbox to not be. Not sure if this is a Bazel bug or a rule
# set bug. Something we need to deal with either way.
#build --experimental_worker_multiplex_sandboxing

common --announce_rc
common --color=yes
common --disk_cache=.bazel_cache
common --@rules_scala_annex//rules/scala:scala-toolchain=zinc_3

# These are backwards incompatible options; we should check to see if their values have been flipped
# when upgrading to new major Bazel version.
common --incompatible_auto_exec_groups
common --incompatible_autoload_externally=sh_binary # sh_binary is used by rules_jvm_external
common --incompatible_config_setting_private_default_visibility
common --incompatible_disable_native_repo_rules
common --incompatible_disable_starlark_host_transitions
common --incompatible_disable_target_provider_fields
common --incompatible_strict_action_env

# Unfortunately, this can't be enabled just yet because of
# https://github.com/bazelbuild/rules_java/issues/264
#common --incompatible_stop_exporting_language_modules

# This is disabled because rules_python (and possibly other rulesets we depend on) rely on
# deprecated `Label` APIs:
# https://github.com/bazelbuild/rules_python/blob/main/python/private/pythons_hub.bzl#L82
#common --noincompatible_enable_deprecated_label_apis

test --test_output=all

# CI Options
build:ci --sandbox_debug
build:ci --spawn_strategy=standalone
build:ci --genrule_strategy=standalone

common:ci --color=yes

test:ci --local_cpu_resources=HOST_CPUS*.5
test:ci --local_ram_resources=2048
test:ci --test_output=errors
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.bazel_cache/
/bazel-*
/external-tools/
/lemur_rsa
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ archive_override(

bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = True)

register_toolchains(
"//:repository_default_toolchain_21_definition",
Expand Down
6 changes: 5 additions & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions play-routes/play-routes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@ def _impl(ctx):
args.use_param_file("@%s", use_always = True)

ctx.actions.run(
inputs = ctx.files.srcs,
outputs = [output_dir, ctx.outputs.srcjar],
arguments = [args],
mnemonic = "PlayRoutesCompile",
executable = ctx.toolchains["//play-routes-toolchain:toolchain_type"].play_routes_compiler.files_to_run,
execution_requirements = {
"supports-workers": "1",
"supports-multiplex-workers": "1",
"supports-multiplex-sandboxing": "1",
"supports-worker-cancellation": "1",
"supports-path-mapping": "1",
},
inputs = ctx.files.srcs,
mnemonic = "PlayRoutesCompile",
outputs = [output_dir, ctx.outputs.srcjar],
progress_message = "Compiling play routes %{label}",
use_default_shell_env = True,
executable = ctx.toolchains["//play-routes-toolchain:toolchain_type"].play_routes_compiler.files_to_run,
toolchain = "//play-routes-toolchain:toolchain_type",
)

return [
Expand Down

0 comments on commit 3323e25

Please sign in to comment.