lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

feat: expand logic to determine local time

Open sertonix opened this issue 3 months ago • 6 comments

This PR extends TZdb to honor the TZ environment variable and fall back to UTC if /etc/localtime does not exist.

This is more consistent with C and allows overwriting local time as unprivileged user.

I would kindly ask for help with writing a test for the TZ environment variable since I am very new to lean. More specifically: How should I set an environment variable for a test?

sertonix avatar Sep 22 '25 19:09 sertonix

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 20b0bd0a2018295db19d3dabb5905841fd16a679 --onto 9fc18b8ab462cb9100d37a23814ebbac330e8577. You can force Mathlib CI using the force-mathlib-ci label. (2025-09-22 20:42:03)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 20b0bd0a2018295db19d3dabb5905841fd16a679 --onto 0807f73171ca8f765c11ef37d69fd95e6613a878. You can force Mathlib CI using the force-mathlib-ci label. (2025-09-24 13:04:35)

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 20b0bd0a2018295db19d3dabb5905841fd16a679 --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-09-22 20:42:04)

leanprover-bot avatar Sep 22 '25 20:09 leanprover-bot

Thanks for the PR!

I would kindly ask for help with writing a test for the TZ environment variable since I am very new to lean. More specifically: How should I set an environment variable for a test?

You can add a new test directory to tests/pkg/. These tests are just small Lean projects together with a script test.sh that can invoke lake build, run the resulting executable with different environment variables, etc.

TwoFX avatar Sep 23 '25 06:09 TwoFX

Thanks! I think the test works now

sertonix avatar Sep 24 '25 12:09 sertonix

Is there anything blocking this MR?

sertonix avatar Dec 09 '25 21:12 sertonix

Is there anything blocking this MR?

Just a lack of review capacity :)

TwoFX avatar Dec 10 '25 09:12 TwoFX