tpm2-software / tpm2-tss

OSS implementation of the TCG TPM2 Software Stack (TSS2)
https://tpm2-software.github.io
BSD 2-Clause "Simplified" License
715 stars 352 forks source link

int-log-compiler-common.sh: Remove dependency on which #2825

Closed salahcoronya closed 1 month ago

salahcoronya commented 1 month ago

See https://lwn.net/Articles/874049/

AndreasFuchsTPM commented 1 month ago

Why use type -P ? The lwn article mentions command -v.

thesamesam commented 1 month ago

If the file relies on bash already, type -P is mildly superior as it will ignore functions defined in the user's environment. I haven't checked if that's the case here.

AndreasFuchsTPM commented 1 month ago

Given the comment in https://github.com/tpm2-software/tpm2-tss/pull/2830 I'd prefer command -v to have as few bash-specifics as possible in favor of posix. Could you update the PR for me to merge ?

SoapGentoo commented 1 month ago

also, I think there's one more use of which: https://github.com/tpm2-software/tpm2-tss/blob/master/.ci/coverity.run#L62 Whilst this isn't needed for the build on our side, I think I'd be a good idea to get rid of all which invocations, since distros might remove it in future.

eli-schwartz commented 1 month ago

Given the comment in #2830 I'd prefer command -v to have as few bash-specifics as possible in favor of posix. Could you update the PR for me to merge ?

I'm not attached to the use of type -P or bash, but just as a devil's advocate I would like to point out that you can have a policy that your tests use bash, and that's a project choice.

configure.ac has to be written in POSIX sh because the autotools don't let you choose the script interpreter shebang for your ./configure script -- it is always /bin/sh, never bash.