mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 14:11:39 +00:00
common: drop locale setting hack #36524
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36524
Loading…
Reference in a new issue
No description provided.
Delete branch "drop_locale_hacks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This was added to work around
boost::filesystemthrowing when the environments locale was invalid. Boost.Filesystem has been removed, andstd::filesystemdoesn't use the locale on POSIX (and bitcoind never callssetlocale).Qt calls
setlocale(LC_ALL, "")on startup, and falls back toC.UTF-8if the locale isn'tUTF-8.Alternative to #36399, which extends the hack further.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Base:
cce32b16874e85e8a00cfa1a2190f0b6f4dcaf66Head:
43bb5e3c467f38566f7d7271b0030ef4af1cf78cI found no actionable issues in this static review.
Full review report
Can you add a reference/source to this claim?
github.com/qt/qtbase@37a9bf670e/src/corelib/kernel/qcoreapplication.cpp (L571-L639)We also claim this in:
github.com/bitcoin/bitcoin@60ebd98c79/src/qt/bitcoin.cpp (L203)lgtm ACK
622df9e941ACK
622df9e941Doesn’t this change affect the behaviour of the scripts specified via the
-*notifyoptions in environments where the locale is invalid?Yes, that is also what Ralph says (#36524) , but I think users are better off not setting an invalid locale. If they really want to set an invalid locale, they are better off setting the locale in their notify script explicitly. (Explicitly setting it works before and after the changes here)
Concept ACK
This surfaces an already buggy test, that now fails on some local environments, see comment.
This surfaces a bug in
interface_gui.py, that passes onmasterbut fails on622df9e941.On CI, we set
LC_ALL=C.UTF-8in all scripts, so the locale is set in all tests, which means that we're not really testing this change.When running this test locally on a Linux environment with
LC_ALLunset and nonl_NL.UTF-8locale installed, theinterface_gui.pytest fails. This is because intest_node.py:302, we setsubp_env.setdefault("LC_ALL", "nl_NL.UTF-8"). On CI, this operation is a no-op becauseLC_ALLis always set, so thenl_NL.UTF-8locale is never actually set. When it is actually set, andnl_NL.UTF-8isn't installed on the machine, the test fails.Tested in a
debian:trixiecontainer:The test runs fine with
LC_ALL=C.UTF-8 python3 build/test/functional/interface_gui.py.From #35551, it seems like we set a well-translated language to ensure that in a foreign locale, RPC strings still come through in English. If that's what we want to achieve, then perhaps we could e.g. add
github.com/stickies-v/bitcoin@a39fa5420eas a minimal fix prior to this change?Could you make a specific comment, instead of a vague LLM generated one?
I'm not completely sure what the expectations are with this test, but I've cherry-picked your commit here.
Only change is a gui test fixup.
review ACK
27be7413e8🚇Show signature
Signature:
I mean if people feel strongly, there could be a release note along the lines:
The UTF-8 fallback for invalid or unavailable environment locales has been removed. Affected -*notify scripts may explicitly set a valid locale, such as LC_ALL=C.UTF-8, if needed.From https://github.com/bitcoin/bitcoin/pull/35551#discussion_r3433473219:
ACK
27be7413e8I actually think that would be good. Shouldn't affect many people, but probably some, and having a mention in the release notes may save them a lot of confusion. Your proposed text works well for me.
Added a release note.
review ACK
43bb5e3c46🚂Show signature
Signature:
ACK
43bb5e3c46ACK
43bb5e3c46