-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve failed exports logic #789
Improve failed exports logic #789
Conversation
If something is misconfigured in your setup, these commands can fail. Example: ``` xcodebuild: error: SDK "iphonesimulator14.4" cannot be located. xcodebuild: error: SDK "iphonesimulator14.4" cannot be located. xcrun: error: unable to lookup item 'Path' in SDK 'iphonesimulator14.4 ``` In this case, because the execution of the command, and the `export`, were in the statement, bash ignores the exit code. This breaks that up. We could also break this up with: ``` foo=$(...) export foo ``` But that doesn't work in the postprocessing currently done with exports.
Nice! Is there some kind of regression test we can add? Or is this dependent upon a particular host (mis)configuration? |
It's dependent on host misconfiguration realistically |
Theoretically we could spin up a specific test job and pass some invalid value and make sure it fails, but probably too much overhead |
If you could add a comment about why this pattern is important, I'd be happy to get this in 😀 |
Updated with a link to the shellcheck details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you!
thanks! |
This update is required for this commit bazel-contrib/rules_foreign_cc@c41020e in order to support Apple Silicon. Since our last update there have been some breaking API changes. I followed these instructions to migrate: https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.3.0 https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.4.0 This was reverted once because of a regression fixed by bazel-contrib/rules_foreign_cc@da8952e It was reverted again because we saw a failure on envoy-mobile, but that issue turned out to be a configuration issue there, not the fault of this change. bazel-contrib/rules_foreign_cc#789 provides a better error for that case in the future, but isn't required This reverts commit 7760bc0. Signed-off-by: Keith Smiley <[email protected]>
If something is misconfigured in your setup, these commands can fail.
Example:
In this case, because the execution of the command, and the
export
,were in the statement, bash ignores the exit code. This breaks that up.
We could also break this up with:
But that doesn't work in the postprocessing currently done with exports.