[Git][haskell-team/haskell-devscripts][master] Run package registration with a UTF-8 locale

Scott Talbert (@swt2c) gitlab at salsa.debian.org
Tue Aug 2 15:26:48 BST 2022



Scott Talbert pushed to branch master at Debian Haskell Group / haskell-devscripts


Commits:
c4fdf2de by Scott Talbert at 2022-08-02T10:22:42-04:00
Run package registration with a UTF-8 locale

This used to happen in Dh_Haskell.sh before the Perl port.  This should fix
a large number of packages being reported as FTBFS on the reproducible
status.

- - - - -


3 changed files:

- debian/changelog
- dh_haskell_install_ghc_registration
- lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+haskell-devscripts (0.16.26) unstable; urgency=medium
+
+  * Run package registration with a UTF-8 locale (Closes: #1012568)
+
+ -- Scott Talbert <swt at techie.net>  Tue, 02 Aug 2022 10:21:17 -0400
+
 haskell-devscripts (0.16.25) unstable; urgency=medium
 
   * Use doit() in build & check recipes to show progress


=====================================
dh_haskell_install_ghc_registration
=====================================
@@ -21,6 +21,7 @@ use v5.20;
 use warnings;
 use utf8;
 
+use File::Temp;
 use Unicode::UTF8 qw(encode_utf8);
 
 use Debian::Debhelper::Buildsystem::Haskell::Recipes qw(
@@ -40,9 +41,16 @@ for my $installable (@{ $dh{DOPACKAGES} }) {
     my $compiler = installable_hc($installable) || $ENV{DEB_DEFAULT_COMPILER};
     my $pkgdir = hc_pkgdir($compiler);
 
-    my $output = run($ENV{DEB_SETUP_BIN_NAME},
+    my $tmp = File::Temp->new();
+    my %options = (
+        stdout => $tmp->filename,
+        update_env => { LC_ALL => 'C.UTF-8'},
+    );
+    doit(\%options, $ENV{DEB_SETUP_BIN_NAME},
         'register', "--builddir=dist-$compiler",
         qw{--gen-pkg-config --verbose=verbose+nowrap});
+    my $output = do { local $/; <$tmp> };
+    say $output if !$ENV{DH_QUIET};
 
     if ($output
         =~ m{^Creating \s package \s registration \s (file|directory): \s+ (\S+) $}mx) {


=====================================
lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm
=====================================
@@ -57,6 +57,7 @@ use Carp qw(croak);
 use Const::Fast;
 use Date::Parse qw(str2time);
 use Debian::Debhelper::Dh_Lib qw(doit);
+use File::Temp;
 use IPC::Run3;
 use List::SomeUtils qw(uniq any first_value);
 use Path::Tiny;
@@ -363,9 +364,16 @@ sub own_cabal_prerequisites {
     croak encode_utf8('No Setup.hs executable named.')
       unless length $ENV{DEB_SETUP_BIN_NAME};
 
-    my $output = run($ENV{DEB_SETUP_BIN_NAME},
+    my $tmp = File::Temp->new();
+    my %options = (
+        stdout => $tmp->filename,
+        update_env => { LC_ALL => 'C.UTF-8'},
+    );
+    doit(\%options, $ENV{DEB_SETUP_BIN_NAME},
         'register', "--builddir=dist-$compiler",
         qw{--gen-pkg-config --verbose=verbose+nowrap});
+    my $output = do { local $/; <$tmp> };
+    say $output if !$ENV{DH_QUIET};
 
     my @hashed_ids;
     if ($output



View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/commit/c4fdf2de4256508b3c76860bac3724db18eebd4f

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/commit/c4fdf2de4256508b3c76860bac3724db18eebd4f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20220802/489339bf/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list