Miguel Ojeda
a329671bf1
kbuild: rust_is_available: add check for bindgen invocation
[ Upstream commit 52cae7f28e ]
`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:48:03 +02:00
..
2023-04-29 09:09:31 +02:00
2023-01-22 23:43:33 +09:00
2023-01-26 12:43:33 +09:00
2022-12-26 21:47:12 +01:00
2023-03-27 22:45:22 +02:00
2022-08-21 02:47:48 +09:00
2023-02-02 18:43:28 +00:00
2023-06-19 13:19:32 -07:00
2022-05-24 16:33:20 +09:00
2023-04-17 11:03:56 +09:00
2023-07-19 16:36:19 +02:00
2023-07-19 16:36:24 +02:00
2022-09-20 14:12:25 -04:00
2023-02-18 14:34:09 -05:00
2023-03-16 22:46:12 +09:00
2022-05-08 03:16:59 +09:00
2023-01-26 12:41:38 +09:00
2023-04-21 08:58:00 -07:00
2023-02-02 22:50:03 -08:00
2023-04-11 17:45:57 +02:00
2023-04-24 10:18:32 -07:00
2021-09-08 11:50:28 -07:00
2023-03-16 22:46:12 +09:00
2022-09-29 04:40:15 +09:00
2023-05-02 19:24:16 -07:00
2021-08-10 09:13:25 +09:00
2023-01-26 12:43:33 +09:00
2023-04-27 19:57:00 -07:00
2023-03-23 10:02:02 +01:00
2023-03-23 17:18:32 -07:00
2021-08-05 20:55:39 +09:00
2023-02-25 20:11:06 +01:00
2021-01-04 10:38:11 +09:00
2023-02-08 13:33:29 +01:00
2022-09-28 09:01:40 +02:00
2023-02-21 16:53:54 -08:00
2021-01-01 12:26:39 -08:00
2020-09-04 18:19:37 +02:00
2023-01-26 12:43:33 +09:00
2021-10-26 09:42:29 -06:00
2020-03-17 08:59:03 +09:00
2022-08-29 13:58:47 +09:00
2022-11-16 10:42:10 +01:00
2021-03-08 13:19:05 +01:00
2022-12-14 15:42:40 +09:00
2021-09-03 08:17:21 +09:00
2022-05-08 01:33:07 -07:00
2021-01-14 08:21:09 -08:00
2023-04-07 00:53:34 +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-19 13:19:32 -07:00
2023-01-09 18:22:21 +01:00
2023-03-10 21:05:16 +01:00
2022-05-11 21:45:53 +09:00
2023-04-19 19:28:49 +02:00
2023-01-16 20:15:20 +09:00
2023-07-27 08:56:54 +02:00
2023-01-22 23:43:33 +09:00
2023-01-26 12:41:38 +09:00
2023-02-26 11:53:25 -08:00
2021-04-25 05:14:26 +09:00
2023-03-29 06:52:08 -04:00
2023-04-30 11:32:53 -07:00
2023-03-16 22:46:12 +09:00
2022-11-22 23:40:02 +09:00
2023-07-27 08:57:06 +02:00
2023-07-19 16:37:00 +02:00
2022-11-22 23:40:02 +09:00
2023-07-19 16:37:00 +02:00
2022-11-21 10:18:39 +09:00
2023-02-13 20:18:28 +01:00
2022-11-22 23:40:02 +09:00
2022-12-11 17:28:32 +09:00
2022-08-16 12:25:53 -07:00
2021-03-15 19:20:48 +09:00
2023-07-27 08:57:06 +02:00
2023-04-18 16:29:43 -07:00
2020-08-10 01:32:59 +09:00
2021-12-09 16:42:27 -08:00
2022-10-03 14:03:19 -07:00
2023-01-22 23:43:33 +09:00
2023-07-19 16:36:23 +02:00
2023-02-23 14:05:08 -08:00
2023-02-05 18:51:22 +09:00
2023-04-30 11:32:53 -07:00
2022-05-08 01:33:07 -07:00
2022-01-20 08:52:55 +02:00
2020-05-17 18:52:01 +09:00
2023-07-19 16:36:23 +02:00
2022-10-03 03:52:58 +09:00
2023-03-05 10:49:37 -08:00
2023-01-22 23:43:33 +09:00
2022-09-29 04:40:15 +09:00
2023-07-19 16:36:19 +02:00
2022-11-09 18:06:35 +00:00
2022-12-14 15:42:40 +09:00
2022-06-08 20:14:13 +09:00
2022-06-05 06:20:57 +09:00
2023-04-14 16:08:28 +02:00
2023-06-16 17:17:42 +02:00
2023-01-17 17:29:42 +01:00
2022-02-02 11:19:33 +01:00
2020-03-26 15:08:27 -07:00
2022-05-11 21:46:38 +09:00
2023-04-25 21:10:20 -04:00
2021-06-18 09:09:17 -04:00
2022-03-07 13:54:59 +01:00
2023-04-19 07:46:31 -07:00
2023-01-30 13:00:30 +09:00
2022-09-28 09:02:06 +02:00
2023-09-13 09:48:03 +02:00
2023-03-16 22:46:12 +09:00
2020-12-08 23:30:04 +09:00
2022-08-03 23:56:20 +03:00
2022-12-14 08:36:11 +08:00
2023-03-23 23:18:58 +01: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
2023-02-02 22:50:07 -08:00
2022-10-13 11:14:43 -06:00
2020-12-08 23:30:04 +09:00
2022-06-03 20:09:27 +08:00
2021-07-09 04:00:39 +09:00
2021-08-10 09:13:25 +09:00
2021-07-09 04:00:39 +09:00
2023-07-05 18:30:30 +01:00
2022-02-13 16:50:06 -08:00
2023-04-17 11:23:06 +09:00
2021-05-03 17:23:06 -06:00
2021-08-10 09:13:25 +09:00
2020-06-06 23:42:01 +09:00