Fix toolchain detection localization issues on GNU systems#163
Fix toolchain detection localization issues on GNU systems#163adacore-bot merged 1 commit intoAdaCore:masterfrom
Conversation
|
Hello @delta-lima7, thank you for your valuable contribution! Could you move it to https://github.com/AdaCore/gpr, more precisely here: https://github.com/AdaCore/gpr/blob/474cf73b627ac77c43961bf62e8289f96b727f31/src/lib/gpr2-kb.adb#L1733 ? Gprbuild's knowledge base is not used anymore, it has been replaced by the gpr2's version. In your PR, could you also restore the environment variable when the command fails to spawn, in the exception handler ? Thanks! |
|
Hello Jicquel, sure, but just to check – are changes in libgpr2 propagated to this repository? Because it seems to me most distributions (I checked at least Debian, Ubuntu, Fedora) use this repository to package gprbuild, -config, -ls, etc. Paul |
|
No, the changes are not propagated to this repository. Two PR can be opened in that case, they should be almost identical. Thank you for your insight :) |
Compilers like GCC provide localized messages when the system is configured with a non-english locale. This change sets the LC_MESSAGES variable to `C` so that always the default version info is used for searching in the knowledge base.
Compilers like GCC provide localized messages when the system is configured with a non-english locale. This change sets the LC_MESSAGES variable to `C` so that always the default version info is used for searching in the knowledge base. (Applies AdaCore/gprbuild#163)
Compilers like GCC provide localized messages when the system is configured with a non-english locale. This change sets the LC_MESSAGES variable to `C` so that always the default version info is used for searching in the knowledge base. (Applies AdaCore/gprbuild#163)
Compilers like GCC provide localized messages when the system is configured with a non-english locale. This change sets the LC_MESSAGES variable to `C` so that always the default version info is used for searching in the knowledge base. (Applies AdaCore/gprbuild#163)
Compilers like GCC provide localized messages when the system is configured with a non-english locale. This change sets the LC_MESSAGES variable to `C` so that always the default version info is used for searching in the knowledge base. (Applies AdaCore/gprbuild#163) Issue: eng/gpr/gpr-issues#813 Github PR: #19 Merge request eng/gpr/gpr!806 from branch 'mr/jicquel/gpr-issues#813' into 'main'
Greetings,
GCC provides localized version output with different formatting depending on the system locale. This behaviour breaks gprconfig on all GNU/Linux distributions on which GCC is compiled with gettext support when using a non-english locale.
In my case,
gcc -vyieldsgcc-Version 15.2.1 20260209 (GCC), whereas the non-localized output should begcc version 15.2.1 20260209 (GCC)(note the '-').There have been attempts to add/change regexes in gprconfig_kb and AFAIK some distribution maintainers have created patches for the XML files, but rather than adding various bits and pieces to the knowledge base I think it makes more sense to generate a uniform version output in the first place. This would obviously accommodate for future changes in the gettext output as well.
This changeset defines the LC_MESSAGES variable to
Cbefore generating the version output and resets it afterwards, so that always the default version info is used for searching in the knowledge base.