diff options
author | Miguel Ojeda <ojeda@kernel.org> | 2023-06-16 02:16:29 +0200 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2023-08-10 01:18:34 +0200 |
commit | f295522886a4ebb628cadb2cd74d0661d6292978 (patch) | |
tree | 87490c3cb9df92237c60b2fce7a634d7ce4bff13 /Kconfig | |
parent | 7cd6a3e1f94bab4f2a3425e06f70ab13eb8190d4 (diff) | |
download | linux-starfive-f295522886a4ebb628cadb2cd74d0661d6292978.tar.gz linux-starfive-f295522886a4ebb628cadb2cd74d0661d6292978.tar.bz2 linux-starfive-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 <nathan@kernel.org>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Link: https://lore.kernel.org/r/20230616001631.463536-10-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions