Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Sync with upstream #63

Merged
merged 74 commits into from
Mar 15, 2022
Merged

Sync with upstream #63

merged 74 commits into from
Mar 15, 2022

Conversation

wendyliga
Copy link
Owner

cpsauer and others added 30 commits September 10, 2021 13:17
External BuildLabels were keeping their // halfway through their path, leading to projects xcode would refuse to load.

As an example: @google_toolbox_for_mac//Foundation:BUILD was going to external//Foundation/BUILD, not external/Foundation/BUILD.
This lead the pbjproj to assign the file the path //Foundation/BUILD, which Xcode refuses to load, along with groups named '/' and the omission of other associated source files.
…le Execroot (#255)

* Fix breaking of external workspaces after builds

Previously, paths to files in external workspaces went through execroot.
Execroot is reconfigured on every rebuild to contain only the external
workspaces (and top-level packages) required by that build. Therefore,
executing a build that used a subset of the project's external
workspaces broke the file references and include paths for the other
external workspaces. Bad times.

This commit points to external workspaces through the stable external
subdirectory of output_base instead of the unstable external subdir
of execroot. This requires a new tulsi symlink for output base; Xcode
doesn't properly resolve ../ paths through symlinks for file references.
Plus, we should probably try to move away from linking through a
temporary build sandbox anyway; it'll just keep leading to subtle bugs.

This should close bazelbuild/tulsi#164
This patches bazelbuild/tulsi#227 and
bazelbuild/tulsi#229.

This commit also contains a fix for an (I think unreported) bug I
noticed while editing ProjectPatcher. In trying to fix paths for files
not on disk, it was unintentionally setting their paths to (an
incorrect) path that was group relative, but meant to be project
relative. It also created inconsistent state in the PBGroup hierarchy.
Since this fixes the paths for generated Info.plists in most projects,
it leads to many of the file ref path changes in the tests. The code
now does what the author clearly intended, and I've added some defence
against future issues into PBXObjects.

* Make execroot symlink's names reflect what it is

tulsi-workspace -> tulsi-execution-root
TULSI_BWRS -> TULSI_EXECUTION_ROOT

* Re-add legacy names for execroot build setting and symlink for backwards compatibility

Fixes bazelbuild/tulsi#164.
…i's E2E tests.

PiperOrigin-RevId: 367058875
(cherry picked from commit debe5ac)
…plicit module maps. LLDB will transitively include an option that disables implicit module maps when importing a Swift module that depends on an Objective-C library that was built with explicit modules. Depending on the build graph, this can mean LLDB's clang module importer can fail to find the required module maps and provide no debug info.

PiperOrigin-RevId: 371927956
(cherry picked from commit dbb0fc4)
PiperOrigin-RevId: 372147605
(cherry picked from commit 5ef399c)
PiperOrigin-RevId: 373199701
(cherry picked from commit 9939243)
PiperOrigin-RevId: 374475916
(cherry picked from commit ee965f2)
PiperOrigin-RevId: 374489201
(cherry picked from commit 21cc1c8)
…he of any modules that are found in a metadata file that is intended to be created by a bazel aspect that collects explicit module build outputs. This tool is needed to avoid a crash with LLDB that occurs when the LLDB module cache contains a module that is also generated in a build as an explicit module.

This chnage handles reading metadata files that a bazel aspect will write to come up with a list of names of all explicit modules that will have been created from a build.

PiperOrigin-RevId: 378248354
(cherry picked from commit 078e311)
…he of any modules that are found in a metadata file that is intended to be created by a bazel aspect that collects explicit module build outputs. This tool is needed to avoid a crash with LLDB that occurs when the LLDB module cache contains a module that is also generated in a build as an explicit module.

This change handles reading the contents of the implicit module cache and map the name of each module to the absolute path of that module.

PiperOrigin-RevId: 378402314
(cherry picked from commit a03f6ef)
…he of any modules that are found in a metadata file that is intended to be created by a bazel aspect that collects explicit module build outputs. This tool is needed to avoid a crash with LLDB that occurs when the LLDB module cache contains a module that is also generated in a build as an explicit module.

To summarize how this works:
 - Read the contents of the implicit module cache and map the name of each module to the absolute path of that module.
 - Read metadata files that a bazel aspect will write to come up with a list of names of all explicit modules created from a build.
 - Iterate through the list of explicit module names and delete any module with the same name from the implicit module cache.
 - Compute a hash of the list of explicit module names that were used to prune the implicit module cache.
 - Save that hash to a special sentinel file in the implicit module cache.
 - Compare the hash of subsequent builds to the one in the file to determine if subsequent builds should prune the implicit module cache.

PiperOrigin-RevId: 378666180
(cherry picked from commit 55b6a92)
Disable this as it can annoy users; we're working on new build system support.

PiperOrigin-RevId: 378916679
(cherry picked from commit 3f25dd7)
…ests.

Tulsi doesn't allow list ios_static_framework rules, so the e2e test appears to ignore this target.

PiperOrigin-RevId: 378933587
(cherry picked from commit 31da848)
…f Unstable Execroot (#255)"

This reverts commit c7609aa.
…ule in the build graph to use Swift explicit modules.

  - Updates the Tulsi outputs aspect to output the Swift explicit modules generated from a build.
  - Bundles the module cache pruning tool with the Tulsi app bundle and installs it to the same location as the bazel_cache_reader.
  - Runs the module cache pruning tool after each Tulsi build, providing the output from the aspect, to prevent lldb from loading the outdated implicit module.

PiperOrigin-RevId: 378936605
(cherry picked from commit 98d6f25)
Significant changes:
- Fixed a crash with lldb-rpc-server that can occur after
  migrating a rule to use Swift explicit modules.

PiperOrigin-RevId: 379284179
(cherry picked from commit e4fcc3c)
…eeding to explicitly drop the return value when not using it.

PiperOrigin-RevId: 382075141
(cherry picked from commit 552b356)
This allows us to remove the special internal entitlements rule and convert nearly all of the existing macro-wrapped rules into pure rules, with the exception of some macOS rules which still have some straggling items to migrate.

PiperOrigin-RevId: 382347912
(cherry picked from commit 286d21b)
…isabled by default. bazel_cache_reader has been observed to result in significant hits to symbolication in some cases.

PiperOrigin-RevId: 382537207
(cherry picked from commit 6fe2926)
PiperOrigin-RevId: 382571317
(cherry picked from commit d3e3536)
Significant changes:
- Unsupported tests in test_suites are now skipped instead of
  throwing an error.
- Disable fallback dSYM searching by default. The fallback can be
  reenabled with the "Enable fallback dSYM searches" option.
  Reenabling is only recommended if Spotlight is disabled as it
  can impact time to symbolicate a binary.
- Fixed a crash with lldb-rpc-server that can occur after
  migrating a rule to use Swift explicit modules.

PiperOrigin-RevId: 384527057
(cherry picked from commit 7440ba0)
PiperOrigin-RevId: 386871254
(cherry picked from commit febfc91)
Show the entire diff at once instead of line-by-line

PiperOrigin-RevId: 389889488
(cherry picked from commit d16d184)
```
buildfiles(deps($T1)+deps($T2)+deps($T3)+[...])
```

is equivalent to, but generally much slower than

```
buildfiles(deps($T1+$T2+$T3+[...]))
```

PiperOrigin-RevId: 389912462
(cherry picked from commit a5ef86e)
Also fix an issue with the OSS tests.

PiperOrigin-RevId: 390164332
(cherry picked from commit d1a4d3c)

#  Conflicts:
# 	.bazelci/presubmit.yml
# 	.bazelrc
# 	WORKSPACE
Significant changes:
- Improved performance when querying for BUILD/bzl files

PiperOrigin-RevId: 391546363
(cherry picked from commit 53d31b0)
- Use the newer `--run_validations` flag
- Disable the `dsyms` output group that some folks might manually enable by accident

PiperOrigin-RevId: 393791135
(cherry picked from commit 043040df1bc175b5f71d7af80877af0fa98e28f1)
PiperOrigin-RevId: 396918740
(cherry picked from commit f151befb3900ae1f122fdf5a4dc2b0870dffd95c)
Updated to be in sync with our current Xcode target of Xcode 12.5.1

PiperOrigin-RevId: 399783838
(cherry picked from commit a3dec4cc165ca4044215f523bac06b1bf7623861)
thii and others added 28 commits December 29, 2021 11:42
…s` to make Tulsi works with projects that are still using Bazel 4 (#297)

Note that building Tulsi itself still requires Bazel 5.0+.
…rning that Tulsi needs to be updated when running on macOS Big Sur or newer.

PiperOrigin-RevId: 419846379
(cherry picked from commit 81a5f30fdcb035b3b4e7b53fe27c8d668c5c9f36)
…rationTests

GitHub Actions provides not so high spec macOS instances, which makes
this test easy to reach the previous timeout setting (900s).
Significant changes:
- Fixed issue running UI tests on device with Xcode 13.

PiperOrigin-RevId: 419910944
(cherry picked from commit 8f850c2aca9d369ec50bbdde9efd82a66abde30c)
clarify that the current installation requires cloning the entire project
This validates folks who are building tulsi don't hit surprising errors.
We should bump this over time
… a separate file and add a function that computes the subset of those attributes for a given rule kind.

PiperOrigin-RevId: 420149963
(cherry picked from commit acb9f1c0cef59064a40825161e9621edd825918e)
…ct generation

We'll use + test this ourselves during the E2E generation tests.

PiperOrigin-RevId: 424868778
(cherry picked from commit c305374b0a9be7fcdf3f0f146ef8dc1b12546cc0)
This avoids the needs to use a separate file for the build flags.

Note the number of indexer targets changed since CppLib and ObjCLib
are no longer built for iOS 10.

PiperOrigin-RevId: 425623765
(cherry picked from commit 9652ca7468416573b7b7f2a398e09963f24b0e8a)
Need to bump rules_apple + Bazel requirement since we require a flag new in Bazel 5
for our tests.

PiperOrigin-RevId: 425968191
(cherry picked from commit 81d85ec1ca222bef40601193909e19812020a30c)
Only warnings left now are hashValue, which are a bit more complicated
to fix due to our usage in PBXObjectProtocol.

PiperOrigin-RevId: 426146113
(cherry picked from commit 0ea4f83afa7f378294c642e9c7994d5ce33335e0)
Significant changes:
- Extra build flags can now be specified during project
  generation via `--build-options`, e.g. `--build-options
  "--keep_going --verbose_failures"`
- Fix a warning about root-level library targets that was being
  printed under incorrect conditions.

PiperOrigin-RevId: 427737504
(cherry picked from commit d4d0e2cd7a8f3ecff3a8efda0fb43c4f470564d5)
Since Tulsi appends this flag to the build command,
`--output_groups=tulsi_outputs,default` would override any previously
defined `--output_groups` flag.

From the
[documentation](https://bazel.build/reference/command-line-reference#flag--output_groups):
`--output_groups=+foo,+bar` builds the union of the `default` set,
`foo`, and `bar`, while `--output_groups=foo,bar` overrides the default
set such that only `foo` and `bar` are built.
To work around the drop of `should_lipo` in
`apple_common.link_multi_arch_binary`.
Currently this will only be used if the `UseLegacyBuildSystem` option
is false.

PiperOrigin-RevId: 428076981
(cherry picked from commit 0fb177476c76043167546a9a7b3aae692738e1b0)
@wendyliga wendyliga merged commit 3bdbc5e into main Mar 15, 2022
@wendyliga wendyliga deleted the sync_with_upstream branch March 15, 2022 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants