Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ensuremake -j uses a reasonable argument#1541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AA-Turner merged 4 commits intopython:mainfromAA-Turner:make-jobs
Apr 18, 2025

Conversation

AA-Turner
Copy link
Member

@AA-TurnerAA-Turner commentedApr 18, 2025
edited by github-actionsbot
Loading

AA-Turnerand others added3 commitsApril 18, 2025 13:23
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…imit onthe number of concurrent jobs, not "a sensible limit considering theavailable memory and CPU cores". With LTO it's easy to run out of memorywhen too many jobs run at the same time.
@AA-Turner
Copy link
MemberAuthor

I've cherry-picked@Yhg1s's changes from#1543 into this branch, the question is if we want to suggest a static number (-j4) or use the number of CPU cores (-j $(nproc)).

@hugovk
Copy link
Member

Let's use$(nproc) so we can copy and paste and get something more useful. Many modern machines have much more than 4 cores; I have an 8 and a 10.

AA-Turner and chris-eibl reacted with thumbs up emoji

@@ -203,14 +203,13 @@ do to get a pydebug build of CPython.

Once ``configure`` is done, you can then compile CPython with::

$ make -s -j2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note thatnproc is part of GNU coreutils and may not necessarily be available on all Unix-like systems (namely, macOS). So Mac users should first dobrew install coreutils or usesysctl instead to get the number of physical or logical cores (I don't remember which one nproc returns)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've merged, as Hugo uses macOS and didn't complain, but we can open a follow-up if need be.

gpshead reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for pointing that out. I do have coreutils installed via Homebrew, which is why it worked for me. Let's not require or assume others do.

Shall we use a hardcoded value under the macOS tabs? Something like 8 feels like a good default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

TL;DR - this is good enough.

I feel like people who understand how to runmake already understand what$(nproc) can be substituted with manually if they don't have the command. if we wanted to be ironic we'd suggest$(python3 -c 'import os; print(os.cpu_count())') to the person who is building python and may not yet have a built python3 (but realistically do anyways because all Linux distros offer it and macOS xcode comes with one). 😛

hugovk reacted with laugh emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I feel like people who understand how to runmake already understand what$(nproc) can be substituted with

That seems like a rash assumption to me; I would expect anyone with that level of comfort withmake to not need to be walked through "run./configure && make". There's also the point thatmake -j $(nproc) in the absense of a workingnproc will leave the user withmake -j, which is what we were trying to avoid with this change.

hugovk reacted with thumbs up emoji
Copy link
Member

@picnixzpicnixzApr 18, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The assumption would be correct if we were in theextension-modules.rst file, but this file is for the "getting started". I don't think we should assume that the reader is extra familiar withmake and even knows aboutnproc and co (this section would be read by newcomers I think).

By the way,nproc being part of coreutils and not necessarily available on macOS caused some issues in other projects:https://www.drupal.org/project/drupal/issues/3407360. So it's not necessarily a theoretical use case.

@AA-TurnerAA-Turner merged commitf1b7e25 intopython:mainApr 18, 2025
4 checks passed
@AA-TurnerAA-Turner deleted the make-jobs branchApril 18, 2025 19:40
@hugovkhugovk mentioned this pull requestApr 29, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead left review comments

@hugovkhugovkhugovk left review comments

@zwarezwarezware left review comments

@picnixzpicnixzpicnixz left review comments

@Yhg1sYhg1sAwaiting requested review from Yhg1s

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@AA-Turner@hugovk@gpshead@zware@picnixz@Yhg1s

[8]ページ先頭

©2009-2025 Movatter.jp