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 669224 - Cross-compilation broken by data-to-c
Cross-compilation broken by data-to-c
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 669235 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-02-02 06:56 UTC by Thierry Reding
Modified: 2012-02-02 15:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio: Fix cross-compilation. (3.49 KB, patch)
2012-02-02 09:09 UTC, Thierry Reding
none Details | Review
The perl version of data-to-c (4.58 KB, patch)
2012-02-02 12:25 UTC, Kalev Lember
reviewed Details | Review

Description Thierry Reding 2012-02-02 06:56:49 UTC
The new data-to-c helper introduced in commit 968f4e8 breaks cross-compilation
because it is built for the host system instead of the build system.
Comment 1 Thierry Reding 2012-02-02 09:09:20 UTC
Created attachment 206605 [details] [review]
gio: Fix cross-compilation.

This commit replaces the data-to-c helper by an equivalent awk script
that can be properly run in a cross-compilation setup.
Comment 2 Alexander Larsson 2012-02-02 12:18:01 UTC
*** Bug 669235 has been marked as a duplicate of this bug. ***
Comment 3 Alexander Larsson 2012-02-02 12:19:47 UTC
perl version in bug 669235, not sure which is best. We already have a perl dependency for glib-mkenums which is used in the build. Some Makefile rules seem to use awk, but I don't think its currently hit on make/make install.
Comment 4 Alexander Larsson 2012-02-02 12:20:59 UTC
Configure has:
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
     test -n "$PERL" && \
     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
     test -n "$AWK" ; then
  REBUILD=
fi

Which seem to imply that both perl and awk are required for a rebuild, but i'm not sure exactly where awk is used.
Comment 5 Kalev Lember 2012-02-02 12:25:03 UTC
Created attachment 206622 [details] [review]
The perl version of data-to-c
Comment 6 Colin Walters 2012-02-02 14:34:12 UTC
Review of attachment 206622 [details] [review]:

Two minor comments.

::: gio/Makefile.am
@@ +664,3 @@
 
+gconstructor_as_data.h: $(top_srcdir)/glib/gconstructor.h data-to-c.pl
+	$(AM_V_GEN) $(srcdir)/data-to-c.pl $(top_srcdir)/glib/gconstructor.h gconstructor_code > $@

Since you're changing this build rule, please make it atomic, i.e.:

> $@.tmp && mv $@.tmp $@

::: gio/data-to-c.pl
@@ +1,1 @@
+#!/usr/bin/perl

Kind of unhappy about adding more Perl...I'd like to make a slow transition to Python for build scripts.  But this script is tiny.
Comment 7 Alexander Larsson 2012-02-02 14:45:03 UTC
colin: What about the awk version then?
Comment 8 Colin Walters 2012-02-02 15:14:28 UTC
(In reply to comment #7)
> colin: What about the awk version then?

It's not a big deal...getting perl out of the -devel image is a long term, low priority background task.  I was just mentioning it.

So it's up to Kalev or whoever is writing code.
Comment 9 Kalev Lember 2012-02-02 15:21:28 UTC
(In reply to comment #6)
> ::: gio/data-to-c.pl
> @@ +1,1 @@
> +#!/usr/bin/perl
> 
> Kind of unhappy about adding more Perl...I'd like to make a slow transition to
> Python for build scripts.  But this script is tiny.

For what it's worth, I originally converted it to Python, but after yesterday's IRC discussion reimplemented it in perl. So if you prefer Python, it's easily doable.

Apparently glib currently only needs Python for building the tests (gdbus-codegen has a runtime dep on python, not build time), and the tiny data-to-c.py  would have introduced a new build time dep.
Comment 10 Alexander Larsson 2012-02-02 15:24:36 UTC
pushed the perl version with the atomic fix