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

Boris Kolpackov
2023-11-09T07:52:59Z

Matthew Maurer <mmaurer@google.com> 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.