Miguel Ojeda
4f8c55ae5d
kbuild: rust_is_available: add check for bindgen invocation
[ Upstream commit 52cae7f28ed6c3992489f16bb355f5b623f0912e ]
`scripts/rust_is_available.sh` calls `bindgen` with a special
header in order to check whether the `libclang` version in use
is suitable.
However, the invocation itself may fail if, for instance, `bindgen`
cannot locate `libclang`. This is fine for Kconfig (since the
script will still fail and therefore disable Rust as it should),
but it is pretty confusing for users of the `rustavailable` target
given the error will be unrelated:
./scripts/rust_is_available.sh: 21: arithmetic expression: expecting primary: "100000 * + 100 * + "
make: *** [Makefile:1816: rustavailable] Error 2
Instead, run the `bindgen` invocation independently in a previous
step, saving its output and return code. If it fails, then show
the user a proper error message. Otherwise, continue as usual
with the saved output.
Since the previous patch we show a reference to the docs, and
the docs now explain how `bindgen` looks for `libclang`,
thus the error message can leverage the documentation, avoiding
duplication here (and making users aware of the setup guide in
the documentation).
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/rust-for-linux/CAKwvOdm5JT4wbdQQYuW+RT07rCi6whGBM2iUAyg8A1CmLXG6Nw@mail.gmail.com/
Reported-by: François Valenduc <francoisvalenduc@gmail.com>
Closes: https://github.com/Rust-for-Linux/linux/issues/934
Reported-by: Alexandru Radovici <msg4alex@gmail.com>
Closes: https://github.com/Rust-for-Linux/linux/pull/921
Reported-by: Matthew Leach <dev@mattleach.net>
Closes: https://lore.kernel.org/rust-for-linux/20230507084116.1099067-1-dev@mattleach.net/
Fixes: 78521f3399 ("scripts: add `rust_is_available.sh`")
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20230616001631.463536-6-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:42:32 +02:00
..
2023-02-01 08:34:49 +01:00
2022-05-08 01:33:07 -07:00
2023-03-17 08:50:31 +01:00
2022-08-07 21:30:36 +02:00
2022-09-27 10:36:16 -05:00
2022-08-21 02:47:48 +09:00
2023-08-16 18:27:20 +02:00
2023-05-11 23:03:40 +09:00
2022-05-24 16:33:20 +09:00
2023-03-22 13:33:52 +01:00
2023-07-19 16:21:42 +02:00
2023-03-10 09:33:41 +01:00
2022-09-20 14:12:25 -04:00
2023-02-01 08:34:37 +01:00
2022-09-28 09:02:06 +02:00
2022-05-08 03:16:59 +09:00
2023-06-21 16:01:03 +02:00
2023-04-26 14:28:44 +02:00
2022-07-17 17:31:40 -07:00
2022-08-25 11:49:14 -07:00
2022-09-28 09:02:20 +02:00
2021-09-08 11:50:28 -07:00
2022-09-29 04:40:15 +09:00
2021-08-10 09:13:25 +09:00
2023-03-17 08:50:31 +01:00
2022-10-12 11:00:22 -07:00
2022-07-27 21:18:00 +09:00
2022-05-08 03:16:59 +09:00
2022-01-20 08:52:54 +02:00
2022-09-28 09:01:40 +02:00
2022-09-11 21:55:05 -07:00
2023-03-17 08:50:31 +01:00
2021-10-26 09:42:29 -06:00
2022-08-29 13:58:47 +09:00
2022-11-16 10:42:10 +01:00
2022-06-26 06:15:05 +09:00
2021-09-03 08:17:21 +09:00
2022-05-08 01:33:07 -07:00
2022-09-28 09:02:06 +02:00
2022-09-28 09:02:45 +02:00
2022-04-24 10:38:44 +02:00
2022-06-30 12:22:17 -06:00
2022-04-29 14:38:00 -07:00
2023-06-28 11:12:22 +02:00
2023-02-25 11:25:42 +01:00
2022-07-27 21:18:00 +09:00
2022-05-11 21:45:53 +09:00
2022-09-28 09:02:06 +02:00
2023-07-27 08:50:50 +02:00
2022-09-29 02:00:29 +09:00
2023-06-21 16:01:03 +02:00
2022-06-13 11:07:45 -06:00
2021-10-15 11:25:13 +02:00
2023-07-27 08:50:39 +02:00
2022-09-28 09:02:20 +02:00
2022-10-15 05:22:29 +09:00
2022-03-21 08:13:03 -07:00
2022-05-08 03:17:00 +09:00
2023-06-21 16:01:03 +02:00
2022-09-28 09:02:20 +02:00
2022-10-10 12:00:45 -07:00
2022-08-16 12:25:53 -07:00
2022-09-28 09:02:20 +02:00
2021-09-24 16:13:35 -07:00
2021-12-09 16:42:27 -08:00
2022-10-03 14:03:19 -07:00
2022-10-10 17:53:04 -07:00
2023-07-19 16:21:44 +02:00
2023-02-09 11:28:11 +01:00
2022-10-28 00:19:40 +09:00
2022-11-24 09:27:57 +09:00
2022-05-08 01:33:07 -07:00
2022-01-20 08:52:55 +02:00
2022-10-03 03:52:58 +09:00
2022-10-03 03:52:58 +09:00
2022-11-09 18:41:16 +01:00
2022-09-29 04:40:15 +09:00
2022-10-03 03:51:58 +09:00
2022-09-26 10:13:13 -07:00
2022-06-08 20:14:13 +09:00
2022-06-05 06:20:57 +09:00
2022-05-12 10:08:43 -07:00
2022-02-22 14:32:44 -08:00
2022-02-02 11:19:33 +01:00
2022-05-11 21:46:38 +09:00
2023-05-24 17:32:41 +01:00
2022-03-07 13:54:59 +01:00
2022-08-12 18:39:43 -07:00
2022-09-28 09:02:06 +02:00
2023-09-13 09:42:32 +02:00
2022-01-08 18:03:57 +09:00
2022-08-03 23:56:20 +03:00
2022-06-03 20:09:27 +08:00
2022-01-18 10:17:18 -05:00
2022-06-01 09:32:45 -06:00
2022-05-18 15:34:33 +02:00
2022-05-18 15:35:42 +02:00
2022-03-22 15:57:00 -07:00
2022-07-07 12:47:34 -06:00
2022-06-03 20:09:27 +08:00
2021-08-10 09:13:25 +09:00
2023-07-05 18:27:38 +01:00
2022-02-13 16:50:06 -08:00
2021-08-10 09:13:25 +09:00