-
Notifications
You must be signed in to change notification settings - Fork 185
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
Misc. operability tweaks for clang-format
#5422
Conversation
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
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.
Thanks!
afe70c8
to
d2b951b
Compare
|
||
src=$GITHUB_WORKSPACE | ||
src=$(dirname $0)/../.. |
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.
It turns out CI invokes this with source
not with bash
, and when you source
a script, its $0
is -bash
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.
$ cat foo
echo '$0' is $0
echo '$*' is $*
$ bash ./foo 1 2 3
$0 is ./foo
$* is 1 2 3
$ bash $(pwd)/foo 1 2 3
$0 is /Users/kerl/git/TileDB-Inc/TileDB/foo
$* is 1 2 3
$ source foo 1 2 3
$0 is -bash
$* is 1 2 3
$ source $(pwd)/foo 1 2 3
$0 is -bash
$* is 1 2 3
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.
Maybe we should fix the workflow, it doesn't make much sense to run this script by sourcing it.
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 saw somewhen/somewhere some comments about sourcing in GH YAML; maybe a recommended best practice? 🤔
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.
Personally I'm happy with trying the experimental method -- I can modify the calling YAML to bash
the script than source
the script ...
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.
No idea. 😅
My intuition is that sourcing should be done only in special circumstances and when a script is less of a "function" and more of an "environment initializer".
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.
@teo-tsirpanis oh I 100% agree, and have for years, even before TileDB. The only good reason for source
to me is something that needs to set environment variables, aliases, etc. for the parent process.
I'm simply wondering if there's some other good reason, within this particular GHA context, which the person who keystroked source
into GHA YAML didn't bother to explain at the time, leaving you & me to wonder. But again, I'm happy to find that out by experiment.
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.
For whatever the reason (good or bad) whenever this was written, there's a lot of it:
kerl@arvad[prod][kerl/current-domain-error-message][TileDB]$ rg ' source ' .github/workflows/*ml
.github/workflows/unit-test-runs.yml
88: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/test-cloud-e2e.yml
57: source $GITHUB_WORKSPACE/scripts/ci/bootstrap_libtiledb.sh
68: source $GITHUB_WORKSPACE/scripts/ci/build_libtiledb.sh
106: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/release.yml
136: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/check-formatting.yml
41: source $GITHUB_WORKSPACE/scripts/ci/check_formatting_linux.sh
.github/workflows/build-ubuntu20.04-backwards-compatibility.yml
41: source $GITHUB_WORKSPACE/scripts/ci/bootstrap_libtiledb.sh
42: source $GITHUB_WORKSPACE/scripts/ci/build_libtiledb.sh
122: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/ci-linux_mac.yml
157: source $GITHUB_WORKSPACE/scripts/ci/bootstrap_libtiledb.sh
168: source $GITHUB_WORKSPACE/scripts/ci/build_libtiledb.sh
189: source $GITHUB_WORKSPACE/scripts/ci/posix/build-services-start.sh
211: source $GITHUB_WORKSPACE/scripts/ci/posix/build-services-stop.sh
221: # It relies on finding its source directory.
227: source $GITHUB_WORKSPACE/scripts/ci/build_benchmarks.sh
274: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/build-rtools40.yml
66: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
.github/workflows/build-windows.yml
432: source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
The |
@teo-tsirpanis please feel free to merge when you are ready. I lack permssions on this repo. Thank you! |
Thank you @teo-tsirpanis ! |
Found while debugging CI fails on #5421.
TYPE: NO_HISTORY