Bug#851154: tracker: some build-time tests abort on the buildds because LANG is unset

2017-07-23 Thread Simon McVittie
On Sat, 22 Jul 2017 at 23:50:59 +0200, Michael Biebl wrote:
> Do we need to set both LANG and LC_ALL or would just LC_ALL be
> sufficient? I thought LANG is simply a fallback if LC_ALL is not set,
> but I might be misremembering

What happens in glibc is this pseudocode:

if LC_ALL is set:
use LC_ALL
else if LC_MESSAGES or LC_TIME (or whatever is most relevant) is set:
use that
else if LANG is set:
use LANG
else
use "C"

It's less that LANG is a fallback, and more that LC_ALL is an override.
LC_ALL is meant to be the big hammer that gets used by things like
automated tests and reproducible builds to force a predictable locale;
users are meant to set LANG, unless they want to override individual
locale bits (like "en_US but with metric measurements", which is
LANG=en_US.UTF-8 LC_MEASUREMENT=fr_FR.UTF-8 or similar).

But src/libtracker-common/tracker-locale.c has some code that
specifically checks/sets LANG, and ignores LC_* (which is potentially
a bug but not really the relevant one here), so I set both in the patch.

> That said, I think we might consider setting a defined locale for the
> complete build and not just the make check run.

The only down side of that is that developers who have asked for a
non-English locale will be getting English compiler diagnostics.
If you're OK with that, then "export LC_ALL=C.UTF-8",
"export LANG=C.UTF-8" are a suitably big hammer.

S



Bug#851154: tracker: some build-time tests abort on the buildds because LANG is unset

2017-07-22 Thread Michael Biebl
Hi Simon

On Thu, 12 Jan 2017 13:56:45 + Simon McVittie  wrote:
> Package: tracker
> Version: 1.10.3-1
> Severity: normal
> Tags: patch
> 
> Severity is only normal, because build-time test failures are ignored anyway.
> 
> https://buildd.debian.org/status/fetch.php?pkg=tracker=amd64=1.10.3-1=1481904109
> 
> ERROR: tracker-file-utils
> =
> 
> (/«PKGBUILDDIR»/tests/libtracker-common/.libs/tracker-file-utils:24952): 
> Tracker-WARNING **: Locale '0' is not set, defaulting to C locale
> Trace/breakpoint trap
> # random seed: R02Sa200f27dace845437f8756e1936d2a7c
> # Tracker-FATAL-WARNING: Locale '0' is not set, defaulting to C locale

Do we need to set both LANG and LC_ALL or would just LC_ALL be
sufficient? I thought LANG is simply a fallback if LC_ALL is not set,
but I might be misremembering

That said, I think we might consider setting a defined locale for the
complete build and not just the make check run.

WDYT?

Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#851154: tracker: some build-time tests abort on the buildds because LANG is unset

2017-01-19 Thread Michael Biebl
Hi Simon

On Thu, 12 Jan 2017 13:56:45 + Simon McVittie  wrote:
> (/«PKGBUILDDIR»/tests/libtracker-common/.libs/tracker-utils:24976): 
> Tracker-WARNING **: Locale '0' is not set, defaulting to C locale
> Trace/breakpoint trap
> # random seed: R02S364c1082a24c4a4014f52f4a3407ecad
> # Tracker-FATAL-WARNING: Locale '0' is not set, defaulting to C locale
> ERROR: tracker-utils - missing test plan
> ERROR: tracker-utils - exited with status 133 (terminated by signal 5?)
> 
> The attached patch is not enough to make the build-time tests *pass*, but
> they at least get a bit further before failing.

Isn't this something which should be handled by the upstream test suite?

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#851154: tracker: some build-time tests abort on the buildds because LANG is unset

2017-01-12 Thread Simon McVittie
Package: tracker
Version: 1.10.3-1
Severity: normal
Tags: patch

Severity is only normal, because build-time test failures are ignored anyway.

https://buildd.debian.org/status/fetch.php?pkg=tracker=amd64=1.10.3-1=1481904109

ERROR: tracker-file-utils
=

(/«PKGBUILDDIR»/tests/libtracker-common/.libs/tracker-file-utils:24952): 
Tracker-WARNING **: Locale '0' is not set, defaulting to C locale
Trace/breakpoint trap
# random seed: R02Sa200f27dace845437f8756e1936d2a7c
# Tracker-FATAL-WARNING: Locale '0' is not set, defaulting to C locale
ERROR: tracker-file-utils - missing test plan
ERROR: tracker-file-utils - exited with status 133 (terminated by signal 5?)

ERROR: tracker-utils


(/«PKGBUILDDIR»/tests/libtracker-common/.libs/tracker-utils:24976): 
Tracker-WARNING **: Locale '0' is not set, defaulting to C locale
Trace/breakpoint trap
# random seed: R02S364c1082a24c4a4014f52f4a3407ecad
# Tracker-FATAL-WARNING: Locale '0' is not set, defaulting to C locale
ERROR: tracker-utils - missing test plan
ERROR: tracker-utils - exited with status 133 (terminated by signal 5?)

The attached patch is not enough to make the build-time tests *pass*, but
they at least get a bit further before failing.

S
>From 3af40b00567ef58b3c4cc98533d9302edc0410b7 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Thu, 12 Jan 2017 12:58:46 +
Subject: [PATCH 4/4] d/rules: ensure that a valid locale is set for the unit
 tests

---
 debian/changelog | 1 +
 debian/rules | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 5dc1f9047..93690bfe2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ tracker (1.10.3-1.1) UNRELEASED; urgency=medium
   * Add patches from upstream to make the sandbox allow more harmless
 syscalls (Closes: #848842, #849936, LP: #1649035, LP: #1649004)
   * Don't immediately restart tracker-extract on SIGSYS. Mitigates: #851148
+  * d/rules: ensure that a valid locale is set for the unit tests
 
  -- Simon McVittie   Thu, 12 Jan 2017 12:11:44 +
 
diff --git a/debian/rules b/debian/rules
index bfc6ea239..6daa5ca7d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -75,5 +75,5 @@ override_dh_strip:
 
 override_dh_auto_test:
 ifeq (, $(filter nocheck, $(DEB_BUILD_OPTIONS)))
-	dbus-run-session -- $(MAKE) check -k VERBOSE=1 || true
+	LANG=C.UTF-8 LC_ALL=C.UTF-8 dbus-run-session -- $(MAKE) check -k VERBOSE=1 || true
 endif
-- 
2.11.0