-
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
Increase resiliency of runnable_binary
#1134
Increase resiliency of runnable_binary
#1134
Conversation
runnable_binary
on targets with no shared librariesrunnable_binary
e36b6b2
to
e0f03c9
Compare
@@ -4,9 +4,20 @@ | |||
# Otherwise, first cd to the runfiles dir for the wrapped executable before searching for shared libraries for the wrapped executable | |||
if [[ -z $RUN_UNDER_RUNFILES ]]; then | |||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | |||
RUNFILES_DIR=${SCRIPT_DIR}/SH_BINARY_FILENAME.runfiles | |||
RUNFILES_DIR_TMP=${SCRIPT_DIR}/SH_BINARY_FILENAME.runfiles |
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.
Under what conditions do the runfiles not exist? I have to admit I'm not familiar enough with the details of runfile layout to know if this is correct or not.
@fmeum is this logic correct or are we missing something else runfiles related here?
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.
I think that this logic isn't sound, but it also wasn't sound before the PR (not entirely sure though, this is genuinely tricky). RUNFILES_DIR
must always take precedence if already set, but this logic appears to overwrite it based on whether the current script has a runfiles directory, which can result in non-hermetic behavior.
Since the script uses the runfiles library below, could that setup code be moved up? That would provide the correct variables and this script wouldn't have to worry about the details. I also don't see a need to have a special case for --run_under
.
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.
Thank you for taking a look, I've just removed the special case related to --run_under
. Since we don't use --run_under
, I'm not sure if that preserves other users workflows (but it looks like they should continue working)
Under what conditions do the runfiles not exist?
I've found that using the previous logic would fail if the runnable binary was a data input to another binary. The rules_foreign_cc binary would be present in the runfiles directory, and wouldn't have a runfiles directory itself (since all the runfiles were aggregated in a top level directory)
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.
That makes sense. If a binary is a data dependency of some other binary, the outer binary has to use the runfiles libraries to set RUNFILES_DIR
, which the inner binary can then read and use.
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.
That makes sense. If a binary is a data dependency of some other binary, the outer binary has to use the runfiles libraries to set RUNFILES_DIR
, which the inner binary can then read and use.
8aa5110
to
9ec9c91
Compare
@jsharpe @fmeum what do you all think about the new revision? A test is failing on windows because of a bad SSL certificate, but I think that's just because I busted the cache:
(although I'm able to successfully download the patch locally, so I'm not too sure what's up there) |
The second check can never be false if the first one is true
Mac uses a pretty old bash. So we: 1) don't use newer bash commands like -v 2) unconditionally declare all arrays 3) just check if they're empty instead
This commit removes the special case for `--run_under` which tried to find a runfile directory beside the currently executing script. This isn't needed because the runfiles bash script should set RUNFILES_DIR to the right thing anyway
9ec9c91
to
dc6d1eb
Compare
CI failure seems to be a windows infrastructure issue with SSL certs so unrelated to this change. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | rules_foreign_cc | bazel_dep | minor | `0.10.1` -> `0.11.1` | | [rules_foreign_cc](https://github.com/bazelbuild/rules_foreign_cc) | http_archive | patch | `0.11.0` -> `0.11.1` | --- ### Release Notes <details> <summary>bazelbuild/rules_foreign_cc (rules_foreign_cc)</summary> ### [`v0.11.1`](https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.11.1) [Compare Source](https://github.com/bazelbuild/rules_foreign_cc/compare/0.11.0...0.11.1) #### Using Bzlmod with Bazel 6 1. Enable with `common --enable_bzlmod` in `.bazelrc`. 2. Add to your `MODULE.bazel` file: ```starlark bazel_dep(name = "rules_foreign_cc", version = "0.11.1") ``` #### Using WORKSPACE Paste this snippet into your file: ```starlark load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_foreign_cc", sha256 = "4b33d62cf109bcccf286b30ed7121129cc34cf4f4ed9d8a11f38d9108f40ba74", strip_prefix = "rules_foreign_cc-0.11.1", url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.11.1/rules_foreign_cc-0.11.1.tar.gz", ) load("@​rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") ### This sets up some common toolchains for building targets. For more details, please see ### https://bazelbuild.github.io/rules_foreign_cc/0.11.1/flatten.html#rules_foreign_cc_dependencies rules_foreign_cc_dependencies() ``` **Full Changelog**: bazel-contrib/rules_foreign_cc@0.10.1...0.11.1 #### What's Changed - Add missing sha256 for meson_src 1.1.1 by [@​lalten](https://github.com/lalten) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1111](https://github.com/bazelbuild/rules_foreign_cc/pull/1111) - Set an empty tools_data attribute for boost by [@​attilaolah](https://github.com/attilaolah) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1112](https://github.com/bazelbuild/rules_foreign_cc/pull/1112) - Advertise CcInfo provider by [@​calebzulawski](https://github.com/calebzulawski) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1118](https://github.com/bazelbuild/rules_foreign_cc/pull/1118) - Allow file targets in native_tool_toolchain() by [@​sitaktif](https://github.com/sitaktif) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1117](https://github.com/bazelbuild/rules_foreign_cc/pull/1117) - set CC and CXX and their flags in meson by [@​xytan0056](https://github.com/xytan0056) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1098](https://github.com/bazelbuild/rules_foreign_cc/pull/1098) - Turn off bzlmod in CI for now by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1142](https://github.com/bazelbuild/rules_foreign_cc/pull/1142) - Fix `//openssl/...` by calling `openssl_setup()` by [@​bcsgh](https://github.com/bcsgh) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1137](https://github.com/bazelbuild/rules_foreign_cc/pull/1137) - Sort tests under examples/third_party and add zlib to the list. by [@​bcsgh](https://github.com/bcsgh) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1136](https://github.com/bazelbuild/rules_foreign_cc/pull/1136) - Use gazelle to generate bzl_library targets by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1127](https://github.com/bazelbuild/rules_foreign_cc/pull/1127) - Use platform specific configs in bazelrc to reduce scope of settings by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1144](https://github.com/bazelbuild/rules_foreign_cc/pull/1144) - Update to ubuntu 20.04 on RBE by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1145](https://github.com/bazelbuild/rules_foreign_cc/pull/1145) - Remove explicit mention of bazel 4.x support by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1146](https://github.com/bazelbuild/rules_foreign_cc/pull/1146) - Add mirrors to external repositories by [@​mishazharov](https://github.com/mishazharov) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1153](https://github.com/bazelbuild/rules_foreign_cc/pull/1153) - Build msvc cmake with prebuilt cmake by [@​matt-sm](https://github.com/matt-sm) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1148](https://github.com/bazelbuild/rules_foreign_cc/pull/1148) - Simplify the toolchain registration for bzlmod by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1105](https://github.com/bazelbuild/rules_foreign_cc/pull/1105) - Update CMake versions by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1159](https://github.com/bazelbuild/rules_foreign_cc/pull/1159) - Fix tool path for nmake by [@​jsun-splunk](https://github.com/jsun-splunk) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1165](https://github.com/bazelbuild/rules_foreign_cc/pull/1165) - chore(deps): Bump rules_apple. Fixes [#​1156](https://github.com/bazelbuild/rules_foreign_cc/issues/1156) by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1166](https://github.com/bazelbuild/rules_foreign_cc/pull/1166) - Add make 4.4.1 by [@​novas0x2a](https://github.com/novas0x2a) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1167](https://github.com/bazelbuild/rules_foreign_cc/pull/1167) - Increase resiliency of `runnable_binary` by [@​mishazharov](https://github.com/mishazharov) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1134](https://github.com/bazelbuild/rules_foreign_cc/pull/1134) - Fix windows examples CI by upgrading TLS trust store by [@​mishazharov](https://github.com/mishazharov) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1171](https://github.com/bazelbuild/rules_foreign_cc/pull/1171) - Fixes the CI failure at Bazel@HEAD by [@​sgowroji](https://github.com/sgowroji) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1173](https://github.com/bazelbuild/rules_foreign_cc/pull/1173) - Add j2objc fragment to rules by [@​sgowroji](https://github.com/sgowroji) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1175](https://github.com/bazelbuild/rules_foreign_cc/pull/1175) - Cater for different drive letters when normalizing path by [@​matt-sm](https://github.com/matt-sm) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1169](https://github.com/bazelbuild/rules_foreign_cc/pull/1169) - Fix [#​1161](https://github.com/bazelbuild/rules_foreign_cc/issues/1161): set the `CMAKE` environment variables for prebuilt toolchains. by [@​thb-sb](https://github.com/thb-sb) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1163](https://github.com/bazelbuild/rules_foreign_cc/pull/1163) - Add aarch64 to prebuild library constraints for macos by [@​dmeijboom](https://github.com/dmeijboom) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1176](https://github.com/bazelbuild/rules_foreign_cc/pull/1176) - Use a sed delimiter that is unlikely to appear in the input by [@​mkauf](https://github.com/mkauf) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1184](https://github.com/bazelbuild/rules_foreign_cc/pull/1184) - Update rules_apple by [@​sgowroji](https://github.com/sgowroji) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1190](https://github.com/bazelbuild/rules_foreign_cc/pull/1190) - Fix - Copy Dir ignores hidden files on macOS by [@​LaurenceTews](https://github.com/LaurenceTews) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1188](https://github.com/bazelbuild/rules_foreign_cc/pull/1188) - fix(docs): Port docs generation to bzlmod to fix user facing doc generation by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1193](https://github.com/bazelbuild/rules_foreign_cc/pull/1193) - Revert "fix(docs): Port docs generation to bzlmod to fix user facing doc generation" by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1194](https://github.com/bazelbuild/rules_foreign_cc/pull/1194) - chore(deps): Add ninja 1.12.0 and latest versions of cmake by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1192](https://github.com/bazelbuild/rules_foreign_cc/pull/1192) - adjust relative msvc paths by [@​matt-sm](https://github.com/matt-sm) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1180](https://github.com/bazelbuild/rules_foreign_cc/pull/1180) - Make pkgconfig Hermetic by [@​dstufft](https://github.com/dstufft) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1069](https://github.com/bazelbuild/rules_foreign_cc/pull/1069) - Exclude filenames with spaces from cmake toolchains by [@​illicitonion](https://github.com/illicitonion) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1199](https://github.com/bazelbuild/rules_foreign_cc/pull/1199) - fix: change cygpath to mixed mode by [@​jsun-splunk](https://github.com/jsun-splunk) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1204](https://github.com/bazelbuild/rules_foreign_cc/pull/1204) - fix: path expansion on windows by [@​jsun-splunk](https://github.com/jsun-splunk) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1207](https://github.com/bazelbuild/rules_foreign_cc/pull/1207) - Revert inadvertent direct commit to main by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1213](https://github.com/bazelbuild/rules_foreign_cc/pull/1213) - Update framework.bzl to account for externalIncludes by [@​layus](https://github.com/layus) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1215](https://github.com/bazelbuild/rules_foreign_cc/pull/1215) - chore(deps): cmake/ninja: add new versions by [@​novas0x2a](https://github.com/novas0x2a) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1212](https://github.com/bazelbuild/rules_foreign_cc/pull/1212) - Revert "cmake: use variable expansion on generator args" by [@​jsharpe](https://github.com/jsharpe) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1219](https://github.com/bazelbuild/rules_foreign_cc/pull/1219) - Add in custom glib patch by [@​andrewkatson](https://github.com/andrewkatson) in [https://github.com/bazelbuild/rules_foreign_cc/pull/1211](https://github.com/bazelbuild/rules_foreign_cc/pull/1211) #### New Contributors - [@​lalten](https://github.com/lalten) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1111](https://github.com/bazelbuild/rules_foreign_cc/pull/1111) - [@​sitaktif](https://github.com/sitaktif) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1117](https://github.com/bazelbuild/rules_foreign_cc/pull/1117) - [@​mishazharov](https://github.com/mishazharov) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1153](https://github.com/bazelbuild/rules_foreign_cc/pull/1153) - [@​matt-sm](https://github.com/matt-sm) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1148](https://github.com/bazelbuild/rules_foreign_cc/pull/1148) - [@​jsun-splunk](https://github.com/jsun-splunk) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1165](https://github.com/bazelbuild/rules_foreign_cc/pull/1165) - [@​sgowroji](https://github.com/sgowroji) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1173](https://github.com/bazelbuild/rules_foreign_cc/pull/1173) - [@​thb-sb](https://github.com/thb-sb) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1163](https://github.com/bazelbuild/rules_foreign_cc/pull/1163) - [@​dmeijboom](https://github.com/dmeijboom) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1176](https://github.com/bazelbuild/rules_foreign_cc/pull/1176) - [@​mkauf](https://github.com/mkauf) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1184](https://github.com/bazelbuild/rules_foreign_cc/pull/1184) - [@​LaurenceTews](https://github.com/LaurenceTews) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1188](https://github.com/bazelbuild/rules_foreign_cc/pull/1188) - [@​layus](https://github.com/layus) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1215](https://github.com/bazelbuild/rules_foreign_cc/pull/1215) - [@​andrewkatson](https://github.com/andrewkatson) made their first contribution in [https://github.com/bazelbuild/rules_foreign_cc/pull/1211](https://github.com/bazelbuild/rules_foreign_cc/pull/1211) **Full Changelog**: bazel-contrib/rules_foreign_cc@0.10.1...0.11.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
In the same vein as #1093, we want to allow
runnable_binary
to run on targets without shared librariesCopy and pasted from #1093
Also, this PR introduces checks for whether the directory which is specified by
$RUNFILES_DIR
actually exists. If it does not exist,cd
ing into it will crash the script (even though the rest of the script would have run fine). This is applicable for cases where the binary has runfiles, and is also a runfile itself.