On 14/09/2020 13.38, Max Reitz wrote:
> On macOS, (out of the box) readlink does not have -f.  If the recent
> "readlink -f" call introduced by b1cbc33a397 fails, just fall back to
> the old behavior (which means you can run the iotests only from the
> build tree, but that worked fine for six years, so it should be fine
> still).
> 
> Keep any potential error message on stderr.  If users want to run the
> iotests from outside the build tree, this may point them to what's wrong
> (with their system).
> 
> Fixes: b1cbc33a3971b6bb005d5ac3569feae35a71de0f
>        ("iotests: Allow running from different directory")
> Reported-by: Claudio Fontana <[email protected]>
> Reported-by: Thomas Huth <[email protected]>
> Signed-off-by: Max Reitz <[email protected]>
> ---
> Hi Thomas,
> 
> I thought this would be quicker than writing a witty response on whether
> you or me should write this patch. O:)
> ---
>  tests/qemu-iotests/check | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index e14a1f354d..75675e1a18 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -45,6 +45,10 @@ then
>      fi
>      source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to 
> enter source tree"
>      build_iotests=$(readlink -f $(dirname "$0"))
> +    if [ "$?" -ne 0 ]; then
> +        # Perhaps -f is unsupported, revert to pre-b1cbc33a397 behavior
> +        build_iotests=$PWD
> +    fi
>  else
>      # called from the source tree
>      source_iotests=$PWD

Thanks, the macOS build seems to work again:

 https://cirrus-ci.com/task/5431828267925504?command=main#L7033

Tested-by: Thomas Huth <[email protected]>


Reply via email to