rules_xcodeproj icon indicating copy to clipboard operation
rules_xcodeproj copied to clipboard

Bug: Cache splits based on host platform

Open thii opened this issue 3 years ago • 3 comments

Describe the bug

Given the following declaration:

[
    xcodeproj(
        name = "xcodeproj-{0}-{1}".format(build_mode, ios_simulator_cpus),
        build_mode = build_mode,
        ios_simulator_cpus = ios_simulator_cpus,
        ...
    )
    for build_mode in [
        "bazel",
        "xcode",
    ]
    for ios_simulator_cpus in [
        "sim_arm64",
        "x86_64",
    ]
]

Run this on an Intel-based Mac to populate to remote cache.

bazel run //:xcodeproj-bazel-sim_arm64 -- --build_output_groups all_targets

On an Apple silicon Mac, generate an Xcode project with:

bazel run //:xcodeproj-bazel-sim_arm64

Open it, build, and see a lot of cache misses.

(10:50:06) INFO: 2529 processes: 253 remote cache hit, 1132 internal, 1144 local.

Versions

  • Bazel: 6.0.0-pre.20220804.3
  • rules_xcodeproj: https://github.com/buildbuddy-io/rules_xcodeproj/commit/0f0ffa7c3d01c5316b8f7f4108ece051c8426c9b
  • rules_apple: d04edf4136b4818662d7126582ec257aee372339
  • rules_swift: 6153a848f747e90248a8673869c49631f1323ff3

thii avatar Sep 14 '22 01:09 thii

The reason there are missies is because the simulator cpus are different for all of the other platforms. And even though they aren't used, they are part of the transition and affect the Starlark hash.

For now can you set a value for all simulators instead of just iOS?

brentleyjones avatar Sep 14 '22 02:09 brentleyjones

It seems to work if I set a value for all simulators. Thanks.

(12:58:55) INFO: 2529 processes: 1380 remote cache hit, 1132 internal, 17 local.

thii avatar Sep 14 '22 04:09 thii

Awesome! I think --platforms might help us here in the future. I'll look into it more post-1.0.

brentleyjones avatar Sep 14 '22 11:09 brentleyjones