Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop setting the LANG env var #306

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- Stopped setting the `LANG` env var. ([#306](https://github.com/heroku/buildpacks-python/pull/306))

## [0.20.1] - 2024-12-13

### Fixed
Expand Down
11 changes: 0 additions & 11 deletions src/layers/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,6 @@ fn generate_layer_env(layer_path: &Path, python_version: &PythonVersion) -> Laye
)),
)
.chainable_insert(Scope::Build, ModificationBehavior::Delimiter, "CPATH", ":")
// Ensure Python uses a Unicode locale, to prevent the issues described in:
// https://github.com/docker-library/python/pull/570
.chainable_insert(
Scope::All,
ModificationBehavior::Override,
"LANG",
"C.UTF-8",
)
// We have to set `PKG_CONFIG_PATH` explicitly, since the automatic path set by lifecycle/libcnb
// is `<layer>/pkgconfig/`, whereas Python's pkgconfig files are at `<layer>/lib/pkgconfig/`.
.chainable_insert(
Expand Down Expand Up @@ -330,7 +322,6 @@ mod tests {
fn python_layer_env() {
let mut base_env = Env::new();
base_env.insert("CPATH", "/base");
base_env.insert("LANG", "this-should-be-overridden");
base_env.insert("PKG_CONFIG_PATH", "/base");
base_env.insert("PYTHONHOME", "this-should-be-overridden");
base_env.insert("PYTHONUNBUFFERED", "this-should-be-overridden");
Expand All @@ -341,7 +332,6 @@ mod tests {
utils::environment_as_sorted_vector(&layer_env.apply(Scope::Build, &base_env)),
[
("CPATH", "/layer-dir/include/python3.11:/base"),
("LANG", "C.UTF-8"),
("PKG_CONFIG_PATH", "/layer-dir/lib/pkgconfig:/base"),
("PYTHONHOME", "/layer-dir"),
("PYTHONUNBUFFERED", "1"),
Expand All @@ -352,7 +342,6 @@ mod tests {
utils::environment_as_sorted_vector(&layer_env.apply(Scope::Launch, &base_env)),
[
("CPATH", "/base"),
("LANG", "C.UTF-8"),
("PKG_CONFIG_PATH", "/base"),
("PYTHONHOME", "/layer-dir"),
("PYTHONUNBUFFERED", "1"),
Expand Down
2 changes: 0 additions & 2 deletions tests/pip_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ fn pip_basic_install_and_cache_reuse() {

## Testing buildpack ##
CPATH=/layers/heroku_python/venv/include:/layers/heroku_python/python/include/python3.13:/layers/heroku_python/python/include
LANG=C.UTF-8
LD_LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib:/layers/heroku_python/pip/lib
LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib:/layers/heroku_python/pip/lib
PATH=/layers/heroku_python/venv/bin:/layers/heroku_python/python/bin:/layers/heroku_python/pip/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Expand Down Expand Up @@ -84,7 +83,6 @@ fn pip_basic_install_and_cache_reuse() {
assert_eq!(
command_output.stdout,
formatdoc! {"
LANG=C.UTF-8
LD_LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib
PATH=/layers/heroku_python/venv/bin:/layers/heroku_python/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PIP_PYTHON=/layers/heroku_python/venv
Expand Down
2 changes: 0 additions & 2 deletions tests/poetry_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ fn poetry_basic_install_and_cache_reuse() {

## Testing buildpack ##
CPATH=/layers/heroku_python/venv/include:/layers/heroku_python/python/include/python3.13:/layers/heroku_python/python/include
LANG=C.UTF-8
LD_LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib:/layers/heroku_python/poetry/lib
LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib:/layers/heroku_python/poetry/lib
PATH=/layers/heroku_python/venv/bin:/layers/heroku_python/python/bin:/layers/heroku_python/poetry/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Expand Down Expand Up @@ -77,7 +76,6 @@ fn poetry_basic_install_and_cache_reuse() {
assert_eq!(
command_output.stdout,
formatdoc! {"
LANG=C.UTF-8
LD_LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib
PATH=/layers/heroku_python/venv/bin:/layers/heroku_python/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PYTHONHOME=/layers/heroku_python/python
Expand Down