Skip to content

test1560: set locale/codeset with LC_ALL (was: LANG), test in CI#17938

Closed
vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:t1560-lc-all
Closed

test1560: set locale/codeset with LC_ALL (was: LANG), test in CI#17938
vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:t1560-lc-all

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Jul 15, 2025

To fix running test 1560 when LC_ALL is set to something unexpected
(e.g. C). Also syncing it with the rest of tests.

Also:

  • GHA/linux: enable libidn2 in more jobs.
    Also to enable test 1560 reproducing this issue in more jobs.
  • GHA/linux: run tests with LC_ALL=C in one of the jobs.
  • GHA/linux: switch to the non-deprecated package name for libidn2.
  • GHA/macos: run tests with non-default locale settings in one job.
  • GHA/macos: enable AppleIDN in that job.

Ref: #17933 (comment)
Follow-up to f27262b #10196


@vszakats vszakats added the tests label Jul 15, 2025
@bagder
Copy link
Copy Markdown
Member

bagder commented Jul 15, 2025

#10196 apparently fixed #10193 ...

@github-actions github-actions Bot added the CI Continuous Integration label Jul 15, 2025
@vszakats
Copy link
Copy Markdown
Member Author

vszakats commented Jul 15, 2025

My understanding is that LC_ALL is the "catch all" env that overrides all the rest,
and that's why LANG cannot override it. (Hard to say what was the exact trigger
in the original report. It may have been a LANG=C.)

This issue reproduces in GHA/linux after adding an export LC_ALL=C before running
tests. Only in Alpine, because that's the only two jobs with both LDAP and libidn2 enabled:

https://github.com/curl/curl/actions/runs/16302695675/job/46041044747?pr=17938#step:42:3039
https://github.com/curl/curl/actions/runs/16302695675/job/46041044735?pr=17938#step:42:3032

Once enabling libidn2 in Ubuntu jobs (with LDAP), it reproduces there too:

https://github.com/curl/curl/actions/runs/16303028718/job/46042184742?pr=17938#step:41:3003
https://github.com/curl/curl/actions/runs/16303028718/job/46042184676?pr=17938#step:41:3032
https://github.com/curl/curl/actions/runs/16303028718/job/46042184695?pr=17938#step:41:3258

@testclutch

This comment was marked as resolved.

@vszakats vszakats changed the title test1560: fix to set locale/codeset with LC_ALL test1560: set locale/codeset with LC_ALL Jul 16, 2025
@vszakats vszakats changed the title test1560: set locale/codeset with LC_ALL test1560: set locale/codeset with LC_ALL (was: LANG) Jul 16, 2025
@vszakats vszakats changed the title test1560: set locale/codeset with LC_ALL (was: LANG) test1560: set locale/codeset with LC_ALL (was: LANG), test in CI Jul 21, 2025
@vszakats vszakats closed this in c221c0e Jul 21, 2025
@vszakats vszakats deleted the t1560-lc-all branch July 21, 2025 15:27
vszakats added a commit that referenced this pull request Jul 23, 2025
- runtests: fix `codeset-utf8` feature detection. Before this patch it
  detected if the calling environment had UTF-8 enabled. If not, UTF-8
  tests were all skipped. After this patch, it detects if UTF-8 is
  supported by the calling environment regardless of what's currently
  enabled.
  Follow-up to 0b70b23 #15039

- GHA/linux: sync `codeset-test` to also reset `LC_CTYPE` and
  `LC_NUMBER`. To give it more spin.
  Follow-up to c221c0e #17938

- GHA/macos: fix to actually enable `codeset-test`. Also set `LC_ALL`,
  which seems necessary to trigger issues.
  Follow-up to c221c0e #17938

- tests/data: replace `LC_CTYPE` env with `LC_ALL` in all tests
  requiring a locale. Also to avoid potential issues with a blank or
  unset `LC_ALL`, as seen earlier. And to ensure that the override works
  on all platforms (as tested in CI.)
  Slight downside is that this now resets the language/culture to `C`.
  Ref: b4c9982 #4743
  Ref: 23208e3 #4738

- replace `en_US.UTF-8` with `C.UTF-8` to be language/culture-agnostic.

- TEST-SUITE.md: drop `UTF-8` as a requirement for tests.
  Tests shall work (or least be skipped) without UTF-8 support.

Tests requiring UTF-8 locale:
165, 962, 963, 964, 965, 966, 967, 1448, 1560, 2046, 2047
Tests requiring UTF-8 locale, but passing without one anyway:
955, 956, 957, 958, 959, 960, 961, 968, 1034, 1035

Spec 1997: https://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
Spec 2008: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html

Ref: c221c0e #17938
Ref: 7cf8414
Ref: 4c140a5
Ref: 28faaac #2436
Ref: ecd1d02

Closes #17988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration tests

Development

Successfully merging this pull request may close these issues.

3 participants