Improvements to the build system code handling preprocessing

RESOLVED FIXED in Firefox 55

Status

()

Core
Build Config
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(4 attachments)

(Assignee)

Description

8 months ago
For bug 1349022, I did try builds getting the entire (well, most) code tree in preprocessed form. Essentially, I added %.$(OBJ_SUFFIX): %.i dependencies, and removed the condition hiding the .i rules.

This unveiled a couple issues:
- The .i rules don't work for generated sources.
- We uselessly create .deps files.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 5

8 months ago
mozreview-review
Comment on attachment 8854744 [details]
Bug 1353640 - Factor the preprocessing rules to avoid all the redundancy.

https://reviewboard.mozilla.org/r/126718/#review129616
Attachment #8854744 - Flags: review?(mshal) → review+

Comment 6

8 months ago
mozreview-review
Comment on attachment 8854745 [details]
Bug 1353640 - Avoid the preprocessor rules creating dependency files.

https://reviewboard.mozilla.org/r/126720/#review129624

::: config/rules.mk:1033
(Diff revision 1)
>  define PREPROCESS_RULES
>  _PREPROCESSED_$1_FILES := $$(call _group_srcs,$1,$2)
>  # Make preprocessed files PHONY so they are always executed, since they are
>  # manual targets and we don't necessarily write to $@.
>  .PHONY: $$(_PREPROCESSED_$1_FILES)
> -$$(_PREPROCESSED_$1_FILES): %.i: %.$1 $$(call mkdir_deps,$$(MDDEPDIR))
> +$$(_PREPROCESSED_$1_FILES): _DEPEND_CFLAGS=

The eval/call logic always has be slightly confused, but I don't think this is doing what you want. Since you are using $(COMPILE_CXXFLAGS) in the $(call) function, the cxxflags are expanded during the call and not during the rule processing. If you change $(eval) to $(info) you can see that the -MD and such flags are already in the rule. I think you want to use $$(COMPILE_CXXFLAGS) and the like below in order for this to take effect.. Otherwise I get this:

$ rm -rf .deps
$ make Unified_cpp_xpcom_ds1.i
/usr/bin/ccache /usr/bin/g++ ...
<built-in>: fatal error: opening dependency file .deps/.pp: No such file or directory
compilation terminated.
/home/mshal/mozilla-central-git/config/rules.mk:1066: recipe for target 'Unified_cpp_xpcom_ds1.i' failed
make: *** [Unified_cpp_xpcom_ds1.i] Error 1
Attachment #8854745 - Flags: review?(mshal)

Comment 7

8 months ago
mozreview-review
Comment on attachment 8854746 [details]
Bug 1353640 - Use more targetted vpath instead of broad VPATH for preprocessor rules.

https://reviewboard.mozilla.org/r/126722/#review129626
Attachment #8854746 - Flags: review?(mshal) → review+

Comment 8

8 months ago
mozreview-review
Comment on attachment 8854747 [details]
Bug 1353640 - Also check sources in the objdir to preprocess generated sources.

https://reviewboard.mozilla.org/r/126724/#review129630
Attachment #8854747 - Flags: review?(mshal) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Updated

8 months ago
Attachment #8854744 - Flags: review+ → review?(mshal)
(Assignee)

Updated

8 months ago
Attachment #8854746 - Flags: review+ → review?(mshal)

Comment 13

8 months ago
mozreview-review
Comment on attachment 8854744 [details]
Bug 1353640 - Factor the preprocessing rules to avoid all the redundancy.

https://reviewboard.mozilla.org/r/126718/#review129752
Attachment #8854744 - Flags: review?(mshal) → review+

Comment 14

8 months ago
mozreview-review
Comment on attachment 8854745 [details]
Bug 1353640 - Avoid the preprocessor rules creating dependency files.

https://reviewboard.mozilla.org/r/126720/#review129754
Attachment #8854745 - Flags: review?(mshal) → review+

Comment 15

8 months ago
mozreview-review
Comment on attachment 8854746 [details]
Bug 1353640 - Use more targetted vpath instead of broad VPATH for preprocessor rules.

https://reviewboard.mozilla.org/r/126722/#review129756
Attachment #8854746 - Flags: review?(mshal) → review+

Comment 16

8 months ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/f83bc4b3dfa6
Factor the preprocessing rules to avoid all the redundancy. r=mshal
https://hg.mozilla.org/integration/autoland/rev/388684b808db
Avoid the preprocessor rules creating dependency files. r=mshal
https://hg.mozilla.org/integration/autoland/rev/a614823d73f4
Use more targetted vpath instead of broad VPATH for preprocessor rules. r=mshal
https://hg.mozilla.org/integration/autoland/rev/7632e3ba8262
Also check sources in the objdir to preprocess generated sources. r=mshal

Comment 17

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f83bc4b3dfa6
https://hg.mozilla.org/mozilla-central/rev/388684b808db
https://hg.mozilla.org/mozilla-central/rev/a614823d73f4
https://hg.mozilla.org/mozilla-central/rev/7632e3ba8262
Status: NEW → RESOLVED
Last Resolved: 8 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.