-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
incompatible_load_java_rules_from_bzl: load the Java rules from @rules_java #8746
Comments
Currently the builds will fail with |
RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue #8746 PiperOrigin-RevId: 255600811
RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue bazelbuild#8746 PiperOrigin-RevId: 255600811
`@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely migrate bazelbuild#8746. Progress on bazelbuild#8746. Closes bazelbuild#8758. PiperOrigin-RevId: 256347290
Repositories referenced by bazel that use the native java rules and have to be migrated & upgraded before migrating bazel itself:
|
Baseline: 2e374a9 Cherry picks: + 6d0b14b: rule_test: apply "tags" to all rules in the macro Incompatible changes: - Add --incompatible_enable_profile_by_default to enable the JSON profile by default. - The --incompatible_windows_style_arg_escaping flag is flipped to "true", and the "false" case unsupported. Bazel no longer accepts this flag. Important changes: - Bazel now supports hiding compiler warnings for targets that you're not explicitly building (see https://docs.bazel.build/versions/master/user-manual.html#flag--au to_output_filter). - Flag `--incompatible_restrict_escape_sequences` is added. See #8380 - The "info" command now supports the "starlark-semantics" argument, which outputs a representation of the effective Starlark semantics option values. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - `@bazel_tools//tools/jdk:toolchain_java10` and `@bazel_tools//tools/jdk:toolchain_java11` are now available to enable java 10, respectively java 11 language level support. - The `command` parameter of the `actions.run_shell()` function will be restricted to only accept strings (and not string sequences). This check is attached to flag `--incompatible_run_shell_command_string`. One may migrate by using the `arguments` parameter of `actions.run()` instead. See #5903 for more info. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 f... - Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. - paths under the execution root starting with "." or "_" will be re-linked across builds - execution_log_json_file now allows actions without outputs. - Labels aapt as deprecated for aapt_version, and heavily endorses aapt2. - Update doc links still pointing to cc_binary.features to point to common features - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. RELNOTES: - --incompatible_disable_nocopts flag has been added. See #8706 for details. - Fixed treatment of <dist:module /> tags in AndroidManifest.xml - Fixed asset precedence for android_binary rules with aapt2. - Bazel now officially supports running on CentOS 7. - The runtime dynamic libraries are no longer in default output group of cc_binary. - set the FDOBuildType as CSFDO for binaries built with --cs_fdo_absolute_path. - Bazel can now be bootstrapped and built on arm64 platforms without requiring any flags or patches. - Fixed treatment of AndroidManifest.xml attributes which contained XML escaping - Retire experimental blaze flag experimental_link_compile_output_separately. The same behavior is available through the feature dynamic_link_test_srcs. - --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue #8746 - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Attribute names are going to be restricted and must be syntactically valid identifiers. #6437 - rule_test: fix Bazel 0.27 regression ("tags" attribute was ingored, #8723 This release contains contributions from many people at Google, as well as Ben Diuguid, Benjamin Peterson, Dave Lee, Loo Rong Jie, Mark Butcher, Marwan Tammam, Pedro Alvarez.
RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue bazelbuild#8746 PiperOrigin-RevId: 255600811
`@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely migrate bazelbuild#8746. Progress on bazelbuild#8746. Closes bazelbuild#8758. PiperOrigin-RevId: 256347290
Baseline: 2e374a9 Cherry picks: + 6d0b14b: rule_test: apply "tags" to all rules in the macro Incompatible changes: - Add --incompatible_enable_profile_by_default to enable the JSON profile by default. - The --incompatible_windows_style_arg_escaping flag is flipped to "true", and the "false" case unsupported. Bazel no longer accepts this flag. Important changes: - Bazel now supports hiding compiler warnings for targets that you're not explicitly building (see https://docs.bazel.build/versions/master/user-manual.html#flag--au to_output_filter). - Flag `--incompatible_restrict_escape_sequences` is added. See bazelbuild#8380 - The "info" command now supports the "starlark-semantics" argument, which outputs a representation of the effective Starlark semantics option values. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - `@bazel_tools//tools/jdk:toolchain_java10` and `@bazel_tools//tools/jdk:toolchain_java11` are now available to enable java 10, respectively java 11 language level support. - The `command` parameter of the `actions.run_shell()` function will be restricted to only accept strings (and not string sequences). This check is attached to flag `--incompatible_run_shell_command_string`. One may migrate by using the `arguments` parameter of `actions.run()` instead. See bazelbuild#5903 for more info. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See bazelbuild#8622 for details. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See bazelbuild#8622 f... - Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. - paths under the execution root starting with "." or "_" will be re-linked across builds - execution_log_json_file now allows actions without outputs. - Labels aapt as deprecated for aapt_version, and heavily endorses aapt2. - Update doc links still pointing to cc_binary.features to point to common features - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See bazelbuild#8622 for details. RELNOTES: - --incompatible_disable_nocopts flag has been added. See bazelbuild#8706 for details. - Fixed treatment of <dist:module /> tags in AndroidManifest.xml - Fixed asset precedence for android_binary rules with aapt2. - Bazel now officially supports running on CentOS 7. - The runtime dynamic libraries are no longer in default output group of cc_binary. - set the FDOBuildType as CSFDO for binaries built with --cs_fdo_absolute_path. - Bazel can now be bootstrapped and built on arm64 platforms without requiring any flags or patches. - Fixed treatment of AndroidManifest.xml attributes which contained XML escaping - Retire experimental blaze flag experimental_link_compile_output_separately. The same behavior is available through the feature dynamic_link_test_srcs. - --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue bazelbuild#8746 - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Attribute names are going to be restricted and must be syntactically valid identifiers. bazelbuild#6437 - rule_test: fix Bazel 0.27 regression ("tags" attribute was ingored, bazelbuild#8723 This release contains contributions from many people at Google, as well as Ben Diuguid, Benjamin Peterson, Dave Lee, Loo Rong Jie, Mark Butcher, Marwan Tammam, Pedro Alvarez.
Baseline: 2e374a9 Cherry picks: + 6d0b14b: rule_test: apply "tags" to all rules in the macro Incompatible changes: - Add --incompatible_enable_profile_by_default to enable the JSON profile by default. - The --incompatible_windows_style_arg_escaping flag is flipped to "true", and the "false" case unsupported. Bazel no longer accepts this flag. Important changes: - Bazel now supports hiding compiler warnings for targets that you're not explicitly building (see https://docs.bazel.build/versions/master/user-manual.html#flag--au to_output_filter). - Flag `--incompatible_restrict_escape_sequences` is added. See #8380 - The "info" command now supports the "starlark-semantics" argument, which outputs a representation of the effective Starlark semantics option values. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - `@bazel_tools//tools/jdk:toolchain_java10` and `@bazel_tools//tools/jdk:toolchain_java11` are now available to enable java 10, respectively java 11 language level support. - The `command` parameter of the `actions.run_shell()` function will be restricted to only accept strings (and not string sequences). This check is attached to flag `--incompatible_run_shell_command_string`. One may migrate by using the `arguments` parameter of `actions.run()` instead. See #5903 for more info. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 f... - Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. - paths under the execution root starting with "." or "_" will be re-linked across builds - execution_log_json_file now allows actions without outputs. - Labels aapt as deprecated for aapt_version, and heavily endorses aapt2. - Update doc links still pointing to cc_binary.features to point to common features - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. RELNOTES: - --incompatible_disable_nocopts flag has been added. See #8706 for details. - Fixed treatment of <dist:module /> tags in AndroidManifest.xml - Fixed asset precedence for android_binary rules with aapt2. - Bazel now officially supports running on CentOS 7. - The runtime dynamic libraries are no longer in default output group of cc_binary. - set the FDOBuildType as CSFDO for binaries built with --cs_fdo_absolute_path. - Bazel can now be bootstrapped and built on arm64 platforms without requiring any flags or patches. - Fixed treatment of AndroidManifest.xml attributes which contained XML escaping - Retire experimental blaze flag experimental_link_compile_output_separately. The same behavior is available through the feature dynamic_link_test_srcs. - --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue #8746 - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Attribute names are going to be restricted and must be syntactically valid identifiers. #6437 - rule_test: fix Bazel 0.27 regression ("tags" attribute was ingored, #8723 This release contains contributions from many people at Google, as well as Ben Diuguid, Benjamin Peterson, Dave Lee, Loo Rong Jie, Mark Butcher, Marwan Tammam, Pedro Alvarez.
@iirina Can we update the description to include the load statement so users will know to include them? load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains() |
Will migration tooling be available to do the migration? (based on buildifier) |
@dslomov Yes I updated the migration notes to include using buildifier. |
We gave up on this :( |
@lberki Can you please elaborate? |
Erm, sorry for the curt answer. We decided not to require everyone to add a We might revisit this decision once they are reasonably stable and once we decide where exactly they need to be |
Flag: --incompatible_load_java_rules_from_bzl
Available since: 0.28
Will be flipped in: 1.0
Tracking issue: #8741
java_library, java_binary, java_test, java_import, java_lite_proto_library, java_proto_library,
java_package_configuration, java_plugin, java_runtime, java_toolchain have to be loaded from @rules_java.
For example if you are using java_library, add the following load statement to your BUILD/bzl file.
load("@rules_java//java:defs.bzl", "java_library")
Migration
Add
rules_java
repositories to your WORKSPACE file and load its dependecies:Fix all your BUILD files that use Java rules to include the load statement. Use buildifier to automatically update all your BUILD files:
The text was updated successfully, but these errors were encountered: