Skip to content

gh-123681: Check the strftime() behavior at runtime instead of at the compile time#128444

Closed
serhiy-storchaka wants to merge 7 commits into
python:mainfrom
serhiy-storchaka:strftime-runtime-checks
Closed

gh-123681: Check the strftime() behavior at runtime instead of at the compile time#128444
serhiy-storchaka wants to merge 7 commits into
python:mainfrom
serhiy-storchaka:strftime-runtime-checks

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 3, 2025

Copy link
Copy Markdown
Member

It is needed to support cross-compiling.
Remove macros Py_NORMALIZE_CENTURY and Py_STRFTIME_C99_SUPPORT.

…at the compile time

It is needed to support cross-compiling.
Remove macros Py_NORMALIZE_CENTURY and Py_STRFTIME_C99_SUPPORT.
@erlend-aasland

Copy link
Copy Markdown
Contributor

This PR is not needed anymore. Please see the issue history.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

No, it is needed to support cross-compiling. You cannot check the runtime behavior at compile time when cross-compiling.

@erlend-aasland

Copy link
Copy Markdown
Contributor

No, it is needed to support cross-compiling. You cannot check the runtime behavior at compile time when cross-compiling.

There is no need; we require C99 compliant strftime.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

It is not C99 compliant (or at least not Python documentation compliant) on Linux. This is why this workaround was needed at first place.

@erlend-aasland

Copy link
Copy Markdown
Contributor

It is not C99 compliant (or at least not Python documentation compliant) on Linux. This is why this workaround was needed at first place.

If that was the case, all our Linux build bots and Linux CI would now be broken. However it is not.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I wonder why? I guess because ac_cv_normalize_century=yes if cross-compiling.

@erlend-aasland

Copy link
Copy Markdown
Contributor

I wonder why?

Because it is C99 compliant, presumably.

I guess because ac_cv_normalize_century=yes if cross-compiling.

ac_cv_normalize_century is not used. It is also set to the empty string, not yes if cross-compiling.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

It is used:

if test "$ac_cv_normalize_century" = yes

And it is set to "yes":
[ac_cv_normalize_century=yes])])

@erlend-aasland

Copy link
Copy Markdown
Contributor

Sorry, I misread it as ac_cv_strftime_c99_support.

@picnixz

picnixz commented Apr 4, 2025

Copy link
Copy Markdown
Member

What's the status of this PR?

@picnixz

picnixz commented Jun 10, 2025

Copy link
Copy Markdown
Member

@serhiy-storchaka apparently, the JIT tests for test_strftime_y2k don't fail anymore; should we do something here?

@serhiy-storchaka serhiy-storchaka deleted the strftime-runtime-checks branch August 23, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants