Re: [PATCH 2/3] kconfig: Add special rust_modules config option

From: Boris Kolpackov
Date: Thu Nov 09 2023 - 02:53:00 EST


Matthew Maurer <mmaurer@xxxxxxxxxx> writes:

> Adds support for the rust_modules kconfig type, which works similarly to
> modules, but for restricting or allowing the use of modules which
> directly depend on Rust.
>
> [...]
>
> +struct symbol *modules_rust_sym;
> +static tristate modules_rust_val;
> +
> +bool sym_depends_rust(struct symbol *sym)
> +{
> + static struct symbol *rust_sym;
> +
> + if (!rust_sym)
> + rust_sym = sym_find("RUST");
> + return expr_depends_symbol(sym->dir_dep.expr, rust_sym, true);
> +}
> +

Hm, this feels like a quick and dirty hack to me: will we be hardcoding
a symbol for each language?

I know there is little sympathy for other projects that use Kconfig,
and whatever Linux needs, goes, but still, this feels like a step too
far.