practicalswift
commented at 5:55 am on June 13, 2018:
contributor
Make sure LC_ALL=C is set when using grep range expressions.
Make sure LC_ALL=C is set in all shell scripts.
From the grep(1) documentation:
Within a bracket expression, a range expression consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, inclusive, using the locale’s collating sequence and character set. For example, in the default C locale, [a-d] is equivalent to [abcd]. Many locales sort characters in dictionary order, and in these locales [a-d] is typically not equivalent to [abcd]; it might be equivalent to [aBbCcDd], for example. To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the LC_ALL environment variable to the value C.
fanquake added the label
Scripts and tools
on Jun 13, 2018
laanwj
commented at 10:46 am on June 13, 2018:
member
Maybe export LC_ALL=C at the beginning of these scripts, to rule out unexpected locale dependency in other commands too.
(this also avoids making the code look even more cluttered)
practicalswift force-pushed
on Jun 13, 2018
MarcoFalke renamed this:
Add linter: Make sure LC_ALL=C is set when using grep range expressions
Make sure LC_ALL=C is set when using grep range expressions
on Jun 13, 2018
MarcoFalke added the label
Build system
on Jun 13, 2018
practicalswift
commented at 2:54 pm on June 13, 2018:
contributor
@laanwj Good idea. Now enforcing export LC_ALL=C. Please re-review :-)
practicalswift renamed this:
Make sure LC_ALL=C is set when using grep range expressions
Make sure LC_ALL=C is set in all shell scripts
on Jun 13, 2018
MarcoFalke
commented at 2:57 pm on June 13, 2018:
member
How would shellcheck segfault on this? :face_with_head_bandage:
practicalswift
commented at 9:25 pm on June 13, 2018:
contributor
@MarcoFalke Tried removing that but same issue :-\
laanwj
commented at 7:08 am on June 14, 2018:
member
Seems like an upstream bug then, with the version installed by Travis, if you can’t reproduce it locally?
ken2812221
commented at 7:29 am on June 14, 2018:
contributor
Looks like travis has already installed shellcheck v0.4.6, but we reinstall v0.3.3 from ubuntu repo.
Edit: Tried not to downgrade shellcheck, not going to work.
practicalswift force-pushed
on Jun 14, 2018
practicalswift force-pushed
on Jun 14, 2018
practicalswift
commented at 10:07 am on June 14, 2018:
contributor
Worked around the shellcheck issue by adding an “opt in to locale dependence” mechanism which is now in used for test/lint/lint-shell.sh.
Please re-review :-)
laanwj
commented at 11:28 am on June 14, 2018:
member
Still segfaults?!?
practicalswift force-pushed
on Jun 14, 2018
practicalswift
commented at 1:24 pm on June 14, 2018:
contributor
@laanwjLC_ALL=C was exported by the lint script runner test/lint/lint-all.sh and thus inherited also by test/lint/lint-shell.sh. Now “opting in to locale dependence” also in lint-all.sh to allow for the linting scripts to opt in/out out of locale dependences themselves :-)
Add "export LC_ALL=C" to all shell scripts3352da8da1
Add linter: Make sure all shell scripts opt out of locale dependence using "export LC_ALL=C"47776a958b
practicalswift force-pushed
on Jun 14, 2018
laanwj
commented at 2:16 pm on June 14, 2018:
member
Good. We should not forget to remove this workaround when we’ll be able to use a newer shellcheck, it’s a bit yucky, but checking all scripts but two is much better than nothing.
utACK47776a958b08382d76d69b5df7beed807af168b3
MarcoFalke deleted a comment
on Jun 15, 2018
ken2812221
commented at 4:57 pm on June 16, 2018:
contributor
utACK47776a958b08382d76d69b5df7beed807af168b3
laanwj merged this
on Jun 18, 2018
laanwj closed this
on Jun 18, 2018
laanwj referenced this in commit
45c00f8416
on Jun 18, 2018
MarcoFalke
commented at 11:24 am on June 18, 2018:
member
0test/lint/lint-all.sh
1Missing "export LC_ALL=C" (to avoid locale dependence) as first non-comment non-empty line in test/lint/lint-python-utf8-encoding.sh
2^---- failure generated from test/lint/lint-shell-locale.sh
practicalswift referenced this in commit
7b23e6e13f
on Jun 18, 2018
practicalswift
commented at 12:21 pm on June 18, 2018:
contributor
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-11-20 21:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me