• How to force build to use LANG=C.UTF-8?

    From Soren Stoutner@21:1/5 to Debian Mentors on Thu Apr 10 16:51:30 2025
    The Redmine package includes a test run at build time that checks for
    a list of particular response values. The problem is that these
    values are translated. Running the build in a different language
    causes the test to fail.

    Failure: ProjectAdminQueryTest#test_project_statuses_values_should_return_all_statuses [test/unit/project_admin_query_test.rb:99]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -[["active", "1"], ["closed", "5"], ["archived", "9"], ["scheduled for deletion", "10"]]
    +[["actif", "1"], ["fermé", "5"], ["archivé", "9"], ["planifié pour suppression", “10”]]

    https://tests.reproducible-builds.org/debian/rb-pkg/trixie/arm64/
    redmine.html

    Setting "export LANG=C.UTF-8” does not prevent this test from running
    in a foreign language.

    https://salsa.debian.org/ruby-team/redmine/-/jobs/7360518#L3871

    This causes periodic failures during Salsa-CI’s build and in
    reproducible builds.

    Does anyone know of a way to force the build to always be in C.UTF-8?

    --
    Soren Stoutner
    soren@debian.org
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmf4WYIACgkQwufLJ66w tgOzhA//a6Mg5gOeEGAMZAtOoxWK2WM3yH4HkLwunG7fI93iwh6CqLeOjwKWjTw4 jG4PiUQ/O1EJq1fdOE1OGQJfNX3Yn38k7s8GJnX9Ly1o5LrKR6W7ZpocHGq0ob3b U81dp+9hAAZQtv3USRwUbXWOaEzQmyGRZK4THkaWpsNS9sq+8G52zTgVpGMdUOd6 3U+WFAGg2KgipvQJ0FvSDM+kvVtAEtDXG687lHBG1KX5
  • From Jeremy Sowden@21:1/5 to Bo YU on Fri Apr 11 20:30:01 2025
    On 2025-04-11, at 09:56:28 +0800, Bo YU wrote:
    On Fri, Apr 11, 2025 at 7:52 AM Soren Stoutner wrote:
    The Redmine package includes a test run at build time that checks for
    a list of particular response values. The problem is that these
    values are translated. Running the build in a different language
    causes the test to fail.

    Failure: ProjectAdminQueryTest#test_project_statuses_values_should_return_all_statuses
    [test/unit/project_admin_query_test.rb:99]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -[["active", "1"], ["closed", "5"], ["archived", "9"], ["scheduled for deletion", "10"]]
    +[["actif", "1"], ["fermé", "5"], ["archivé", "9"], ["planifié pour suppression", “10”]]

    https://tests.reproducible-builds.org/debian/rb-pkg/trixie/arm64/redmine.html

    Setting "export LANG=C.UTF-8” does not prevent this test from running
    in a foreign language.

    https://salsa.debian.org/ruby-team/redmine/-/jobs/7360518#L3871

    I remember there was a fix[0] for this problem. In other words, this
    variable needs to be passed when calling test. Hope this helps.

    [0]: https://salsa.debian.org/debian-mate-team/onboard/-/blob/master/debian/rules?ref_type=heads#L45

    I've did something similar for magit:

    https://salsa.debian.org/emacsen-team/magit/-/commit/2371b4f9cd51742c196400d14b95aebc75859791

    However, I don't _think_ the solution here is to set "LANG" (or
    "LC_ALL"). I would expect exporting "LANG=C.UTF-8" to work, if it were.
    I just tried to reproduce the test failure by explicitly setting "LC_ALL=it_IT.UTF-8" and was unable to do so.

    I am not familiar with Ruby and how it does i18n, but based on a quick
    bit of research, I _suspect_ that there may be a concurrency bug in the test-suite. The tests are run in a non-deterministic order and some of
    them change the locale. Therefore, I think what is happening is that a
    test runs before the failing one which changes the locale (to "pt" or
    "fr", for example) causing the test to fail. The failing test is:

    def test_project_statuses_values_should_return_all_statuses
    q = ProjectAdminQuery.new
    assert_equal [
    ["active", "1"],
    ["closed", "5"],
    ["archived", "9"],
    ["scheduled for deletion", "10"]
    ], q.project_statuses_values
    end

    Compare this to a similar test in the same file:

    def test_project_statuses_filter_should_return_project_statuses
    set_language_if_valid 'en'
    query = ProjectAdminQuery.new(:name => '_')
    query.filters = {'status' => {:operator => '=', :values => []}}
    values = query.available_filters['status'][:values]
    assert_equal ['active', 'closed', 'archived', 'scheduled for deletion'], values.map(&:first)
    assert_equal ['1', '5', '9', '10'], values.map(&:second)
    end

    In the latter test, the locale is explicitly set to "en". I think this
    should be done in the former test too.

    J.

    -----BEGIN PGP SIGNATURE-----

    wsG7BAABCgBvBYJn+V30CRAphqwKvfEEDUcUAAAAAAAeACBzYWx0QG5vdGF0aW9u cy5zZXF1b2lhLXBncC5vcmcXkV1Zg/artFbVvWs24qW3NwkHXb3S4T0j0oaYE0yv sRYhBGwdtFNj70A3vVbVFymGrAq98QQNAACVmw/+NKZpO9Ay2v7Jq8xqVUzxGOf1 bZ5zwIgbY+sP7AY6AiC1CnSKmSR2txjY1Upn23kAWrLafhgCrBxRmpMp87++HKJb MdJoD9wO97uV06YDZ1U4qlr4EV16tCS+Fn9Uq0ZbHvtTSXDQtfDHU6xW4cOLuUwY 1hAFHcSjMFUX8uTtYAIvYZLYdG6KPZdXTV49TtfjxAjwzfV9mnkQeZQviQ3WJfj2 tqdrE2Do9ISBjrWj1fIum0WKWoCR902a+1yW+QVDPZH0QxLydxDNU/3jJT1JkvDb qS4m//C+Gzf8riZWMXUdGd1LiE7H74AQbGxmr3ZsUqW4Z9Wd1b7kWnz89VIp9cDZ nmo/52dMq78mbuj3m0xGutpIVo2gR9e5Xd2hlkU6M4/mVBTKqt6MFchI/5oIDP5T zHARi4EAoOw7BnDKup789oJkDN/X8Ng/Qbm/pScaN5kTgwm//oZ5cLLUXoCjAE3C HN5u+cgYGzp0yCiQPfN0y49WG6lPqaRDJAmTMG+jNmDzFyZBJp1ZzEeCsCSYTc+U cNKFix9c+H4X1owm2b/fsu8YnzByZv1xVLWP56st5Ah3axrKrc5ZWP9XlSOeJu+j /B3vHpA4Klw8jATsGREqBmLZCIIYIHxvCJoDqvZCT1+1Jzt7QCFXpy8wnYl5lAWn S9Q7fwdEphPdYdXHo8w=
    =INee
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Soren Stoutner@21:1/5 to Debian Mentors on Fri Apr 11 15:44:04 2025
    Jeremy,

    Thanks for taking the time to dig into this so deeply. I really
    appreciate it.

    On Friday, April 11, 2025 11:23:06 AM Mountain Standard Time Jeremy
    Sowden wrote:
    I am not familiar with Ruby and how it does i18n, but based on a
    quick bit of research, I _suspect_ that there may be a concurrency
    bug in the test-suite.

    I am also not that familiar with Ruby. I have just recently come to maintaining the Redmine package, which will probably end up with me
    learning a bit of Ruby, which I have no previous experience with.

    The tests are run in a non-deterministic
    order and some of them change the locale. Therefore, I think what
    is happening is that a test runs before the failing one which
    changes the locale (to "pt" or "fr", for example) causing the test
    to fail. The failing test is:

    def test_project_statuses_values_should_return_all_statuses
    q = ProjectAdminQuery.new
    assert_equal [
    ["active", "1"],
    ["closed", "5"],
    ["archived", "9"],
    ["scheduled for deletion", "10"]
    ], q.project_statuses_values
    end

    Compare this to a similar test in the same file:

    def test_project_statuses_filter_should_return_project_statuses
    set_language_if_valid 'en'
    query = ProjectAdminQuery.new(:name => '_')
    query.filters = {'status' => {:operator => '=', :values => []}}
    values = query.available_filters['status'][:values]
    assert_equal ['active', 'closed', 'archived', 'scheduled for
    deletion'], values.map(&:first) assert_equal ['1', '5', '9', '10'], values.map(&:second) end

    Thanks for catching this. I had not noticed that other tests were
    explicitly setting the language.

    In the latter test, the locale is explicitly set to "en". I think
    this should be done in the former test too.

    https://salsa.debian.org/ruby-team/redmine/-/blob/master/debian/ patches/run-some-tests-in-English.patch?ref_type=heads

    https://www.redmine.org/issues/42570

    --
    Soren Stoutner
    soren@debian.org
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmf5mzQACgkQwufLJ66w tgMq7w//dDVAThc10mHXaFU1thzf3Sc0lsQk9phCSrzQ/r/AGXyfFHQcHrFLJcWv kG1sS2zq51vOzDEmPrFJwVi4EVGR2f+svzhkJ0McSfAzKpnA06j25lrQftrIFvTX 8sU6Kb5KKc4usSXaW0CxuC1kYfu6DSBrIYliXE6KdyBnYbvQQLknaoRsyy/TgAFR f2KwWHaeHDdPTI3UwD7C7XLyXK3n8E3f1RiJMi4vogBgyQIb5GgKEPmmzLMtAHy6 /2AHeFi2EsuoYxwDTvcSsHMR81ZGCRWld/9q34qyr2slIuecsMk9TCNGqvKy8dkq kBHpWp/gBrj0NyvHuwW0EojNiiWPhh4rbQVumm3GjL/WuYaYcXt2I4tX5uaASrmy ivMEQg+3RCVb2LXddmrhtYQbF+SWED8qtgP+jvbZhNqTUHsFEMAnQboJElB0sA2t 4X652aer2J0s4utgeJVF+pilY9HaHkZf4W0+/Z8sZYRrofKYt2Xd+sb1G1xzilYt HS7LRbP/2O6f7EJLMbIZJ2AAagia7HSAh8dI8l9vO7QCcd8U4019b6PPdT9PoOJv Ba0o0129ZxdUqcAm5/NfvRWJrxnDUR9WVWD4deOvDljdEmTSUctuIH4d2brxoCJo xf6hQrnBUHthnZ4JVHGUgvVNlfmSSq0m66sfJ9Cj58ulGCAdFkA=
    =6v+D
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter B@21:1/5 to All on Sun Apr 20 15:50:01 2025
    Hi Soren,

    I found using
       export LC_ALL = C.UTF-8

    helped with reproducible builds.
    Setting LANG alone seems not sufficient.


    Cheers,
    Peter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)