You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5019402 ci: Remove bash -c from cmake invocation using eval (Brandon Odiwuor)
Pull request description:
Follow up to bitcoin/bitcoin#32970bitcoin/bitcoin#32970 (comment)
> Does `cmake -S ...` still need to be wrapped in `bash -c "..."`?
bitcoin/bitcoin#32970 (comment)
> It is not trivial to replace. Maybe the `eval` hack from below can be used:
>
> ```shell
> # parses TEST_RUNNER_EXTRA as an array which allows for multiple arguments such as TEST_RUNNER_EXTRA='--exclude "rpc_bind.py --ipv6"'
>
> eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)"
> ```
>however, I haven't tried this yet.
bitcoin/bitcoin#32970 (comment)
> Yeah, the eval hack should work:
>
> ```
> $ export T="-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'"; eval "T=($T)"; for i in "${T[@]}"; do echo "_${i}_" ; done
> _-DREDUCE_EXPORTS=ON_
> _-DCMAKE_CXX_FLAGS=-Wno-psabi -Wno-error=maybe-uninitialized_
> ```
>
> (can be done in a follow-up)
This replaces the `bash -c` wrapper with an eval-based array parsing to preserve spaces in flag values (e.g., in CMAKE_CXX_FLAGS), allowing ShellCheck to lint the cmake command
ACKs for top commit:
maflcko:
lgtm ACK 5019402
hebasto:
ACK 5019402.
Tree-SHA512: 6fd22569e2c719a8d13805f18e1e7e3b8eb57d0a6307f2e7175988b25750eafb7c8260796c8e7350db67d622dbe97e6af7bab8ee52187bb8e8eeae3740a47c01
0 commit comments