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 690972 - Fix srcdir != builddir build
Fix srcdir != builddir build
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
: 691808 697204 (view as bug list)
Depends on:
Blocks: 414139 697206
 
 
Reported: 2013-01-02 01:53 UTC by Giovanni Campagna
Modified: 2018-10-06 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix srcdir != builddir build (1.31 KB, patch)
2013-01-02 01:53 UTC, Giovanni Campagna
committed Details | Review
build-sys: fix distcheck for vapi projects (1.67 KB, patch)
2013-02-04 18:19 UTC, Marc-Andre Lureau
none Details | Review
Fix srcdir != builddir build, don't dist vapi and gir. (1.56 KB, patch)
2013-02-04 19:43 UTC, Marc-Andre Lureau
committed Details | Review

Description Giovanni Campagna 2013-01-02 01:53:24 UTC
Generated files go in $(builddir), not $(srcdir)
Comment 1 Giovanni Campagna 2013-01-02 01:53:27 UTC
Created attachment 232492 [details] [review]
Fix srcdir != builddir build
Comment 2 Cosimo Cecchi 2013-01-02 11:10:25 UTC
Review of attachment 232492 [details] [review]:

What kind of error was this triggering?
If you tested this with a module that uses vala and it doesn't generally break distcheck, feel free to push.

::: Makefile.am
@@ +143,3 @@
 if LIBGD_STATIC
+noinst_DATA += $(builddir)/Gd-1.0.gir
+MAINTAINERCLEANFILES += $(builddir)/Gd-1.0.gir

Why did you remove it from EXTRA_DIST?
Comment 3 Giovanni Campagna 2013-01-02 16:34:50 UTC
(In reply to comment #2)
> Review of attachment 232492 [details] [review]:
> 
> What kind of error was this triggering?
> If you tested this with a module that uses vala and it doesn't generally break
> distcheck, feel free to push.

The error is: "no rule to make ../../libgd/Gd-1.0.gir", inside baobab, built with ostbuild ($(top_builddir) = $(top_srcdir)/_build)
distcheck is already broken, because during distcheck the srcdir is not writable, but OTOH distcheck does not trigger this bug because the vapi file is shipped in the tarball and nothing else depends on the .gir file.

> ::: Makefile.am
> @@ +143,3 @@
>  if LIBGD_STATIC
> +noinst_DATA += $(builddir)/Gd-1.0.gir
> +MAINTAINERCLEANFILES += $(builddir)/Gd-1.0.gir
> 
> Why did you remove it from EXTRA_DIST?

distcheck breaks if you try to dist files from builddir. Also, gir files are arch-dependent and should not be shipped.
Comment 4 Cosimo Cecchi 2013-01-02 16:45:31 UTC
Okay, thanks. Feel free to push to master.
Comment 5 Giovanni Campagna 2013-01-02 17:20:25 UTC
Attachment 232492 [details] pushed as 680a9f7 - Fix srcdir != builddir build
Comment 6 Marc-Andre Lureau 2013-02-04 18:19:11 UTC
Created attachment 235159 [details] [review]
build-sys: fix distcheck for vapi projects

Since 680a9f72a0c3019cf4013ed026270ee7b9f1abc9, not dist'ing gir files
means one can't dist vapi files either and those files have to be
built at build time, ie like regular build targets.
Comment 7 Marc-Andre Lureau 2013-02-04 19:31:16 UTC
Giovanni, I am going to revert your changes to fix our distcheck. Since you acknowdge you created another bug in 691808, I think it's fair to come back to previous state here and try to find a better solution. I agree we need to improve this.
Comment 8 Marc-Andre Lureau 2013-02-04 19:33:16 UTC
*** Bug 691808 has been marked as a duplicate of this bug. ***
Comment 9 Marc-Andre Lureau 2013-02-04 19:40:48 UTC
libgd already build-requires vapigen, even if the generated vapi was shipped in the tarball. I guess it should be acceptable if we stop disting gir&vapi and require gir & vapigen at build time.
Comment 10 Marc-Andre Lureau 2013-02-04 19:43:41 UTC
Created attachment 235162 [details] [review]
Fix srcdir != builddir build, don't dist vapi and gir.

Generated files go in $(builddir), not $(srcdir).

(That was a trick to avoid requiring gir & vapi generation at build
time. But since libgd already requires vapigen & g-i at configure
time, it shouldn't be a problem to require them too at build-time)
Comment 11 Marc-Andre Lureau 2013-02-04 19:46:07 UTC
Review of attachment 235162 [details] [review]:

::: Makefile.am
@@ +143,2 @@
 if LIBGD_STATIC
+noinst_DATA += Gd-1.0.gir

now I wonder why it's not in BUILT_SOURCES instead..
Comment 12 Giovanni Campagna 2013-02-04 21:49:10 UTC
(In reply to comment #11)
> Review of attachment 235162 [details] [review]:
> 
> ::: Makefile.am
> @@ +143,2 @@
>  if LIBGD_STATIC
> +noinst_DATA += Gd-1.0.gir
> 
> now I wonder why it's not in BUILT_SOURCES instead..

I don't think it makes much difference, as long as nothing from the same makefile references it.
Comment 13 Cosimo Cecchi 2013-04-04 18:35:38 UTC
*** Bug 697204 has been marked as a duplicate of this bug. ***
Comment 14 Cosimo Cecchi 2013-04-04 18:37:44 UTC
Marc-Andre, Giovanni: does the proposed patch here (or the one from duplicate bug 697204) work for you?
Given that I don't use libgd with Vala in any of my projects I'll leave it up to you to test and merge the most correct solution :)
Comment 15 Alban Browaeys 2013-12-09 11:41:37 UTC
I believe this version that strip the builddir/srcdir from the gir target is best. As of now /opt/gnome/share/gobject-introspection-1.0/Makefile.introspection build the gir targets with INTROSPECTION_GIRS items which are also used to compute the gir_name (and does not support directories in the INTROSPECTION_GIRS items).
Thus it makes sense to depends only on "gir-file/gir-name token" .
Otherwise one should define on its own the "<path>/<gir_file/gir_name token>:" target to avoid it only working in the srcdir != builddir or only in the srcdir == builddir use cases.

To sum up the fix in this report fits best with the current gobject-introspection make definitions. Though those requires the gir to get generated in the builddir (and would not fixing on the gobject introspection make definition side to do otherwise).
Comment 16 Debarshi Ray 2015-03-03 13:08:42 UTC
ping
Comment 17 Simon McVittie 2016-06-07 19:13:52 UTC
Review of attachment 235162 [details] [review]:

For what it's worth, this looks good to me, and is necessary (although not sufficient, Bug #697206) to jhbuild gnome-boxes at the moment.

::: Makefile.am
@@ +143,2 @@
 if LIBGD_STATIC
+noinst_DATA += Gd-1.0.gir

BUILT_SOURCES are for when there's a dependency that Automake can't see at autogen time, for example GDBus generating header files that are #include'd by a known .c file: because Automake gets header dependencies as a side-effect of compilation, it can't know what is #include'd until after one build has succeeded. This is not that situation, so BUILT_SOURCES should be unnecessary.
Comment 18 Debarshi Ray 2018-10-06 16:44:20 UTC
Review of attachment 235162 [details] [review]:

Barring a few things GTK+ proper has subsumed libgd in a lot of places, and there's a mass exodus from Autotools going on at the moment. Given all that, I don't know if it is even possible to test this patch. eg., currently Boxes doesn't uses neither Autotools nor libgd.

Thankfully it still survives at three-way merge.

So, I will trust Simon's review, and since this doesn't break gnome-photos' distcheck (it doesn't use introspection at all, but still), I am pushing it to master.