Skip to content
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_disable_legacy_crosstool_fields: Disable legacy crosstool fields #6861

Closed
hlopko opened this issue Dec 7, 2018 · 30 comments
Closed
Assignees
Labels
incompatible-change Incompatible/breaking change P1 I'll work on this now. (Assignee required) team-Rules-CPP Issues for C++ rules type: feature request

Comments

@hlopko
Copy link
Member

hlopko commented Dec 7, 2018

Flag: --incompatible_disable_legacy_crosstool_fields
Available since: 0.22 (January 2019 release)
Will be flipped in: 0.25 (April 2019 release)
Tracking issue: #5883
Rollout doc: https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#

Motivation

CROSSTOOL grew much bigger than it was expected in 2011 when it was first introduced. There are many fields that are no longer used (e.g. mao_plugin_header_directory), or there are fields that are superseded by features (e.g. compiler_flag). There are fields that specify toolchain capabilities (e.g. supports_embedded_runtimes) but cannot participate in the feature configuration (and there are user requests for these). All in all, CROSSTOOL needs a revamp, and this change achieves that.

Caveats

This is a big incompatible change, and #5380 will be comparably big one. We advice users to use the migration tool provided for --incompatible_disable_legacy_crosstool_fields as the final step of their CROSSTOOL generating pipeline, and wait with hand-tweaking for the migration tool that will be provided for #5380. --incompatible_disable_legacy_crosstool_fields will not be flipped before #5380 is fixed.

Migration

Please use the legacy_fields_migrator tool provided at rules_cc repository. To verify the correctness of your build, use the command line diffing tool provided at tools/aquery_differ (bazel aquery, that the differ uses, is being improved daily as of January 2019, e.g. 1, so if you don't use bazel > 0.23, we advice to build your own bazel from HEAD for testing the migrated crosstool). As mentioned above, we advice not to hand-tune the CROSSTOOL without also migrating for #5380 (automated migrator to starlark will be provided).

Detailed change description

These features were previously enabled by Bazel, but they will no longer be, so they need to be enabled in the crosstool:

  • dependency_file
  • random_seed
  • module_maps
  • module_map_home_cwd
  • header_module_compile
  • include_paths,
  • pic
  • preprocessor_defines

This list contains all the legacy fields and how they will be migrated:

  • static_runtimes_filegroup will not be used once incompatible_disable_runtimes_filegroups: Remove cc_toolchain.static_runtime_libs and cc_toolchain.dynamic_runtime_libs #6942 is flipped. Use cc_toolchain.static_runtime_lib instead.
  • dynamic_runtimes_filegroup will not be used once incompatible_disable_runtimes_filegroups: Remove cc_toolchain.static_runtime_libs and cc_toolchain.dynamic_runtime_libs #6942 is flipped. Use cc_toolchain.dynamic_runtime_lib instead.
  • compiler_flag is replaced by features. Flags from compiler_flag should appear before any other legacy field, and should be passed to all compilation actions.
  • optional_compiler_flag is not used.
  • cxx_flag is replaced by features. Flags from cxx_flag should appear after compiler_flags, and should be passed to all compilation actions except c-compile.
  • optional_cxx_flag is not used.
  • unfiltered_cxx_flag is replaced by features. Flags from feature named unfiltered_compile_flags are not subject to nocopts filtering.
  • optional_unfiltered_cxx_flag is not used.
  • linker_flag is replaced by features. Flags from linker_flag should appear before any other legacy field, and should be passed to all linking actions (except the misnamed archiving action c++-link-static-library)
  • optional_linker_flag is not used.
  • dynamic_library_linker_flag is replaced by features. Flags from dynamic_library_linker_flag should appear after linker_flag fields from linking_mode_flags, and should be only present when linking dynamic libraries.
  • optional_dynamic_library_linker_flag is not used.
  • test_only_linker_flag is replaced by features. test_only_linker_flag should appear after dynamic_library_linker_flag, and only for tests.
  • objcopy_embed_flag is replaced by features.
  • ld_embed_flag is replaced by features.
  • ar_flag is not used.
  • ar_thin_archives_flag is not used.
  • gcc_plugin_compiler_flag is not used.
  • compilation_mode_flags are replaced by features. Features named opt, dbg, and fastbuild are automatically enabled for given compilation mode. Flags from inner compiler_flag should appear after top-level cxx_flags. Flags from inner cxx_flag should appear after inner compiler_flag. Flags from linker_flag should appear after top-level linker_flag fields, before flags from linking_mode_flags.
  • lipo_mode_flags is not used.
  • linking_mode_flags are replaced by features. Mode COVERAGE is not used. Mode FULLY_STATIC has been replaced by fully_static_link feature and therefore unused. Mode MOSTLY_STATIC is replaced by static_linking_mode feature and mode DYNAMIC is replaced by dynamic_linking_mode feature. Both are enabled by rules explicitly.
  • gcc_plugin_header_directory is not used.
  • mao_plugin_header_directory is not used.
  • default_python_top is not used.
  • default_python_version is not used.
  • python_preload_swigdeps is not used.
  • supports_gold_linker is only used for --symbol_counts and will be removed.
  • supports_thin_archives is not used or user.
  • supports_start_end_lib is replaced by feature named supports_start_end_lib that should be enabled by the toolchain or user.
  • supports_interface_shared_objects is replaced by feature named supports_interface_shared_libraries that should be enabled by the toolchain or user.
  • supports_embedded_runtimes is replaced by feature named static_link_cpp_runtimes that should be enabled by the toolchain or user.
  • supports_incremental_linker is not used.
  • supports_normalizing_ar is not used.
  • supports_fission is replaced by feature named per_object_debug_info that should be enabled by the toolchain or user.
  • supports_dsym is not used.
  • needsPic is replaced by feature named supports_pic that should be enabled by the toolchain or user. Before Bazel always requrested pic feature, and verified that pic feature is enabled when needsPic was true or when --force_pic option was passed. With this change, Bazel will only request supports_pic when --force_pic is passed, and it verify that supports_pic is enabled only when --force_pic is passed. When --force_pic is not passed, Bazel will not request supports_pic explicitly, and it will assume that when supports_pic is enabled by the toolchain or user, it means PIC is needed for shared libraries. pic and force_pic build variables are still passed in their corresponding configurations.

A really good place to see exactly what is migrated and how is to see the tests for legacy_fields_migrator.

Changelog

  • January 3rd: Implemented cmd_line_differ
  • January 7th: Bazel 0.22, which contains this flag, was cut
  • January 7th: Fixed broken interface library input detection (a4529db), this is unlikely to affect Bazel users.
  • January 7th: Discovered the issue where $EXEC_ORIGIN is not used when static_link_cpp_runtimes is disabled, this is unlikely to affect Bazel users. If it does affect you, the fix was to add runtime_library_search_directories to the crosstool and not relying on Bazel to patch it in.
  • January 11th: Open-sourced legacy_fields_migrator
  • January 15th: Bazel fix to move default_compile_flags feature to the top of the crosstool, to stay backwards compatible. This fix does affect every user that doesn't specify no_legacy_features feature. Migrator fixed accordingly.
  • January 17th: Migrator fix for nodeps_dynamic_library.
  • February 5th: Migrator fix to replace repeated expand_if_(all|none)_available with nesting (preparation for Crosstool in Starlark migration).
  • February 8th: Replaced cmd_line_differ with aquery_differ, which is a more general aquery output diffing tool. (3575797)
  • February 13th: Updated the migrator to auto-enable some features that were previously enabled by Bazel
@hlopko hlopko added type: feature request P1 I'll work on this now. (Assignee required) team-Rules-CPP Issues for C++ rules incompatible-change Incompatible/breaking change labels Dec 7, 2018
@hlopko hlopko self-assigned this Dec 7, 2018
@hlopko
Copy link
Member Author

hlopko commented Dec 7, 2018

bazel-io pushed a commit that referenced this issue Dec 20, 2018
This cl allows toolchain owners to express that toolchain supports --start-lib/--end-lib using enabled feature "supports_start_end_lib".

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 226292303
bazel-io pushed a commit that referenced this issue Dec 20, 2018
… feature

This cl allows toolchain owners to express that toolchain supports creating interface shared libraries.

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 226302378
bazel-io pushed a commit that referenced this issue Dec 22, 2018
This cl allows toolchain owners to express that toolchain supports creating dynamic libraries.

This is in theory a breaking change, for the crosstools that don't use `dynamic_library_linker_flag`, and don't specify `linking_mode_flags { mode: DYNAMIC }`, and they do specify feature { name: 'dynamic_linking_mode' }. This currently means the toolchain will generate shared libraries, but with this change it will not.

But since this only happens to toolchains that don't use legacy fields, and I don't think there are such toolchains in the wild, I'll go ahead and do this change without following the incompatible change process.

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 226631573
bazel-io pushed a commit that referenced this issue Dec 26, 2018
`supports_fission` can now be expressed using 'per_object_debug_info' feature (should be enabled for it to take effect).

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 226950450
bazel-io pushed a commit that referenced this issue Dec 27, 2018
…eature

`supports_embedded_runtimes` can now be expressed using 'static_link_cpp_runtimes' feature (should be enabled for it to take effect).

This cl allows toolchain owners to express that toolchain supports embedded runtimes in the same way as other crosstool capabilities are expressed.

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 227024509
bazel-io pushed a commit that referenced this issue Dec 28, 2018
Incompatible flag issue: #6861
Tracking issue: #5883

RELNOTES: Added --incompatible_disable_legacy_crosstool_fields. See the
migration notes at #6861.
PiperOrigin-RevId: 227104932
bazel-io pushed a commit that referenced this issue Dec 28, 2018
This change removes some hardcoded feature names when #6861 is flipped.

RELNOTES: None.
PiperOrigin-RevId: 227110386
bazel-io pushed a commit that referenced this issue Dec 28, 2018
`needsPic` can now be expressed using 'pic' feature (should be enabled for it to take effect).

This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 227134726
bazel-io pushed a commit that referenced this issue Jan 2, 2019
This cl is a step towards #5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is #6861

RELNOTES: None.
PiperOrigin-RevId: 227491541
@meteorcloudy meteorcloudy changed the title --incompatible_disable_legacy_crosstool_fields: Disable legacy crosstool fields Jan 3, 2019
bazel-io pushed a commit that referenced this issue Jan 7, 2019
Progress towards:
#6861
#5883

RELNOTES: None.
PiperOrigin-RevId: 228175730
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
Needed for --incompatible_disable_legacy_crosstool_fields migration: bazelbuild/bazel#6861
Tracking issue: bazelbuild/bazel#5883

RELNOTES: None.
PiperOrigin-RevId: 225956311
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
`supports_fission` can now be expressed using 'per_object_debug_info' feature (should be enabled for it to take effect).

This cl is a step towards bazelbuild/bazel#5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is bazelbuild/bazel#6861

RELNOTES: None.
PiperOrigin-RevId: 226950450
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
…eature

`supports_embedded_runtimes` can now be expressed using 'static_link_cpp_runtimes' feature (should be enabled for it to take effect).

This cl allows toolchain owners to express that toolchain supports embedded runtimes in the same way as other crosstool capabilities are expressed.

This cl is a step towards bazelbuild/bazel#5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is bazelbuild/bazel#6861

RELNOTES: None.
PiperOrigin-RevId: 227024509
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
`needsPic` can now be expressed using 'pic' feature (should be enabled for it to take effect).

This cl is a step towards bazelbuild/bazel#5883. Also
see the rollout doc here:
https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

Flag removing legacy behavior is bazelbuild/bazel#6861

RELNOTES: None.
PiperOrigin-RevId: 227134726
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
This cl fixes:

* clears 'supports_embedded_runtimes'
* adds user_compile_flags and sysroot feature
  * these are needed to appear before unfiltered_compile_flags

Progress towards:
bazelbuild/bazel#6861
bazelbuild/bazel#5883

RELNOTES: None.
PiperOrigin-RevId: 228299172
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 11, 2019
bazel-io pushed a commit that referenced this issue Jan 14, 2019
…edRuntimes is not set

Before, Bazel explicitly added static_link_cpp_runtimes to disabled features, when toolchain didn't set supportsEmbeddedRuntimes. This is unnecessary (if the toolchain doesn't support embeddded runtimes, it can just not create/enable the feature), and it makes migration for #5883 harder. Let's remove it.

#5883
#6861

RELNOTES: None.
PiperOrigin-RevId: 229188252
bazel-io pushed a commit that referenced this issue Jan 15, 2019
Currently we move legacy_compile_flags to the top of the crosstool, and the same behavior is needed for migrated crosstools in case of default_compile_flags.

#6861
#5883

RELNOTES: None.
PiperOrigin-RevId: 229339668
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Jan 15, 2019
Another round of fixes:

* if the toolchain contains legacy_compile_flags or legacy_link_flags, replace the feature with default_compile_flags or default_link_flags. This is to ensure the location of the flags stays intact.
* it fixes the order of compilation flags, the correct order is:
  1) compiler_flag
  2) compilation_mode_flags.compiler_flag
  3) cxx_flag
  4) compilation_mode_flags.cxx_flag
* We don't add cxx_flags to assemble and preprocess-assemble actions
* We don't add sysroot to assemble action

bazelbuild/bazel#6861
bazelbuild/bazel#5883

RELNOTES: None.
PiperOrigin-RevId: 229336027
hlopko added a commit that referenced this issue Mar 12, 2019
…e_disable_expand_if_all_available_in_flag_set

Fixes #7008
Fixes #6861

RELNOTES: `--incompatible_disable_legacy_crosstool_fields` has been flipped (#6861)
`--incompatible_disable_expand_if_all_available_in_flag_set` has been flipped (#7008)
PiperOrigin-RevId: 234759266
Change-Id: I54a1213991b161ccddfebdcd3ba83239adf0c66d
bazel-io pushed a commit that referenced this issue Mar 12, 2019
…le_legacy_crosstool_fields flip

#7008
#6861

RELNOTES:
PiperOrigin-RevId: 237987653
@hlopko
Copy link
Member Author

hlopko commented Mar 13, 2019

This broke bazel's ndk crosstools, reopening.

@hlopko hlopko reopened this Mar 13, 2019
@hlopko hlopko reopened this Mar 13, 2019
bazel-io pushed a commit to bazelbuild/rules_cc that referenced this issue Mar 18, 2019
…nsitive dynamic libraries on dynamic_linking_mode feature

bazelbuild/bazel#6861

RELNOTES: None.
PiperOrigin-RevId: 238941083
bazel-io pushed a commit that referenced this issue Mar 21, 2019
Before this cl, AndroidNdkRepositoryFunction generated CROSSTOOL file that configured the C++ toolchain for ndk. This cl changes this function to generate a Starlark rule providing CcToolchainConfigInfo, which is the "new" way of configuring C++ toolchains. This change should not be observable by ndk users.

As a result, generated ndk toolchain is forward compatible with incompatible changes:
* #7008
* #6861
* #7320
* #7075

RELNOTES: Android NDK C++ toolchain is now configured in Starlark. This should be a backwards compatible change, but in case of bugs blame unknown commit.
PiperOrigin-RevId: 239565213
bazel-io pushed a commit that referenced this issue May 1, 2019
Baseline: 0366246

Cherry picks:

   + 3f7f255:
     Windows: fix native test wrapper's arg. escaping
   + afeb8d0:
     Flip --incompatible_windows_escape_jvm_flags
   + 4299b65:
     Sort DirectoryNode children to ensure validity.
   + 231270c:
     Conditionally use deprecated signature for initWithContentsOfURL
   + 75a3a53:
     Add http_archive entries for testing with various JDK versions.
   + 4a6354a:
     Now that ubuntu1804 uses JDK 11, remove explicit
     ubuntu1804_java11 tests.
   + ae102fb:
     Fix wrong name of ubuntu1804_javabase9 task.
   + 0020a97:
     Remove @executable_path/Frameworks from rpaths
   + 130f86d:
     Download stderr/stdout to a temporary FileOutErr

Incompatible changes:

  - (Starlark rules) The legacy "py" provider can no longer be passed
    to or produced by native Python rules; use
    [PyInfo](https://docs.bazel.build/versions/master/skylark/lib/PyIn
    fo.html) instead. See
    [#7298](#7298) for more
    information.
  - (Python rules) The `default_python_version` attribute of the
    `py_binary` and `py_test` rules has been renamed to
    `python_version`. Also, the `--force_python` flag has been
    renamed to `--python_version`. See
    [#7308](#7308) for more
    information.
  - (Python rules) The python version now changes to whatever version
    is specified in a `py_binary` or `py_test`'s `python_version`
    attribute, instead of being forced to the value set by a command
    line flag. You can temporarily revert this change with
    `--incompatible_allow_python_version_transitions=false`. See
    [#7307](#7307) for more
    information.
  - --incompatible_disable_third_party_license_checking` is enabled
    by default
  - Introduced --incompatible_use_python_toolchains, which supersedes
    --python_top/--python_path. See #7899 and #7375 for more
    information.
  - Python 3 is now the default Python version (for `py_binary` and
    `py_test` targets that don't specify the `python_version`
    attribute). Targets that are built for Python 3 will no longer
    have their output put in a separate `-py3` directory; instead
    there is now a separate `-py2` directory for Python 2 targets.
    See #7359 and #7593 for more information.
  - objc_library resource attributes are now disabled by default.
    Please migrate them to data instead. See
    #7594 for more info.
  - Flip --incompatible_windows_escape_jvm_flags to true. See
    #7486

New features:

  - genrules now support a $(RULEDIR) variable that resolves to the
    directory where the outputs of the rule are put.
  - Added --incompatible_windows_native_test_wrapper flag: enables
    using the Bash-less test wrapper on Windows. (No-op on other
    platforms.)

Important changes:

  - incompatible_use_jdk11_as_host_javabase: makes JDK 11 the default
    --host_javabase for remote jdk
    (#7219)
  - Makes genquery somepath output deterministic.
  - Tristate attributes of native rules now reject True/False (use
    1/0)
  - Rollback of "Tristate attributes of native rules now reject
    True/False (use 1/0)"
  - Tristate attributes of native rules now reject True/False (use
    1/0)
  - Added -incompatible_do_not_split_linking_cmdline flag. See #7670
  - Tristate attributes of native rules now temporarily accept
    True/False again
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has
    been flipped (#7008)
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set...
    RELNOTES: None.
  - --incompatible_no_transitive_loads is enabled by default.
  - Makes TreeArtifact deterministic.
  - --incompatible_no_transitive_loads is enabled by default.
  - Android NDK C++ toolchain is now configured in Starlark. This
    should be a backwards compatible change, but in case of bugs
    blame unknown commit.
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has
    been flipped (#7008)
  - --incompatible_no_transitive_loads is enabled by default.
  - --incompatible_bzl_disallow_load_after_statement is enabled
  - Added `--incompatible_require_ctx_in_configure_features`, see
    #7793 for details.
  - Flag --incompatible_merge_genfiles_directory is flipped. This
    removes the directory `bazel-genfiles` in favor of `bazel-bin`.
  - previously deprecated flag --experimental_remote_spawn_cache was
    removed
  - `--incompatible_disallow_load_labels_to_cross_package_boundaries`
    is enabled by default
  - Fix an issue where the Android resource processor did not surface
    errors from aapt2 compile and link actions.
  - --incompatible_no_attr_license is enabled by default
  - `--incompatible_disable_crosstool_file` has been flipped
    (#7320)
  - A new flag `--incompatible_string_join_requires_strings` is
    introduced. The sequence argument of `string.join` must contain
    only string elements.
  - --incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfile
    s_tree has been flipped
  - Incompatible flag `--incompatible_disable_legacy_cc_provider` has
    been flipped (see #7036
    for details).
  - Don't drop the analysis cache when the same --define flag is set
    multiple times and the last value is the same (e.g. if the
    current invocation was run with "--define foo=bar" and the
    previous one was run with "--define foo=baz --define foo=bar").
  - The --incompatible_disable_genrule_cc_toolchain_dependency flag
    has been flipped (see
    #6867 for details).
  - Incompatible change
    `--incompatible_remove_cpu_and_compiler_attributes_from_cc_toolcha
    in` has been flipped (see
    #7075 for details).
  - --noexperimental_java_coverage is a no-op flag.
  - --experimental_java_coverage/--incompatible_java_coverage flag was
    removed. See #7425.
  - incompatible_use_toolchain_providers_in_java_common: pass
    JavaToolchainInfo and JavaRuntimeInfo providers to java_common
    APIs instead of configured targets
    (#7186.)
  - --incompatible_remote_symlinks has been flipped. The remote
    caching and execution protocol will now represent symlinks in
    outputs as such. See
    #7917 for more details.
  - Bazel is now ~20MiB smaller, from unbundling the Android rules'
    runtime dependencies.

This release contains contributions from many people at Google, as well as Andreas Herrmann, Andrew Suffield, Andy Scott, Benjamin Peterson, Ed Baunton, George Gensure, Ian McGinnis, Ity Kaul, Jingwen Chen, John Millikin, Keith Smiley, Marwan Tammam, Mike Fourie, Oscar Bonilla, perwestling, petros, Robert Sayre, Ryan Beasley, silvergasp, Stanimir Mladenov, Travis Cline, Vladimir Chebotarev, ??.
dkelmer pushed a commit that referenced this issue May 6, 2019
Baseline: 0366246

Cherry picks:

   + 3f7f255:
     Windows: fix native test wrapper's arg. escaping
   + afeb8d0:
     Flip --incompatible_windows_escape_jvm_flags
   + 4299b65:
     Sort DirectoryNode children to ensure validity.
   + 231270c:
     Conditionally use deprecated signature for initWithContentsOfURL
   + 75a3a53:
     Add http_archive entries for testing with various JDK versions.
   + 4a6354a:
     Now that ubuntu1804 uses JDK 11, remove explicit
     ubuntu1804_java11 tests.
   + ae102fb:
     Fix wrong name of ubuntu1804_javabase9 task.
   + 0020a97:
     Remove @executable_path/Frameworks from rpaths
   + 130f86d:
     Download stderr/stdout to a temporary FileOutErr

Incompatible changes:

  - (Starlark rules) The legacy "py" provider can no longer be passed
    to or produced by native Python rules; use
    [PyInfo](https://docs.bazel.build/versions/master/skylark/lib/PyIn
    fo.html) instead. See
    [#7298](#7298) for more
    information.
  - (Python rules) The `default_python_version` attribute of the
    `py_binary` and `py_test` rules has been renamed to
    `python_version`. Also, the `--force_python` flag has been
    renamed to `--python_version`. See
    [#7308](#7308) for more
    information.
  - (Python rules) The python version now changes to whatever version
    is specified in a `py_binary` or `py_test`'s `python_version`
    attribute, instead of being forced to the value set by a command
    line flag. You can temporarily revert this change with
    `--incompatible_allow_python_version_transitions=false`. See
    [#7307](#7307) for more
    information.
  - --incompatible_disable_third_party_license_checking` is enabled
    by default
  - Introduced --incompatible_use_python_toolchains, which supersedes
    --python_top/--python_path. See #7899 and #7375 for more
    information.
  - Python 3 is now the default Python version (for `py_binary` and
    `py_test` targets that don't specify the `python_version`
    attribute). Targets that are built for Python 3 will no longer
    have their output put in a separate `-py3` directory; instead
    there is now a separate `-py2` directory for Python 2 targets.
    See #7359 and #7593 for more information.
  - objc_library resource attributes are now disabled by default.
    Please migrate them to data instead. See
    #7594 for more info.
  - Flip --incompatible_windows_escape_jvm_flags to true. See
    #7486

New features:

  - genrules now support a $(RULEDIR) variable that resolves to the
    directory where the outputs of the rule are put.
  - Added --incompatible_windows_native_test_wrapper flag: enables
    using the Bash-less test wrapper on Windows. (No-op on other
    platforms.)

Important changes:

  - incompatible_use_jdk11_as_host_javabase: makes JDK 11 the default
    --host_javabase for remote jdk
    (#7219)
  - Makes genquery somepath output deterministic.
  - Tristate attributes of native rules now reject True/False (use
    1/0)
  - Rollback of "Tristate attributes of native rules now reject
    True/False (use 1/0)"
  - Tristate attributes of native rules now reject True/False (use
    1/0)
  - Added -incompatible_do_not_split_linking_cmdline flag. See #7670
  - Tristate attributes of native rules now temporarily accept
    True/False again
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has
    been flipped (#7008)
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set...
    RELNOTES: None.
  - --incompatible_no_transitive_loads is enabled by default.
  - Makes TreeArtifact deterministic.
  - --incompatible_no_transitive_loads is enabled by default.
  - Android NDK C++ toolchain is now configured in Starlark. This
    should be a backwards compatible change, but in case of bugs
    blame unknown commit.
  - `--incompatible_disable_legacy_crosstool_fields` has been flipped
    (#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has
    been flipped (#7008)
  - --incompatible_no_transitive_loads is enabled by default.
  - --incompatible_bzl_disallow_load_after_statement is enabled
  - Added `--incompatible_require_ctx_in_configure_features`, see
    #7793 for details.
  - Flag --incompatible_merge_genfiles_directory is flipped. This
    removes the directory `bazel-genfiles` in favor of `bazel-bin`.
  - previously deprecated flag --experimental_remote_spawn_cache was
    removed
  - `--incompatible_disallow_load_labels_to_cross_package_boundaries`
    is enabled by default
  - Fix an issue where the Android resource processor did not surface
    errors from aapt2 compile and link actions.
  - --incompatible_no_attr_license is enabled by default
  - `--incompatible_disable_crosstool_file` has been flipped
    (#7320)
  - A new flag `--incompatible_string_join_requires_strings` is
    introduced. The sequence argument of `string.join` must contain
    only string elements.
  - --incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfile
    s_tree has been flipped
  - Incompatible flag `--incompatible_disable_legacy_cc_provider` has
    been flipped (see #7036
    for details).
  - Don't drop the analysis cache when the same --define flag is set
    multiple times and the last value is the same (e.g. if the
    current invocation was run with "--define foo=bar" and the
    previous one was run with "--define foo=baz --define foo=bar").
  - The --incompatible_disable_genrule_cc_toolchain_dependency flag
    has been flipped (see
    #6867 for details).
  - Incompatible change
    `--incompatible_remove_cpu_and_compiler_attributes_from_cc_toolcha
    in` has been flipped (see
    #7075 for details).
  - --noexperimental_java_coverage is a no-op flag.
  - --experimental_java_coverage/--incompatible_java_coverage flag was
    removed. See #7425.
  - incompatible_use_toolchain_providers_in_java_common: pass
    JavaToolchainInfo and JavaRuntimeInfo providers to java_common
    APIs instead of configured targets
    (#7186.)
  - --incompatible_remote_symlinks has been flipped. The remote
    caching and execution protocol will now represent symlinks in
    outputs as such. See
    #7917 for more details.
  - Bazel is now ~20MiB smaller, from unbundling the Android rules'
    runtime dependencies.

This release contains contributions from many people at Google, as well as Andreas Herrmann, Andrew Suffield, Andy Scott, Benjamin Peterson, Ed Baunton, George Gensure, Ian McGinnis, Ity Kaul, Jingwen Chen, John Millikin, Keith Smiley, Marwan Tammam, Mike Fourie, Oscar Bonilla, perwestling, petros, Robert Sayre, Ryan Beasley, silvergasp, Stanimir Mladenov, Travis Cline, Vladimir Chebotarev, ??.
justkw pushed a commit to Intel-tensorflow/tensorflow that referenced this issue May 14, 2019
This cl makes this toolchain forward compatible for Bazel's incompatible flags:
* bazelbuild/bazel#7008
* bazelbuild/bazel#6861
* bazelbuild/bazel#7320

The current change creates a drop-in replacement for the proto crosstool, with the exception that:
* all legacy fields are removed
* templated variables are replaced by rule attributes
* instead of empty paths in msvc toolchain we now use 'msvc_not_used' path (CcToolchainConfigInfo doesn't allow empty strings for paths).
* introduced to_list_of_strings function so we can pass list of starlark string around

The mechanical transformation makes the crosstool definition less readable than before - this will be addressed in a subsequent change.

This change was tested by:
1) running cuda_configure.bzl and retrieving generated BUILD and CROSSTOOL files
2) applying this change
3) running cuda_configure.bzl and retrieving generated BUILD and cc_toolchain_config.bzl files
4) Using [cc_toolchain_compare_test](https://github.com/bazelbuild/rules_cc/blob/master/tools/migration/ctoolchain_compare.bzl#L24) rule to verify both CROSSTOOL and cc_toolchain_configs configure the C++ toolchain identically

PiperOrigin-RevId: 248094053
deven-amd pushed a commit to ROCm/tensorflow-upstream that referenced this issue May 15, 2019
This cl makes this toolchain forward compatible for Bazel's incompatible flags:
* bazelbuild/bazel#7008
* bazelbuild/bazel#6861
* bazelbuild/bazel#7320

The current change creates a drop-in replacement for the proto crosstool, with the exception that:
* all legacy fields are removed
* templated variables are replaced by rule attributes
* instead of empty paths in msvc toolchain we now use 'msvc_not_used' path (CcToolchainConfigInfo doesn't allow empty strings for paths).
* introduced to_list_of_strings function so we can pass list of starlark string around

The mechanical transformation makes the crosstool definition less readable than before - this will be addressed in a subsequent change.

This change was tested by:
1) running cuda_configure.bzl and retrieving generated BUILD and CROSSTOOL files
2) applying this change
3) running cuda_configure.bzl and retrieving generated BUILD and cc_toolchain_config.bzl files
4) Using [cc_toolchain_compare_test](https://github.com/bazelbuild/rules_cc/blob/master/tools/migration/ctoolchain_compare.bzl#L24) rule to verify both CROSSTOOL and cc_toolchain_configs configure the C++ toolchain identically

PiperOrigin-RevId: 248094053
lngart pushed a commit to lngart/GitSubSep that referenced this issue Oct 5, 2021
This cl makes this toolchain forward compatible for Bazel's incompatible flags:
* bazelbuild/bazel#7008
* bazelbuild/bazel#6861
* bazelbuild/bazel#7320

The current change creates a drop-in replacement for the proto crosstool, with the exception that:
* all legacy fields are removed
* templated variables are replaced by rule attributes
* instead of empty paths in msvc toolchain we now use 'msvc_not_used' path (CcToolchainConfigInfo doesn't allow empty strings for paths).
* introduced to_list_of_strings function so we can pass list of starlark string around

The mechanical transformation makes the crosstool definition less readable than before - this will be addressed in a subsequent change.

This change was tested by:
1) running cuda_configure.bzl and retrieving generated BUILD and CROSSTOOL files
2) applying this change
3) running cuda_configure.bzl and retrieving generated BUILD and cc_toolchain_config.bzl files
4) Using [cc_toolchain_compare_test](https://github.com/bazelbuild/rules_cc/blob/master/tools/migration/ctoolchain_compare.bzl#L24) rule to verify both CROSSTOOL and cc_toolchain_configs configure the C++ toolchain identically

PiperOrigin-RevId: 248094053
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
…le_disable_expand_if_all_available_in_flag_set

    Fixes #7008
    Fixes #6861

    This is an encore of bazelbuild/bazel@c18be0b.

    TESTED=https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/852#5c90f69e-c5d2-44c1-8067-0bde4cba6f6d (remote execution is fixed after syncing, verified locally)

    RELNOTES: `--incompatible_disable_legacy_crosstool_fields` has been flipped (bazelbuild/bazel#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has been flipped (bazelbuild/bazel#7008)
    PiperOrigin-RevId: 239567807
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    *** Reason for rollback ***

    https://buildkite.com/bazel/bazel-bazel/builds/7163

    *** Original change description ***

    Flip --incompatible_disable_legacy_crosstool_fields and --incompatible_disable_expand_if_all_available_in_flag_set

    Fixes #7008
    Fixes #6861

    TESTED=https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/852#5c90f69e-c5d2-44c1-8067-0bde4cba6f6d (remote execution is fixed after syncing, verified locally)

    RELNOTES: `--incompatible_disable_legacy_crosstool_fields` has been flipped (bazelbuild/bazel#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set...

    ***

    RELNOTES: None.
    PiperOrigin-RevId: 238193947
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
…le_disable_expand_if_all_available_in_flag_set

    Fixes #7008
    Fixes #6861

    TESTED=https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/852#5c90f69e-c5d2-44c1-8067-0bde4cba6f6d (remote execution is fixed after syncing, verified locally)

    RELNOTES: `--incompatible_disable_legacy_crosstool_fields` has been flipped (bazelbuild/bazel#6861)
    `--incompatible_disable_expand_if_all_available_in_flag_set` has been flipped (bazelbuild/bazel#7008)
    PiperOrigin-RevId: 237992006
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    Having a 'per_object_debug_data' feature enabled is giving the same signal as having supports_fission enabled. This is a safe change because all crosstools that have supports_fission: true have per_object_debug_info disabled, and with the legacy crosstool fields migration we will migrate this feature to be enabled by default for these crosstools.

    bazelbuild/bazel#6861
    bazelbuild/bazel#5883

    RELNOTES: None.
    PiperOrigin-RevId: 230701029
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
…dedRuntimes is not set

    Before, Bazel explicitly added static_link_cpp_runtimes to disabled features, when toolchain didn't set supportsEmbeddedRuntimes. This is unnecessary (if the toolchain doesn't support embeddded runtimes, it can just not create/enable the feature), and it makes migration for bazelbuild/bazel#5883 harder. Let's remove it.

    bazelbuild/bazel#5883
    bazelbuild/bazel#6861

    RELNOTES: None.
    PiperOrigin-RevId: 229188252
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    This cl is a step towards bazelbuild/bazel#5883. Also
    see the rollout doc here:
    https://docs.google.com/document/d/1uv4c1zag6KvdI31qdx8C6jiTognXPQrxgsUpVefm9fM/edit#.

    Flag removing legacy behavior is bazelbuild/bazel#6861

    RELNOTES: None.
    PiperOrigin-RevId: 227491541
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    Incompatible flag issue: bazelbuild/bazel#6861
    Tracking issue: bazelbuild/bazel#5883

    RELNOTES: Added --incompatible_disable_legacy_crosstool_fields. See the
    migration notes at bazelbuild/bazel#6861.
    PiperOrigin-RevId: 227104932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible-change Incompatible/breaking change P1 I'll work on this now. (Assignee required) team-Rules-CPP Issues for C++ rules type: feature request
10 participants