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

add TZ env var for python devcontainer scripts #1006

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions bin/hermit.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ env = {

// Python:
"LANG": "en_US.UTF-8",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From @alcuadrado (comment):

Maybe a less disruptive solution can be adding TZ=UTC to the mkdocs command in here:

Given that the error was raised from the common std library python3.11/zoneinfo/_tzpath.py, I think setting it here for all modules would fix the issue for all other modules/commands, as any of them could also be using zoneinfo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know how often infra uses python, so I don't understand which solution is better. I was just trying to actually find the root of the problem when I saw that alternative.

"TZ": "UTC",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could we set it in the devcontainer rather than in the Hermit env? I'd rather not change it locally (which is where I'm using Hermit from) and possibly chase a bug or have this weird unexplained inconsistency at some point 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the terminal environment is overridden by user devcontainer files, which are applied after the container is created (?). I'm afraid setting it in Dockerfile or devcontainer.json won't do it.

I'd rather not change it locally (which is where I'm using Hermit from)

This will only affect commands running inside the Slang repo. I'm not worried this will cause a regression, as TZ is a common env var used by GNU C, POSIX systems, and many others, although of course we can't be 100% sure. It is unfortunate that Python dev environments don't consistently document all environment variables needed, or how they are interpreted. I saw a very similar issue with the LANG variable above, and setting it here resolved the errors from the underlying python modules.


// Rust:
"RUST_BACKTRACE": "full",
Expand Down