After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 638453 - Do not regenerate / touch st.h when not needed
Do not regenerate / touch st.h when not needed
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: building
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-01-01 15:24 UTC by Giovanni Campagna
Modified: 2011-01-03 23:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Build: stop regenerating st.h when not needed (1.32 KB, patch)
2011-01-01 15:24 UTC, Giovanni Campagna
reviewed Details | Review
Build: stop updating timestamp of st.h when not needed (1.60 KB, patch)
2011-01-03 21:24 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2011-01-01 15:24:17 UTC
See patch.
Comment 1 Giovanni Campagna 2011-01-01 15:24:55 UTC
Created attachment 177328 [details] [review]
Build: stop regenerating st.h when not needed

Use the same approach as other generated headers (a temporary file,
compare to the existing, then copy), to avoid regenerating st.h, so
that other dependent objects are not rebuilt, if not needed.
It should speed up building when switching git branches, as often
config.status or automake are run, causing Makefiles to be recreated.
Comment 2 Owen Taylor 2011-01-03 17:10:28 UTC
Review of attachment 177328 [details] [review]:

Basically fine to commit, some consistency issues with the other rules that would be better corrected before commit.

Subject line might be better as 'stop updating timestamp on st.h when not changed' since precisely speaking it does get regenerated.

::: src/Makefile-st.am
@@ +104,3 @@
+	@:
+
+stamp-st.h: Makefile

Inconsistency is noise. "why is this different" takes time to figure out. So if all the other rules do this as @true and don't have a following blank line, then while the above is perfectly fine in isolation, it should be consistent in this context.

@@ +108,3 @@
 	for name in $(st_source_h); do			\
 	  echo "#include <"$$name">";			\
+	done; echo "#undef ST_H_INSIDE") > st.h.tmp &&  \

Similarly I'd use $@.tmp for consistency (and to reduce the chance that this rule gets cut-and-pasted and all the references don't get changed and a parallel make problem is created. This has happened before.) Yes, I know that $@.tmp is stamp-st.h.tmp not st.h.tmp - that's fine here.
Comment 3 Giovanni Campagna 2011-01-03 21:24:41 UTC
Created attachment 177434 [details] [review]
Build: stop updating timestamp of st.h when not needed

Use the same approach as other generated headers (a temporary file,
compare to the existing, then copy), to avoid touching st.h, so
that other dependent objects are not rebuilt, if not needed.
It should speed up building when switching git branches, as often
config.status or automake are run, causing Makefiles to be recreated.
Comment 4 Owen Taylor 2011-01-03 23:07:47 UTC
Review of attachment 177434 [details] [review]:

Looks great