MobileNativeFoundation / rules_xcodeproj

Bazel rules for generating Xcode projects.
MIT License
502 stars 76 forks source link

Force `USE_BAZEL_VERSION` to working SHA until last_green is fixed #3029

Closed thiagohmcruz closed 1 month ago

thiagohmcruz commented 1 month ago

There are at least two issues causing CI to be 🔴 atm:

  1. See example. Repro:
    cd examples/integration
    bazel clean && USE_BAZEL_VERSION=last_green bazel build //Lib:gen_Lib.swift
  2. See example. Repro:
    # From root
    bazel clean && USE_BAZEL_VERSION=last_green bazel build //test/internal/bazel_labels:normalize_tests_test_2

I confirmed that https://github.com/bazelbuild/bazel/commit/dd2464a5933e0a5a6765024573832717b71989bf is the last commit that does not hit the issues above. Commit https://github.com/bazelbuild/bazel/commit/3fddc7f38ace43981d839ed4558b8a457caf41fb is the first one that repros the above (i.e. you'll also hit the issues above if you replace last_green with this SHA).

So proposing we force CI to run on https://github.com/bazelbuild/bazel/commit/dd2464a5933e0a5a6765024573832717b71989bf for now until the issue is fixed upstream. Thoughts?

brentleyjones commented 1 month ago

@fmeum seems odd that the identified commit would cause these issues on macOS?

fmeum commented 1 month ago

Yes, that's very much unexpected. I did manually revert seven commits though, it's quite possible I messed something up.

I still have the original version of my PR with many individual commits, I will try to bisect this locally.

Cc @oquenchil as this appears to be a Bazel 7.2.0 regression

fmeum commented 1 month ago

I can't reproduce this locally:

ERROR: /Users/fmeum/git/rules_xcodeproj/examples/integration/bazel-output-base/release_archive/external/bazel_tools~xcode_configure_extension~local_config_xcode/BUILD:13:13: in xcode_config rule @@bazel_tools~xcode_configure_extension~local_config_xcode//:host_xcodes: --xcode_version=15C500b specified, but '15C500b' is not an available Xcode version. available versions: [15.4.0.15F31d]. If you believe you have '15C500b' installed, try running "bazel shutdown", and then re-run your command.

I have up-to-date Xcode installed and also ran bazel clean --expunge and bazel shutdown a few times, but am hitting this error persistently.

fmeum commented 1 month ago

I think I found the problem although I'm unable to confirm it, this line is definitely wrong: https://github.com/bazelbuild/bazel/blame/3fddc7f38ace43981d839ed4558b8a457caf41fb/src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java#L375

thiagohmcruz commented 1 month ago

Thx for taking a look @fmeum! I'll address a review comment and land this today in the meantime.