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 774368 - Dependency file output of resource scanner breaks Ninja
Dependency file output of resource scanner breaks Ninja
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.50.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-11-13 17:20 UTC by Jussi Pakkanen
Modified: 2017-01-27 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-compile-resources: Don't include phony targets in dep (1.12 KB, patch)
2016-11-15 03:55 UTC, Patrick Griffis (tingping)
none Details | Review
glib-compile-resources: Add --generate-phony-targets flag (3.14 KB, patch)
2016-11-15 13:41 UTC, Patrick Griffis (tingping)
accepted-commit_now Details | Review
glib-compile-resources: Add --generate-phony-targets flag (3.89 KB, patch)
2016-11-15 14:12 UTC, Patrick Griffis (tingping)
committed Details | Review
glib-compile-resources: Escape file names in dependency file (3.31 KB, patch)
2016-11-15 17:25 UTC, Patrick Griffis (tingping)
committed Details | Review

Description Jussi Pakkanen 2016-11-13 17:20:48 UTC
Gresource compiler recently got the ability to write dependency files. Its output currently looks roughly like this:

res.xml: res1.dat res2.dat

res1.dat:

res2.dat:

This is in theory correct. However it breaks Ninja, which can not currently handle more than one output rule in the dependency file (the relevant bug is https://github.com/ninja-build/ninja/issues/1184)

It would be great if the dependency scanner would not print deps recursively, at least until Ninja is fixed. The dependency info for res1.dat and res2.dat is also useless so having it there only slows down the build.

Thanks,
Comment 1 David Röthlisberger 2016-11-13 21:05:49 UTC
Just FYI: Typically those phony targets are added so that `make` won't complain if you remove a header file. (I don't know if your compiler is used in practice with `make` or if you always use `ninja`, but those are probably phony targets for the reason I just described, not "recursive" dependencies.)

With GCC you have to ask it to generate the phony targets (with `-MP`) it isn't the default behaviour.
Comment 2 Matthias Clasen 2016-11-14 15:29:41 UTC
do you have a  patch ?
Comment 3 Patrick Griffis (tingping) 2016-11-15 03:55:08 UTC
Created attachment 339874 [details] [review]
glib-compile-resources: Don't include phony targets in dep

This just completely removes the phony targets. We could also add another argument to add the phony targets like mentioned in comment #1
Comment 4 Matthias Clasen 2016-11-15 10:47:08 UTC
Comment #1 seems to indicate that those rules do have some purpose, so adding an option might be good, just in case.
Comment 5 Patrick Griffis (tingping) 2016-11-15 13:41:28 UTC
Created attachment 339931 [details] [review]
glib-compile-resources: Add --generate-phony-targets flag
Comment 6 Patrick Griffis (tingping) 2016-11-15 14:12:11 UTC
Created attachment 339939 [details] [review]
glib-compile-resources: Add --generate-phony-targets flag

(Forgot to update the man page entry)
Comment 7 Matthias Clasen 2016-11-15 15:12:37 UTC
Review of attachment 339931 [details] [review]:

looks good. Would be nice to add the new option to the man page as well (see glib-compiles-resources.xml)
Comment 8 Matthias Clasen 2016-11-15 15:13:17 UTC
Review of attachment 339939 [details] [review]:

like this :-)
Comment 9 Patrick Griffis (tingping) 2016-11-15 17:25:57 UTC
Created attachment 339952 [details] [review]
glib-compile-resources: Escape file names in dependency file

During testing the previous patch I also encountered this issue. I can make a dedicated bug over it if preferred.
Comment 10 Matthias Clasen 2016-11-20 18:29:04 UTC
Review of attachment 339952 [details] [review]:

ok
Comment 11 Patrick Griffis (tingping) 2016-11-20 18:39:51 UTC
Comment on attachment 339952 [details] [review]
glib-compile-resources: Escape file names in dependency file

Pushed to master as 7a8cbc60a5410261fd02bedbe445c7e76167aa7c and 3a8ac6e2212a09944c845f9f2de50fd2b3c7ac61
Comment 12 Philip Withnall 2017-01-27 13:02:22 UTC
This seems to be fixed; closing. Please reopen if I’ve got that incorrect.