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 737274 - top level Makefile: gcr/gcr-dbus-generated.h target never run; so: no starting _ in gcr_dbus* names
top level Makefile: gcr/gcr-dbus-generated.h target never run; so: no startin...
Status: RESOLVED DUPLICATE of bug 737622
Product: gcr
Classification: Core
Component: General
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-24 15:47 UTC by gabriele balducci
Modified: 2019-02-22 11:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description gabriele balducci 2014-09-24 15:47:50 UTC
hello,

I can't find any reference to this neither in bugzilla nor anywhere
else, yet it looks to me like a "real" problem

Apologies if I am missing some blatant point here

Starting with  3.13.91, I get the  following undefs at link  time when
building gcr:

undefined reference to `gcr_dbus_prompter_callback_get_type'
undefined reference to `gcr_dbus_prompter_callback_skeleton_get_type'
undefined reference to `gcr_dbus_prompter_proxy_get_type'
undefined reference to `gcr_dbus_prompter_callback_proxy_get_type'
undefined reference to `gcr_dbus_prompter_skeleton_get_type'
undefined reference to `gcr_dbus_prompter_get_type'

Turns out that the problem is in the Makefile:

----8<----8<----8<----
[...]
BUILT_SOURCES = $(gck_BUILT_SOURCES) $(gcr_BUILT_SOURCES) \
	$(am__append_6)
[...]
gcr_BUILT_SOURCES = \
	gcr/gcr-marshal.c gcr/gcr-marshal.h \
	gcr/gcr-enum-types-base.c gcr/gcr-enum-types-base.h \
	gcr/gcr-oids.c gcr/gcr-oids.h \
	gcr/gcr-dbus-generated.c gcr/gcr-dbus-generated.h

[...]

all: $(BUILT_SOURCES) config.h
	$(info BUILT_SOURCES: $(BUILT_SOURCES))
	$(MAKE) $(AM_MAKEFLAGS) all-recursive

[...]

gcr/gcr-dbus-generated.c: $(DBUS_XML_DEFINITIONS)
	$(AM_V_GEN) $(GDBUS_CODEGEN) --interface-prefix org.gnome.keyring.internal. \
		--generate-c-code gcr/gcr-dbus-generated --c-namespace GcrDBus $^
	$(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \
		gcr/gcr-dbus-generated.c > gcr/gcr-dbus-generated.c.tmp && \
	mv gcr/gcr-dbus-generated.c.tmp gcr/gcr-dbus-generated.c

gcr/gcr-dbus-generated.h: gcr/gcr-dbus-generated.c
	$(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \
		gcr/gcr-dbus-generated.h > gcr/gcr-dbus-generated.h.tmp && \
	mv gcr/gcr-dbus-generated.h.tmp gcr/gcr-dbus-generated.h

----8<----8<----8<----

Target "all" depends on gcr/gcr-dbus-generated.h (via BUILT_SOURCES <-
gcr_BUILT_SOURCES).

gcr/gcr-dbus-generated.h is created in the rule for
gcr/gcr-dbus-generated.c, *together* with gcr/gcr-dbus-generated.c.

On my system (x86_64 GNU/Linux, more details on request) both
gcr/gcr-dbus-generated.h and gcr/gcr-dbus-generated.c end up with the
*same creation date*:

    localhost> lls -l --time-style=full-iso gcr-dbus-generated*
    -rw-r--r-- 1 balducci balducci 89903 2014-09-24 13:53:14.000000000 +0200 gcr-dbus-generated.c
    -rw-r--r-- 1 balducci balducci 14809 2014-09-24 13:53:14.000000000 +0200 gcr-dbus-generated.h

Since gcr/gcr-dbus-generated.h depends on gcr/gcr-dbus-generated.c and
the two have exactly the same age, make thinks that
gcr/gcr-dbus-generated.h is up to date and the sed is never
run: hence, the above errors (due to names missing the starting _,
which is supposed to be added by the sed):

make --debug=v:

  [...]
  Successfully remade target file 'gcr/gcr-dbus-generated.c'.
  Considering target file 'gcr/gcr-dbus-generated.h'.
    Pruning file 'gcr/gcr-dbus-generated.c'.
   Finished prerequisites of target file 'gcr/gcr-dbus-generated.h'.
   Prerequisite 'gcr/gcr-dbus-generated.c' is older than target 'gcr/gcr-dbus-generated.h'.
  No need to remake target 'gcr/gcr-dbus-generated.h'.
  [...]


As a matter of fact, moving the sed for gcr/gcr-dbus-generated.h into
the rule for gcr/gcr-dbus-generated.c works around the problem for me:

    diff -c ./Makefile.in.FIX_GCR_DBUS_GENERATED_H_RULE ./Makefile.in
    *** ./Makefile.in.FIX_GCR_DBUS_GENERATED_H_RULE	Wed Sep 24 14:33:40 2014
    --- ./Makefile.in	Wed Sep 24 14:33:40 2014
    ***************
    *** 6314,6319 ****
    --- 6314,6320 ----
            $(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \
                    gcr/gcr-dbus-generated.c > gcr/gcr-dbus-generated.c.tmp && \
            mv gcr/gcr-dbus-generated.c.tmp gcr/gcr-dbus-generated.c
    + 	sed -i -e's|gcr_dbus|_gcr_dbus|g' gcr/gcr-dbus-generated.h

      gcr/gcr-dbus-generated.h: gcr/gcr-dbus-generated.c
            $(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \
Comment 1 Stef Walter 2014-09-24 16:04:16 UTC
(In reply to comment #0)
> As a matter of fact, moving the sed for gcr/gcr-dbus-generated.h into
> the rule for gcr/gcr-dbus-generated.c works around the problem for me:
> 
>     diff -c ./Makefile.in.FIX_GCR_DBUS_GENERATED_H_RULE ./Makefile.in
>     *** ./Makefile.in.FIX_GCR_DBUS_GENERATED_H_RULE    Wed Sep 24 14:33:40 2014
>     --- ./Makefile.in    Wed Sep 24 14:33:40 2014
>     ***************
>     *** 6314,6319 ****
>     --- 6314,6320 ----
>             $(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \
>                     gcr/gcr-dbus-generated.c > gcr/gcr-dbus-generated.c.tmp &&
> \
>             mv gcr/gcr-dbus-generated.c.tmp gcr/gcr-dbus-generated.c
>     +     sed -i -e's|gcr_dbus|_gcr_dbus|g' gcr/gcr-dbus-generated.h
> 
>       gcr/gcr-dbus-generated.h: gcr/gcr-dbus-generated.c
>             $(AM_V_GEN) sed -e 's/gcr_dbus/_gcr_dbus/g' \

Sounds good to me. Would you be able to attach a git patch, check it against 'make distcheck' and I'll merge it. Thanks.

Seems like this came up because the Makefile is now non-recursive and processed in parallel by make.
Comment 2 gabriele balducci 2014-09-24 16:34:49 UTC
errr, apologies: never done that before and being a bit overloaded by
other tasks...

thanks a lot for the prompt reply and thanks for your work
ciao
gabriele
Comment 3 Andreas Henriksson 2014-10-02 08:52:14 UTC
Hello!

I apparently filed a duplicate to this bug. Please see attached patch in bug#737622 for a suggested solution which has been confirmed as solving the problems we saw on Debian.

https://buildd.debian.org/status/package.php?p=gcr&suite=sid
Comment 4 Stef Walter 2014-10-06 06:08:21 UTC

*** This bug has been marked as a duplicate of bug 737622 ***