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_validate_top_level_header_inclusions: also validate headers in the top level directory #10047

Closed
hlopko opened this issue Oct 16, 2019 · 1 comment
Labels
incompatible-change Incompatible/breaking change team-Rules-CPP Issues for C++ rules

Comments

@hlopko
Copy link
Member

hlopko commented Oct 16, 2019

Flag: incompatible_validate_top_level_header_inclusions
Available since: 1.2.0
Will be flipped: 2.0
Tracking issue: #9965

Description

5 years ago we refactored some random code and a code that skipped validation of top level header inclusions appeared. Nobody remembers why, so we're deleting that. Since some Bazel users can depend on not validating top level headers, we created this incompatible flag.

Migration

Declare top-level headers as srcs/hdrs/deps of the cc_libraries using them, just like it's done for any other header in any other package.

@jin jin added team-Rules-CPP Issues for C++ rules incompatible-change Incompatible/breaking change labels Oct 16, 2019
bazel-io pushed a commit that referenced this issue Oct 17, 2019
#10047
#9965

With this flag flipped Bazel will also validate header inclusions for top level headers.

RELNOTES: Incompatible flag `--incompatible_validate_top_level_header_inclusions` has been added. See #10047 for details.
PiperOrigin-RevId: 275221690
bazel-io pushed a commit that referenced this issue Nov 20, 2019
Baseline: 11deef7

Cherry picks:

   + c76c3e5:
     Replace macOS CC path with relative path
   + 63332eb:
     Hardcode path to dirname on macOS
   + ceadf0a:
     Add tool executables (from FilesToRunProvider) to action inputs.
   + dbe63b0:
     Fix some of the bazel Windows tools code to work with GCC.

Incompatible changes:

  - Tree artifacts and regular artifact paths can no longer overlap.

New features:

  - Added a special "_validation" output group to enable moving
    "validation actions" off the critical path of builds.

Important changes:

  - The query flag "--host_deps" (commonly used as "--nohost_deps")
    has been renamed to "--tool_deps", and now also removes
    dependencies in any execution configuration from being reported
    in the query output. The previous flag name is deprecated and
    will be removed in a future release.
  - The `cc_common.{compile,link}` APIs can now be used without
    passing the `--experimental_cc_skylark_api_enabled_packages` flag.
  - A list of log paths will be provided in build output.
  - Improve runfiles documentation.
  - Improve documentation on rule outputs.
  - BUILD/.bzl execution errors cause execution to stop, even at
    top-level
  - Multiple Starlark validation errors are reported in a single pass.
  - Introduce --experimental_nested_set_as_skykey_threshold
  - Blaze will prevent idle sleep during test and build actions. Note
    that this does not affect screen savers and will not keep a
    laptop awake if the user forces sleep or closes the lid. This is
    purely to avoid idle sleeping when the user is not interacting
    with the device.
  - Improve testing docs.
  - Incompatible flag
    `--incompatible_validate_top_level_header_inclusions` has been
    added. See #10047 for
    details.
  - Fix an aquery bug with handling malformed queries that crashes
    bazel.
  - List fields on CcLinkingOutputs.
  - [Python] Added flag --incomaptible_default_to_explicit_init_py to
    switch the default value of legacy_create_init to True. With this
    flag enabled, your py_binary and py_test targets will no longer
    behave as if empty __init__.py files were implicitly littered in
    your runfiles tree. See
    [#10076](#10076).
  - Fix documentation on allowed target names.
  - --target_platform_fallback now also applies to exec/host
    configurations
  - android_binary and android_libary can now depend on targets
    providing
    CcInfos.
  - Add support for tracking suspensions (sleeps or SIGSTOP) on macOS.
  - d8 dexers (both standalone and incremental) are now available for
    use.
  - Add Desugar support for FreezePeriod#<init>

This release contains contributions from many people at Google, as well as Alex Kirchhoff, Andrew Suffield, Asaf Flescher, Austin Schuh, Benjamin Peterson, Bor Kae Hwang, Brian Richardson, Christy Norman, Clint Harrison, Dan Halperin, Daniel Martn, Dave Lee, David Neil, David Ostrovsky, George Gensure, Greg Estren, Greg, Ira Shikhman, Jacob Parker, Jakub Bujny, John Millikin, John Millikin, Keith Smiley, Laurent Le Brun, marcohu, Marwan Tammam, Mostyn Bramley-Moore, Peter Mounce, Ruben Das, Stepan Koltsov, Thi Don, Thi, Tomasz Strejczek, Walt Panfil, Yannic Bonenberger, Zackary Lowery.
AlessandroPatti pushed a commit to uber-common/bazel that referenced this issue Nov 22, 2019
Baseline: 11deef7

Cherry picks:

   + c76c3e5:
     Replace macOS CC path with relative path
   + 63332eb:
     Hardcode path to dirname on macOS
   + ceadf0a:
     Add tool executables (from FilesToRunProvider) to action inputs.
   + dbe63b0:
     Fix some of the bazel Windows tools code to work with GCC.

Incompatible changes:

  - Tree artifacts and regular artifact paths can no longer overlap.

New features:

  - Added a special "_validation" output group to enable moving
    "validation actions" off the critical path of builds.

Important changes:

  - The query flag "--host_deps" (commonly used as "--nohost_deps")
    has been renamed to "--tool_deps", and now also removes
    dependencies in any execution configuration from being reported
    in the query output. The previous flag name is deprecated and
    will be removed in a future release.
  - The `cc_common.{compile,link}` APIs can now be used without
    passing the `--experimental_cc_skylark_api_enabled_packages` flag.
  - A list of log paths will be provided in build output.
  - Improve runfiles documentation.
  - Improve documentation on rule outputs.
  - BUILD/.bzl execution errors cause execution to stop, even at
    top-level
  - Multiple Starlark validation errors are reported in a single pass.
  - Introduce --experimental_nested_set_as_skykey_threshold
  - Blaze will prevent idle sleep during test and build actions. Note
    that this does not affect screen savers and will not keep a
    laptop awake if the user forces sleep or closes the lid. This is
    purely to avoid idle sleeping when the user is not interacting
    with the device.
  - Improve testing docs.
  - Incompatible flag
    `--incompatible_validate_top_level_header_inclusions` has been
    added. See bazelbuild#10047 for
    details.
  - Fix an aquery bug with handling malformed queries that crashes
    bazel.
  - List fields on CcLinkingOutputs.
  - [Python] Added flag --incomaptible_default_to_explicit_init_py to
    switch the default value of legacy_create_init to True. With this
    flag enabled, your py_binary and py_test targets will no longer
    behave as if empty __init__.py files were implicitly littered in
    your runfiles tree. See
    [bazelbuild#10076](bazelbuild#10076).
  - Fix documentation on allowed target names.
  - --target_platform_fallback now also applies to exec/host
    configurations
  - android_binary and android_libary can now depend on targets
    providing
    CcInfos.
  - Add support for tracking suspensions (sleeps or SIGSTOP) on macOS.
  - d8 dexers (both standalone and incremental) are now available for
    use.
  - Add Desugar support for FreezePeriod#<init>

This release contains contributions from many people at Google, as well as Alex Kirchhoff, Andrew Suffield, Asaf Flescher, Austin Schuh, Benjamin Peterson, Bor Kae Hwang, Brian Richardson, Christy Norman, Clint Harrison, Dan Halperin, Daniel Martn, Dave Lee, David Neil, David Ostrovsky, George Gensure, Greg Estren, Greg, Ira Shikhman, Jacob Parker, Jakub Bujny, John Millikin, John Millikin, Keith Smiley, Laurent Le Brun, marcohu, Marwan Tammam, Mostyn Bramley-Moore, Peter Mounce, Ruben Das, Stepan Koltsov, Thi Don, Thi, Tomasz Strejczek, Walt Panfil, Yannic Bonenberger, Zackary Lowery.
bazel-io pushed a commit that referenced this issue Mar 3, 2020
…evel_header_inclusions.

Work towards #10047.

RELNOTES: None.
PiperOrigin-RevId: 298577249
@katre
Copy link
Member

katre commented Mar 4, 2020

Closing due to flag flip in 858a4b1

@katre katre closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible-change Incompatible/breaking change team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

No branches or pull requests

7 participants