Building Python now requires a C99 <math.h> header file providing a
NAN constant, or the __builtin_nan() built-in function. If a platform
does not support Not-a-Number (NaN), the Py_NO_NAN macro can be
defined in the pyconfig.h file.
[user@localhost]$ make serve # default configuration, no change
python3 ../Tools/scripts/serve.py build/html
Serving build/html on port 8000, control-C to stop
^CShutting down.
[user@localhost]$ make serve SERVE_PORT=8080 # new option
python3 ../Tools/scripts/serve.py build/html 8080
Serving build/html on port 8080, control-C to stop
This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space.
```console
# du -s ./python before
27892 ./python
# du -s ./python after
27524 ./python
```
Automerge-Triggered-By: GH:ericsnowcurrently
It was added as part of #29222 to avoid running freeze tool tests on the
buildbots but the logic was wrong so it did not skip tests on typical posix
setup buildbots where the worker is launched from cron via an @reboot task and
thus have no USER environment variable. This uses the canonical
`getpass.getuser()` API rather than rolling its own attempt.
Disable compiler optimization within test_peg_generator.
This speed up test_peg_generator by always disabling compiler
optimizations by using -O0 or equivalent when the test is building its
own C extensions.
A build not using --with-pydebug in order to speed up test execution
winds up with this test taking a very long time as it would do
repeated compilation of parser C code using the same optimization
flags as CPython was built with.
This speeds the test up 6-8x on gps-raspbian.
Also incorporate's #31017's win32 conditional and flags.
Co-authored-by: Kumar Aditya kumaraditya303
* Revert "bpo-45173 Remove configparser deprecations"
This reverts commit df2284bc41.
* bpo-45173: Note these configparser deprecations will be removed in 3.12
After GH-15623 deleted `generrmap.c`, a related mak-file stopped working. The mak contains generrmap-related rules only so it should be removed altogether.
Further search for `errmap\.mak|generrmap` regex through content of CPython files shows no dangling reference left.
Since generrmap is already effectively removed, this pull request contains no blurp.
Per Pitrou:
> The original intent for the “accessor” thing was to have a variant that did all accesses under a filesystem tree in a race condition-free way using openat and friends. It turned out to be much too hairy to actually implement, so was entirely abandoned, but the accessor abstraction was left there.
https://discuss.python.org/t/make-pathlib-extensible/3428/2
Accessors are:
- Lacking any internal purpose - '_NormalAccessor' is the only implementation
- Lacking any firm conceptual difference to `Path` objects themselves (inc. subclasses)
- Non-public, i.e. underscore prefixed - '_Accessor' and '_NormalAccessor'
- Unofficially used to implement customized `Path` objects, but once once [bpo-24132]() is addressed there will be a supported route for that.
This patch preserves all existing behaviour.
The heredoc creation statements use >> to append conftest.c. This can cause
tricky build issues if the file is not correctly removed prior to its
name being reused (such name is reused several times for different
contextual tests during the build). One such result from appending may
cause #include <ac_nonexistent.h> to persist when testing to acquire
PLATFORM_TRIPLET. This can then lead to downstream issues concerning SOABI.
@pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190#issuecomment-1024633392
> PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.
> This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs : actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*().
Automerge-Triggered-By: GH:pablogsal