Skip to content

Upgrade rules_foreign_cc#2402

Merged
jpsim merged 1 commit intoenvoyproxy:mainfrom
Yannic:rules_foreign_cc_2100
Jul 5, 2022
Merged

Upgrade rules_foreign_cc#2402
jpsim merged 1 commit intoenvoyproxy:mainfrom
Yannic:rules_foreign_cc_2100

Conversation

@Yannic
Copy link
Copy Markdown
Contributor

@Yannic Yannic commented Jul 4, 2022

This upgrades rules_foreign_cc to a version including
bazel-contrib/rules_foreign_cc#938, which fixes
a build failure when the requested Apple SDK from --xcode_version does
not match the system's default Xcode's SDKs.

Example output:

rules_foreign_cc: Build failed!
rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
rules_foreign_cc: Printing build logs:
_____ BEGIN BUILD LOGS _____
xcrun: error: SDK "macosx12.1" cannot be located
xcrun: error: SDK "macosx12.1" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'macosx12.1'
+ XCODE_VERSION_OVERRIDE=13.2.1.13C100
+ APPLE_SDK_VERSION_OVERRIDE=12.1
+ APPLE_SDK_PLATFORM=MacOSX

This fixes a hermeticity problem in the build and is a prerequisite for
upgradting the macOS RE cluster to macOS 12, which in turn is a
requirement for upgrading to Xcode 13.4.

Progress on #2100

This upgrades `rules_foreign_cc` to a version including
bazel-contrib/rules_foreign_cc#938, which fixes
a build failure when the requested Apple SDK from `--xcode_version` does
not match the system's default Xcode's SDKs.

Example output:
```
rules_foreign_cc: Build failed!
rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
rules_foreign_cc: Printing build logs:
_____ BEGIN BUILD LOGS _____
xcrun: error: SDK "macosx12.1" cannot be located
xcrun: error: SDK "macosx12.1" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'macosx12.1'
+ XCODE_VERSION_OVERRIDE=13.2.1.13C100
+ APPLE_SDK_VERSION_OVERRIDE=12.1
+ APPLE_SDK_PLATFORM=MacOSX
```

This fixes a hermeticity problem in the build and is a prerequisite for
upgradting the macOS RE cluster to macOS 12, which in turn is a
requirement for upgrading to Xcode 13.4.

Progress on envoyproxy#2100

Signed-off-by: Yannic Bonenberger <yannic@engflow.com>
@Yannic
Copy link
Copy Markdown
Contributor Author

Yannic commented Jul 4, 2022

cc @lfpino @drwx

Copy link
Copy Markdown
Contributor

@jpsim jpsim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I've actually seen this issue locally when DEVELOPER_DIR was set to a different Xcode than what's defined with xcode_version.

I'll keep an eye on bazel-contrib/rules_foreign_cc#938 and will update to point to the official repo when that's merged.

@jpsim jpsim merged commit a917f83 into envoyproxy:main Jul 5, 2022
@Yannic Yannic deleted the rules_foreign_cc_2100 branch July 5, 2022 15:55
@Augustyniak
Copy link
Copy Markdown
Contributor

This is great - thank you. I've definitely hit this error in the past.

@jpsim
Copy link
Copy Markdown
Contributor

jpsim commented Jul 5, 2022

If the upstream PR can't be merged for any reason, we may need to revert this if it prevents us from staying up to date with the official rules repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants