Open Bug 1399450 Opened 7 years ago Updated 2 years ago

Add a mozbuild helper function for running the C preprocessor in GENERATED_FILES scripts

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(firefox57 wontfix)

Tracking Status
firefox57 --- wontfix

People

(Reporter: ted, Unassigned)

References

Details

We have several scripts used in GENERATED_FILES that run the C preprocessor:
https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/dom/bindings/GenerateCSS2PropertiesWebIDL.py#18
https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/js/src/builtin/embedjs.py#81
https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/layout/style/GenerateCSSPropsGenerated.py#12

Also as a bonus there's a `mach devtools-css-db` command that generates a file used for devtools that runs the preprocessor as part of that:
https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/devtools/shared/css/generated/mach_commands.py#51

There's some inconsistencies in how each script invokes the C preprocessor. It might be nice if we had a helper function in mozbuild to do that in a straightforward way.

As a bonus: none of these invocations ask the preprocessor to write out dependencies for included files (with -MD for gcc/clang or by parsing -showIncludes for msvc), so they're not actually producing proper dependencies. If we consolidated execution to a central place we could add that and make things better.
See Also: → 1281614
Product: Core → Firefox Build System
FWIW, the C preprocessor uses in GenerateCSS2PropertiesWebIDL.py, GenerateCSSPropsGenerated.py, and `mach devtools-css-db` are going away in bug 1452542.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.