GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-99289: Add COMPILEALL_OPTS to Makefile by vstinner · Pull Request #99291 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Nov 9, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add COMPILEALL_OPTS variable in Makefile to override compileall options (default: -j0) in "make install". Merge also the 3 compileall commands into a single command building PYC files for the 3 optimization levels (0, 1, 2).

  • Issue: Makefile: add COMPILEALL_OPTS variable to allow overriding compileall options in "make install" #99289

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

wimglenn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@vstinner
gh-99289: Add COMPILEALL_OPTS to Makefile
9313d24
Add COMPILEALL_OPTS variable in Makefile to override compileall
options (default: -j0) in "make install". Merge also the 3 compileall
commands into a single command building PYC files for the 3
optimization levels (0, 1, 2).
@bedevere-bot bedevere-bot mentioned this pull request Nov 9, 2022
Makefile: add COMPILEALL_OPTS variable to allow overriding compileall options in "make install" #99289
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Nov 9, 2022
@vstinner

vstinner commented Nov 9, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Example:

./configure --prefix ~/prefix
make
make install COMPILEALL_OPTS="--hardlink-dupes -j4"

Output:

(...)
PYTHONPATH=/home/vstinner/prefix/lib/python3.12  \
	./python -E -Wi /home/vstinner/prefix/lib/python3.12/compileall.py \
	-o 0 -o 1 -o 2 --hardlink-dupes -j4 -d /home/vstinner/prefix/lib/python3.12/site-packages -f \
	-x badsyntax /home/vstinner/prefix/lib/python3.12/site-packages
(...)

compileall is called with options: -o 0 -o 1 -o 2 --hardlink-dupes -j4:

  • -o 0 -o 1 -o 2 is hardcoded
  • default -j0 was overriden with --hardlink-dupes -j4
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 9, 2022

Copy link
Copy Markdown
Member Author

I tested again to double check. Ah, in fact compileall is called two times: once for Lib/, once for site-packages:

(...)

PYTHONPATH=/home/vstinner/prefix/lib/python3.12  \
        ./python -E -Wi /home/vstinner/prefix/lib/python3.12/compileall.py \
        -o 0 -o 1 -o 2 --hardlink-dupes -j4 -d /home/vstinner/prefix/lib/python3.12 -f \
        -x 'bad_coding|badsyntax|site-packages|test/test_lib2to3/data' \
        /home/vstinner/prefix/lib/python3.12
Listing '/home/vstinner/prefix/lib/python3.12'...
(...)

PYTHONPATH=/home/vstinner/prefix/lib/python3.12  \
        ./python -E -Wi /home/vstinner/prefix/lib/python3.12/compileall.py \
        -o 0 -o 1 -o 2 --hardlink-dupes -j4 -d /home/vstinner/prefix/lib/python3.12/site-packages -f \
        -x badsyntax /home/vstinner/prefix/lib/python3.12/site-packages
Listing '/home/vstinner/prefix/lib/python3.12/site-packages'...
(...)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 9, 2022

Copy link
Copy Markdown
Member Author

cc @hroncok

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hroncok

hroncok commented Nov 11, 2022

Copy link
Copy Markdown
Contributor

This is an improvement, thanks! OTOH we would probably also like an opinion to disable this entirely and do it ourselves.

wimglenn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead added 2 commits November 13, 2022 11:15
@gpshead
whats new wording improvement.
6bbc683
@gpshead
reword news
7b34b8f
gpshead
gpshead approved these changes Nov 13, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Nov 13, 2022
@vstinner
vstinner merged commit 9a7e9f9 into python:main Nov 14, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 14, 2022
@vstinner

vstinner commented Nov 14, 2022

Copy link
Copy Markdown
Member Author

Merged, thanks for the review!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner deleted the compileall_opts branch November 14, 2022 12:43
@vstinner

vstinner commented Nov 14, 2022

Copy link
Copy Markdown
Member Author

OTOH we would probably also like an opinion to disable this entirely and do it ourselves.

That can be a separated option.

IMO this change alone is already an enhancement ;-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ngoldbaum ngoldbaum mentioned this pull request Mar 12, 2026
ENH: TSan pixi package definitions numpy/numpy#30510
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@vstinner @hroncok @gpshead @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.