Skip to content

add pre-configure hook for Python to fix datetime test failures - #338

Open
bedroge wants to merge 1 commit into
EESSI:mainfrom
bedroge:python_tzpath
Open

bedroge wants to merge 1 commit into
EESSI:mainfrom
bedroge:python_tzpath

Conversation

@bedroge

@bedroge bedroge commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

This should fix EESSI/software-layer#1888 (comment).

Looks like this is being caused by Python using timezone data from /usr/share/zoneinfo, which means that the tests will be run using those files from the build container. However, glibc is configured to use the ones from the compat layer, and apparently it causes some mixup in the Python tests. The build containers were recently updated to the most recent Debian version and most up-to-date package versions, so it has very up-to-date timezone data now, while the compat layer hasn't been updated for a while.

This PR fixes things by adding --with-tzpath to our Python builds. This option can take a list of paths, and the default is:

checking for --with-tzpath... "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo"

So I'm prepending our compat layer dir to it (to hopefully keep the system stuff as fallback). It's also patch a test, since it uses a hardcoded path to /usr/share/zoneinfo here: https://github.com/python/cpython/blob/v3.14.2/Lib/test/datetimetester.py#L6414.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant