GNOME Bugzilla – Bug 773437
glib-compile-resources: Output depfile in same directory as target
Last modified: 2016-11-06 11:44:40 UTC
Created attachment 338364 [details] [review] glib-compile-resources: Output depfile in same directory as target This is a common behavior expected for example by Meson and can be overridden with an absolute path. This shouldn't be a breaking behavior since this feature didn't even work previous to commit 243c1b7e8 anyway.
Wouldn't it make sense to preserve the directory components in the `dependency_file` argument while doing so? That gives a bit more control to the user in terms of where they want to place it while also not forcing them to use absolute paths (which break as soon as the build dir is moved).
The reason I removed it is because that behavior is just sort of non-obvious where as an absolute path is very clear. If people actually read the docs I suppose that wouldn't be an issue though.
Normally, programs have an option like -C or -d, etc which says "output everything in here". glib-compile-resources has never needed that because it only ever outputted one file. Now that can output two, I think it makes sense to use the directory components of, say, a generated .c file (the primary output) as a way of implicitly saying "I want all output inside this directory". From that POV, I think relative paths passed to --dependency-file= should be relative to that directory. Of course this might not be very clear as you say, so maybe we can do something else. However, what is strange is silently discarding the dirname passed to the option, so I think we should not do that. We could error out if there are any directory components, but maybe doing the 'dumb' thing and just appending it to the output directory makes sense. ;)
Created attachment 338381 [details] [review] glib-compile-resources: Output depfile in same directory as target Accept relative paths to targets output directory also.
Review of attachment 338381 [details] [review]: I don't have a strong opinion on the details. This seems ok to me.
Attachment 338381 [details] pushed as 9006940 - glib-compile-resources: Output depfile in same directory as target
Since this merged I started using it in actual projects and my assertion about tools expecting this behavior turned out incorrect. Since nothing depends on this and nobody else had any strong opinions on it I felt it was best to avoid this complication making things actually harder in build systems and revert this. Sorry for the noise.