Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/bazelbuild/bazel.git. Pull mirroring updated .
  1. Mar 27, 2024
    • Lukacs T. Berki's avatar
      d1a798ab
    • Googler's avatar
      Move project resolution from BuildView to BuildTool. · 53857efe
      Googler authored
      Reasons:
      
       - `BuildView` is for analysis. Projects store data that's used for analysis but
         also other purposes.
       - Flag sets use projects to change top-level build options. We want to push
         that as soon as possible after those build options are first created.
       - Skymeld (merged analysis+execution) and normal analysis are the two
         consumers of flag set-based build options. We want this accessible to both.
      
      PiperOrigin-RevId: 619283982
      Change-Id: I916c9c6dba19abed91fdee5ae784bf9a6b7aeaaf
      53857efe
    • Googler's avatar
      Refactor run-for-test into its own method · c64624b2
      Googler authored
      This makes it more clear how the test and non-test run paths do, and do not
      overlap. Prior to this the sharing of variables and large if/else blocks gave
      the impression that there was more sharing than there actually was.
      
      Motivation is I'm trying to simplify --run_under, and this is a standalone
      pre-factor which makes those changes/the possibility of them easier to
      understand.
      
      Includes a drive-by cleanup of unreachable windows-only escaping code in the
      not-windows branch of transformArgvsForExecRequest.
      
      PiperOrigin-RevId: 619271171
      Change-Id: Ia41010d1f03d6cf3bee132c47f70bf58b54dc646
      c64624b2
    • Xdng Yng's avatar
      Split ModuleThreadContext off from ModuleFileGlobals · 9facaaa2
      Xdng Yng authored
      ModuleFileGlobals used to serve as both the definition of Starlark methods available in MODULE.bazel files, *and* the state tracker for a module being built. This commit brings it more in line with other Starlark evaluation contexts where there's a simple object that just holds methods, and the actual state is stored in the StarlarkThread. ModuleThreadContext is that state object.
      
      This commit is a pure mechanical refactor with no behavioral changes. It paves the way for us to allow root module MODULE.bazel files to import other files.
      
      Work towards https://github.com/bazelbuild/bazel/issues/17880.
      
      Closes #21749.
      
      PiperOrigin-RevId: 619261497
      Change-Id: Ibff3a311e1788f7d8089ca194933cfb5fcc53ee0
      9facaaa2
    • Googler's avatar
      In tests, stop loading the Android SDK from the configuration. · 91279ecd
      Googler authored
      PiperOrigin-RevId: 619247016
      Change-Id: If9157d77f36c8af9745250c735ad84b1c1e9a2ea
      91279ecd
    • Niko Wenselowski's avatar
      Update command to build for Android with Bazel 7 · 47fe1fb0
      Niko Wenselowski authored
      Fixes #21810
      
      Closes #21811.
      
      PiperOrigin-RevId: 619241671
      Change-Id: Idebab429fc4a4746ac15865d017602c43c37a1a4
      47fe1fb0
  2. Mar 26, 2024
    • Googler's avatar
      Also add a `bin` variant to the include search path in j2objc_aspect.bzl. · 6789afaf
      Googler authored
      In the long term, all uses of `genfiles` will be replaced with `bin`. This change makes it possible to incrementally migrate rules that currently output to `genfiles` (see[]
      
      PiperOrigin-RevId: 619133859
      Change-Id: I747b6fd7e44c4c261b510cf108cc23803cd1ebf3
      6789afaf
    • Googler's avatar
      Update release notes script · 9a333bc5
      Googler authored
      - Look for the "RELNOTES:" marker for minor releases as well, not just for major releases
      - Clean up issues (e.g. printing Fixes XYZ and Closes XYZ)
      - Sort all release notes by category
      
      PiperOrigin-RevId: 618964109
      Change-Id: I79810e2a8c8a9f2174baccb6c8df240d1b927e5d
      9a333bc5
    • Googler's avatar
      Enable the Dumper test utility to deduplicate by equivalence. · 935bd263
      Googler authored
      Fingerprint based deduplication works by first using the Fingerprinter
      to compute fingerprints for the objects. Then a second traversal can
      use those fingerprints for deduplication. Two passes are needed because
      fingerprints are computed bottom up while deduplication is top-down.
      
      While the Fingerprinter implementation can't detect isomorphic
      transformations, reference-based deduplication for "rotated" graphs
      still works.
      
      Fixes a bit of brittleness in SharedValueDeserializationContextTest.
      
      PiperOrigin-RevId: 618905193
      Change-Id: I9a810221444c428e7b8c761f70027e4c5e27aae7
      935bd263
    • Googler's avatar
      Adds Fingerprinter, to be used by Dumper to deduplicate by equivalence. · a58cdaf6
      Googler authored
      Introduces a Fingerprinter to assist in deduplication. The fingerprinter works
      by performing a depth-first traversal of the object graph and composing
      fingerprints bottom up.
      
      One nuance here is how cycles are fingerprinted. To solve this in general,
      something like canonicalization might work. However, that would be fairly
      computationally expensive and complex. For now, the simpler alternative
      of fingerprinting relative to the first-encountered node of the cycle
      is taken. This means that fingerprint-based deduplication can't detect
      isomorphic transformations.
      
      Fingerprinter is extremely similar to Dumper, structurally, both being
      traversals, but most of the code was too different to merge. The main
      differences are as follows.
      
      * Fingerprinter maintains a stack and needs to propagate information about
        cyclic backreferences via return values.
      * Fingerprinter emits fingerprints when recursing, while Dumper increases the
        indentation level and emits inline.
      * Dumper emits reference IDs, which Fingerprinter must not.
      
      It might be possible to merge them by extracting an abstract traverser
      that keeps information about the stack and cyclic references, but Dumper
      never cares about those things, so it would make Dumper code more awkward,
      especially the crucial methods involved in the core recursion.
      
      Given that this is a test utility, favoring readability and simplicity
      over code deduplication seems reasonable in this case.
      
      PiperOrigin-RevId: 618887080
      Change-Id: I1bd29b478dd409bf9d4cbb3b1dfa6cc468ffccd1
      a58cdaf6
    • Googler's avatar
      Do not generating singletons for stateless lambdas when desugaring for Android · a30c4f4f
      Googler authored
      RELNOTE: Stateless lambdas are no longer desugared as singletons when building for Android, see https://issuetracker.google.com/222081665.
      PiperOrigin-RevId: 618879473
      Change-Id: Ia36137dc28447361dc74837ca90e728b994beaea
      a30c4f4f
    • Googler's avatar
      Bring back `keep-sorted` comments · d6aec9ff
      Googler authored
      PiperOrigin-RevId: 618864814
      Change-Id: I1c6022c79653efa0d0eae51f7ba36a16a5fb3eb6
      d6aec9ff
    • Googler's avatar
      Create output and interface output library only in final linking step · 79f17f3b
      Googler authored
      It was created also for LTO indexing step, but not consumed by anything.
      
      Simplify createSharedNonLtoArtifacts. It is only called with isLtoIndexing == false.
      
      PiperOrigin-RevId: 618862295
      Change-Id: If7df3a687ffe5b7ae4cf558fd081d21c93b84bf6
      79f17f3b
    • Googler's avatar
      Pull out linkstamp map of the common linking action · db7eaae0
      Googler authored
      It's not use in LTO indexing action.
      
      PiperOrigin-RevId: 618861282
      Change-Id: Ia032fff244df19f57d5fc0b56c2fce747a383e3f
      db7eaae0
    • Googler's avatar
      Pull out inputs differences and LTO mapping from common linking action builder · 7e1f2f45
      Googler authored
      PiperOrigin-RevId: 618859920
      Change-Id: I67396959844c7d50a8a7f7eb59b4eab72281c2db
      7e1f2f45
  3. Mar 25, 2024
    • Googler's avatar
      deprecating fat_apk_hwasan [] · da004305
      Googler authored
      BEGIN_PUBLIC
      deprecating fat_apk_hwasan
      END_PUBLIC
      
      PiperOrigin-RevId: 618844470
      Change-Id: I5929ee05959a57b5f07567ea6d84675848bb41b5
      da004305
    • Googler's avatar
      Make isLtoIndexing a parameter · d62c326d
      Googler authored
      Before isLtoIndexing was a state variable, which made code harder to follow.
      This breaks the LTO code into 3 steps:
      - builing LTO artifacts
      - building indexing actions
      - building link action
      
      When no LTO is involved only link action is needed.
      
      This change will be followed by further simplifications.
      
      PiperOrigin-RevId: 618830266
      Change-Id: Idbf68fa38e6e2d877c3267bbeaf26ad69dcc108d
      d62c326d
    • Googler's avatar
      Rename TruthSelfEquals to a more sensible name. · 7f8f7182
      Googler authored
      PiperOrigin-RevId: 618828938
      Change-Id: If7216af3a6cfaad78cf4775fcdb7c01b196f1c89
      7f8f7182
    • Googler's avatar
      Remove uses of `--android_sdk` in tests. · 584840d2
      Googler authored
      PiperOrigin-RevId: 618828569
      Change-Id: I208697978aa0d984df3bfa9258237af451f62277
      584840d2
  4. Mar 23, 2024
    • Googler's avatar
      Experimental auto-project resolution. · 472b96d4
      Googler authored
      Adds three pieces of functionality:
      
      - `Project.java`: home for generic project reading, parsing, resolution logic
      - `BuildView.getProjectFile`: `Project` consumer that sets expectations for reading project metadata for top-level targets
      - `PackageLookupFunction.PROJECT_FILE_NAME`: when looking up packages, also see which packages have project files.
      
      This PR doesn't invoke any of the new functionality. That's coming through followup PRs for skyfocus and flag sets.
      
      PiperOrigin-RevId: 618282242
      Change-Id: Ibb00e5e4dd341895e1e30c43ebc5dbc4fe777a5f
      472b96d4
    • Ted Xie's avatar
      Set public visibility for R8 desugar binary · 32fd6e9c
      Ted Xie authored
      We are migrating Android functionality out of Bazel into rules_android. Currently rules_android depends on
      @bazel_tools//tools/android:desugar_java8 for a sh_binary that calls the R8 desugar binary. Going forward, we'll maintain the sh_binary directly in rules_android, and therefore will require public visibility on [...]/r8:desugar. Eventually the source code for the Bazel R8 desugar wrapper will also move into rules_android.
      
      Part of https://github.com/bazelbuild/rules_android/issues/122.
      
      Closes #21775.
      
      PiperOrigin-RevId: 618272641
      Change-Id: I09d9ca19b742049c2d29a75336d1b0680b0005b1
      32fd6e9c
    • Googler's avatar
      Fix typo in `*_test` `env` attribute doc: empty dict is `{}` not `[]` · 239ce343
      Googler authored
      https://bazel.build/reference/be/common-definitions#test.env
      
      PiperOrigin-RevId: 618270877
      Change-Id: I717ae0fa681834dcff00975732850c10cceaba9f
      239ce343
    • Googler's avatar
      Un-deprecate `getBlazeExecRoot()` and `getBlazeOutputPath()`. · 40f9e906
      Googler authored
      These were marked `@Deprecated` to discourage use in open-source code. However, there are legitimate use cases for calling them internally. Remove the deprecation and instead throw an exception if they are called elsewhere.
      
      PiperOrigin-RevId: 618245494
      Change-Id: I6de9215f662949124deac2a0e5c61b28445dc387
      40f9e906
    • Googler's avatar
      Stop using `--android_cpu` in non-test code. · e1122706
      Googler authored
      PiperOrigin-RevId: 618237063
      Change-Id: Ic34eaff907c17dd3349a44696bf4c72f6b0ebf1c
      e1122706
    • Googler's avatar
      BEGIN_PUBLIC · 4ae5cc5a
      Googler authored
      Remove exemption that allows transitioning on `--incompatible_enable_android_toolchain_resolution`.
      END_PUBLIC
      
      PiperOrigin-RevId: 618199137
      Change-Id: I13eb7f336776cd33a322c5d61d86e7c84bb70048
      4ae5cc5a
  5. Mar 22, 2024