Thank you for your email and for raising this issue.
Hi,
I am presently updating Vivaldi to Chromium 138, and have just encountered
an issue with our executable signing system for Windows caused by the
enable_rust assert in rust_target.gni that you added a month ago.
Our signing system builds and signs a mini_installer executable, the GN
file for this target includes at least one target from //base, and that
causes an assert in the above mentioned target.
Could you share which `//base` target you depend on?
We have specified enable_rust as false for this system since it is as far
as we can tell not necessary for the mini installer target (and enabling it
breaks GN elsewhere, although we might conceivably be able to work around
that; but we are also building older versions of Vivaldi that would not
have that kind of workaround, and which might break in other ways).
What it looks like is that //base uses Rust GN templates, without
conditioning it on enable_rust (or the templates aren't changing behavior
based on that)
Yes - in theory some subset of `//base` targets and/or `//base/.../*.gn` files could explicitly handle the `!enable_rust` situation. OTOH my initial thought is that if you depend on `//base`, then you also need to ensure that `enable_rust = true`. It is possible that a part/subset of `//base` doesn't currently depend on Rust, but we can't guarantee that things will stay this way - it is easiest to have a blanket assumption that anything in `//base` can have a Rust dependency. Still, this is just an initial reaction, and maybe I should change my mind after learning more details.
FWIW this has come up in the past (e.g. in
https://crbug.com/374672760) and back then we have taken a position that Chromium engineers (including ones making changes in `//base`) can assume that Rust is available going forward "everywhere". I think the only exception to this rule is the `//build` directory, which has to work without Rust for projects depending on `//build` that don't yet require Rust. (Targets built using the NaCl toolchain are another exception, but IIUC this toolchain should be removed "soon".)
My immediate solution will probably be to disable the assert, but I would
suggest that you make the GN files non-rust-safe.
--
Sincerely,
Yngve N. Pettersen
Vivaldi Technologies AS