-
Notifications
You must be signed in to change notification settings - Fork 23
Rust Errors due to invalid Bindings during Foxhound Compilation
Using some types from the standard library for members of C++ classes can cause problems involving rust files. There will be a compilation error involving these files.
Firefox is partially written in rust. Because of that, there is some code generation happening to enable interoperability. See the following article for details: Rust/C++ interop
To enable this interoperability, the Firefox build system uses rust-bindgen. The rust files causing syntax errors are generated by rust-bindgen.
Rust-bindgen allows to define opague types. These types will not be made available for interoperability. Because taint classes are not required in any Firefox/Foxhound components written in rust, adding the taint classes as opague types is the simples solution.
To do this, one will have to find the relevant configuration file within the Firefox source code. The error message should help locating the relevant directories which have to be searched.
Currently this solution is implemented in the primitaint branch because of errors within the servo-component.
By adding StringTaint as an opaque the problem can be solved.
See the following change for the exact modification..
There is also another (unrelated) possible error involving rust compilation.
If during compilation gkrust fails with a SIGKILL, this is probably caused by the RAM being full.
In this case a retry (preferably with less other running processes) can help.