Your message dated Tue, 16 Aug 2022 10:56:23 +0100
with message-id <[email protected]>
and subject line Re: Bug#912559: /usr/share/meson/debcrossgen: Please add a way
to set package-specific cross properties
has caused the Debian Bug report #912559,
regarding /usr/share/meson/debcrossgen: Please add a way to set
package-specific cross properties
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
912559: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912559
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: meson
Version: 0.48.1-1
Severity: wishlist
File: /usr/share/meson/debcrossgen
Some Meson-built packages need to set custom properties. For example, GLib
(which is built with Meson in experimental) has a bundled copy of GNUlib
printf. During native compilation, its Meson build system automatically
detects whether the system (v)(sn)printf is POSIX- and ISO-compliant, and
uses the bundled GNUlib printf if not; but during cross compilation, it
cannot rely on being able to run test programs, so it defaults to using the
bundled GNUlib printf. We know that glibc printf is suitable for GLib, so
we want to set the cross properties that say "use the system printf".
For now, I have prototyped this for GLib by including this patched
debcrossgen in its debian/ directory:
----------------- 8< --------------------------------------------------
--- /usr/share/meson/debcrossgen 2018-10-17 16:57:16.000000000 +0100
+++ debian/debcrossgen 2018-11-01 10:49:46.324456237 +0000
@@ -32,6 +32,8 @@
help='A particular gcc version suffix if necessary.')
parser.add_argument('-o', required=True, dest='outfile',
help='The output file.')
+parser.add_argument('--set', action='append', default=[],
+ help='Set a cross property.')
def locate_path(program):
if os.path.isabs(program):
@@ -75,6 +77,10 @@
except ValueError:
pass # pkg-config is optional
ofile.write('\n[properties]\n')
+ for prop in options.set:
+ assert '=' in prop
+ key, value = prop.split('=', 1)
+ ofile.write('%s = %s\n' % (key, value))
ofile.write('\n[host_machine]\n')
ofile.write("system = '%s'\n" % host_os)
ofile.write("cpu_family = '%s'\n" % host_cpu_family)
----------------- 8< --------------------------------------------------
and invoking it in debian/rules:
----------------- 8< --------------------------------------------------
ifneq ($(filter hppa,$(DEB_HOST_ARCH_CPU)),)
stack_grows_up = true
else
stack_grows_up = false
endif
export DH_MESON_CROSS_FILE = debian/cross.txt
override_dh_auto_configure:
ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
debian/debcrossgen \
--set have_c99_snprintf=true \
--set have_c99_vsnprintf=true \
--set have_strlcpy=false \
--set have_unix98_printf=true \
--set growing_stack=$(stack_grows_up) \
-o debian/cross.txt
endif
dh_auto_configure \
...
----------------- 8< --------------------------------------------------
but I would prefer it if there was a more official way to do this with
Meson and debhelper.
Perhaps dh_auto_configure could even take a repeatable
--set-cross-property argument?
Thanks,
smcv
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'buildd-unstable'), (500,
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental-debug'), (1,
'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32
Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages meson depends on:
ii ninja-build 1.8.2-1
ii python3 3.6.7-1
ii python3-pkg-resources 40.4.3-1
meson recommends no packages.
meson suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Version: 0.52.0-1
On Thu, 01 Nov 2018 at 11:09:07 +0000, Simon McVittie wrote:
> Some Meson-built packages need to set custom properties. For example, GLib
> (which is built with Meson in experimental) has a bundled copy of GNUlib
> printf. During native compilation, its Meson build system automatically
> detects whether the system (v)(sn)printf is POSIX- and ISO-compliant, and
> uses the bundled GNUlib printf if not; but during cross compilation, it
> cannot rely on being able to run test programs, so it defaults to using the
> bundled GNUlib printf. We know that glibc printf is suitable for GLib, so
> we want to set the cross properties that say "use the system printf".
...
> I would prefer it if there was a more official way to do this with
> Meson and debhelper.
Now that Meson supports multiple cross-files (which it didn't when I opened
this bug), I think a better way to achieve this is for the package that
needs special cross-properties to ship or generate a partial cross-file
in debian/, and pass it to Meson via something like
dh_auto_configure ... -- ...
--cross-file=$(CURDIR)/debian/meson/cross-properties.ini
This ends up on the meson command-line after the cross-file generated by
debhelper/debcrossgen, doesn't need any special support from within Meson,
and the package will still use the cross-tools from debcrossgen.
A real-world example of this:
https://salsa.debian.org/gnome-team/glib/-/commit/dd8ed413fcb712ba89b2f3bd3db3bc7421904328
(which also demonstrates dealing with some cross-properties that are
the same for all Debian architectures, and another cross-property that
is different on hppa).
smcv
--- End Message ---