On Tue, 2023-12-12 at 18:56 -0800, Noah Misch wrote:
> > Yea. I wonder if the better fix would have been to copy
> > setenv("LC_MESSAGES", "C", 1);
> > to the initdb template creation. That afaict also fixes the issue,
> > with a
> > smaller blast radius?
> 
> +1, that would restore the testing semantics known from v16-.  I
> think the
> intent of the template was to optimize without changing semantics,
> and the
> above proposal aligns with that.  Currently, for v17 alone, one needs
> installcheck or build file hacks to reproduce a locale-specific test
> failure.

Attached.

I just changed --no-locale to --lc-messages=C, which I think solves it
in the right place with minimal blast radius. Andres, did you literally
mean C setenv() somewhere, or is this what you had in mind?

I also noticed that collate.linux.utf8.sql seems to be skipped on my
machine because of the "version() !~ 'linux-gnu'" check, even though
I'm running Ubuntu. Is that test getting run often enough?

And relatedly, is it worth thinking about extending pg_regress to
report skipped tests so it's easier to find these kinds of problems?

Regards,
        Jeff Davis

From 3ffcf3e25bd2b16114775409404ee492e283584f Mon Sep 17 00:00:00 2001
From: Jeff Davis <j...@j-davis.com>
Date: Tue, 19 Dec 2023 22:34:52 -0800
Subject: [PATCH v1] Initialize data directories with --lc-messages=C for
 tests.

Commit db6d9891e8 changed them to be initialized with --no-locale, but
that reduced the test coverage for non-C locales.

Discussion: https://postgr.es/m/0d47e5ecc037b3908149aad5f2a987793cf938bd.camel%40j-davis.com
---
 meson.build            | 2 +-
 src/Makefile.global.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index f816283301..f786850840 100644
--- a/meson.build
+++ b/meson.build
@@ -3115,7 +3115,7 @@ sys.exit(sp.returncode)
 ''',
        test_initdb_template,
        temp_install_bindir / 'initdb',
-       '--auth', 'trust', '--no-sync', '--no-instructions', '--no-locale',
+       '--auth', 'trust', '--no-sync', '--no-instructions', '--lc-messages=C',
        '--no-clean'
      ],
      priority: setup_tests_priority - 1,
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 104e5de0fe..f8e461cbad 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -423,7 +423,7 @@ ifeq ($(MAKELEVEL),0)
 	$(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1
 	$(MAKE) -j1 $(if $(CHECKPREP_TOP),-C $(CHECKPREP_TOP),) checkprep >>'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1
 
-	$(with_temp_install) initdb --auth trust --no-sync --no-instructions --no-locale --no-clean '$(abs_top_builddir)'/tmp_install/initdb-template >>'$(abs_top_builddir)'/tmp_install/log/initdb-template.log 2>&1
+	$(with_temp_install) initdb --auth trust --no-sync --no-instructions --lc-messages=C --no-clean '$(abs_top_builddir)'/tmp_install/initdb-template >>'$(abs_top_builddir)'/tmp_install/log/initdb-template.log 2>&1
 endif
 endif
 endif
-- 
2.34.1

Reply via email to