diff options
| author | Miguel Ojeda <[email protected]> | 2023-06-16 00:16:29 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2023-08-09 23:18:34 +0000 |
| commit | f295522886a4ebb628cadb2cd74d0661d6292978 (patch) | |
| tree | 87490c3cb9df92237c60b2fce7a634d7ce4bff13 /scripts/rust_is_available_test.py | |
| parent | kbuild: rust_is_available: normalize version matching (diff) | |
| download | kernel-f295522886a4ebb628cadb2cd74d0661d6292978.tar.gz kernel-f295522886a4ebb628cadb2cd74d0661d6292978.zip | |
kbuild: rust_is_available: handle failures calling `$RUSTC`/`$BINDGEN`
The script already checks if `$RUSTC` and `$BINDGEN` exists via
`command`, but the environment variables may point to a
non-executable file, or the programs may fail for some other reason.
While the script successfully exits with a failure as it should,
the error given can be quite confusing depending on the shell and
the behavior of its `command`. For instance, with `dash`:
$ RUSTC=./mm BINDGEN=bindgen CC=clang scripts/rust_is_available.sh
scripts/rust_is_available.sh: 19: arithmetic expression: expecting primary: "100000 * + 100 * + "
Thus detect failure exit codes when calling `$RUSTC` and `$BINDGEN` and
print a better message, in a similar way to what we do when extracting
the `libclang` version found by `bindgen`.
Link: https://lore.kernel.org/rust-for-linux/CAK7LNAQYk6s11MASRHW6oxtkqF00EJVqhHOP=5rynWt-QDUsXw@mail.gmail.com/
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/rust_is_available_test.py')
0 files changed, 0 insertions, 0 deletions
