Skip to content

Commit 688d7ac

Browse files
committed
compat: make sure we don't over LC_CYTPE / LANG
If --action_env is being passed then the repo expects it to hit all the actions, by forcing LANG/LC_CTYPE to override we're removing that use case
1 parent de2eedd commit 688d7ac

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

pkg/legacy/rpm.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def _pkg_rpm_impl(ctx):
125125
inputs = files,
126126
outputs = [ctx.outputs.rpm],
127127
env = {
128-
"LANG": "en_US.UTF-8",
129-
"LC_CTYPE": "UTF-8",
128+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
129+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
130130
"PYTHONIOENCODING": "UTF-8",
131131
"PYTHONUTF8": "1",
132132
},

pkg/private/deb/deb.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def _pkg_deb_impl(ctx):
155155
inputs = files,
156156
outputs = [output_file, changes_file],
157157
env = {
158-
"LANG": "en_US.UTF-8",
159-
"LC_CTYPE": "UTF-8",
158+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
159+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
160160
"PYTHONIOENCODING": "UTF-8",
161161
"PYTHONUTF8": "1",
162162
},

pkg/private/tar/tar.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ def _pkg_tar_impl(ctx):
187187
arguments = [args],
188188
outputs = [output_file],
189189
env = {
190-
"LANG": "en_US.UTF-8",
191-
"LC_CTYPE": "UTF-8",
190+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
191+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
192192
"PYTHONIOENCODING": "UTF-8",
193193
"PYTHONUTF8": "1",
194194
},

pkg/private/zip/zip.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def _pkg_zip_impl(ctx):
7272
arguments = [args],
7373
outputs = [output_file],
7474
env = {
75-
"LANG": "en_US.UTF-8",
76-
"LC_CTYPE": "UTF-8",
75+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
76+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
7777
"PYTHONIOENCODING": "UTF-8",
7878
"PYTHONUTF8": "1",
7979
},

pkg/releasing/git.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def _git_changelog_impl(ctx):
4444
arguments = [args],
4545
outputs = [ctx.outputs.out],
4646
env = {
47-
"LANG": "en_US.UTF-8",
48-
"LC_CTYPE": "UTF-8",
47+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
48+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
4949
"PYTHONIOENCODING": "UTF-8",
5050
"PYTHONUTF8": "1",
5151
},

pkg/rpm_pfg.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,8 @@ def _pkg_rpm_impl(ctx):
675675
inputs = files,
676676
outputs = [output_file],
677677
env = {
678-
"LANG": "en_US.UTF-8",
679-
"LC_CTYPE": "UTF-8",
678+
"LANG": ctx.configuration.default_shell_env.get("LANG", "en_US.UTF-8"),
679+
"LC_CTYPE": ctx.configuration.default_shell_env.get("LC_CTYPE", "UTF-8"),
680680
"PYTHONIOENCODING": "UTF-8",
681681
"PYTHONUTF8": "1",
682682
},

0 commit comments

Comments
 (0)