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-101981: Build macOS as recommended by the devguide by erlend-aasland · Pull Request #102070 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Feb 20, 2023 •
edited by miss-islington
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: CI: intermittent macOS failures for make checksharedmods #101981

Automerge-Triggered-By: GH:erlend-aasland

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added the awaiting core review label Feb 20, 2023
@erlend-aasland erlend-aasland added the skip news label Feb 20, 2023
@erlend-aasland
erlend-aasland force-pushed the ci/build-macos-as-recommended-by-the-devguide branch from e02118a to 5aa9d55 Compare February 20, 2023 12:36
@erlend-aasland
CI: Build macOS as recommended by the devguide
3eaab15
@erlend-aasland
erlend-aasland force-pushed the ci/build-macos-as-recommended-by-the-devguide branch from 5aa9d55 to 3eaab15 Compare February 20, 2023 12:40
@erlend-aasland erlend-aasland changed the title CI: Build macOS as recommended by the devguide gh-101981: Build macOS as recommended by the devguide Feb 20, 2023
@bedevere-bot bedevere-bot mentioned this pull request Feb 20, 2023
CI: intermittent macOS failures for make checksharedmods #101981
Closed
@erlend-aasland
erlend-aasland requested review from corona10 and ned-deily February 20, 2023 12:46
@erlend-aasland
erlend-aasland marked this pull request as ready for review February 20, 2023 12:46
@erlend-aasland
erlend-aasland requested a review from ezio-melotti as a code owner February 20, 2023 12:46
@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

Installing the Homebrew dependencies takes between 10 to 20 seconds of CI time. We can consider caching those deps (cc. @hugovk, as our CI/GitHub/DevOps oracle).

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

Apparently Tools/build/check_extension_modules.py is too fragile. We should harden it and ensure that it dumps enough debug info on failure, so we won't end up with a week of red CI crosses again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland added needs backport to 3.10 needs backport to 3.11 only security fixes labels Feb 20, 2023
@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

I intend to merge this as soon as the CI turns green. If there are objections, we can always revert or create a follow-up PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Feb 20, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

@erlend-aasland What's difference between #101991?

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10
corona10 approved these changes Feb 20, 2023
View reviewed changes

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Feb 20, 2023
@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

@erlend-aasland What's difference between #101991?

Oh, sorry, I missed you had a similar PR!

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

@erlend-aasland What's difference between #101991?

AFAICS, my PR is slightly cleaner in that it still uses multiple build steps (first set environment variables, then run configure, etc.); it makes debugging the CI easier. Also, I did not touch any of the tests.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland added the 🤖 automerge label Feb 20, 2023
@miss-islington

miss-islington commented Feb 20, 2023

Copy link
Copy Markdown
Contributor

Status check is done, and it's a success ✅.

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington
miss-islington merged commit 2713631 into python:main Feb 20, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Feb 20, 2023
@miss-islington

miss-islington commented Feb 20, 2023

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland
erlend-aasland deleted the ci/build-macos-as-recommended-by-the-devguide branch February 20, 2023 13:07
@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the review, Dong-hee!

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 20, 2023
@erlend-aasland @miss-islington
pythongh-101981: Build macOS as recommended by the devguide (pythonGH…
dddd871
…-102070)

(cherry picked from commit 2713631)

Co-authored-by: Erlend E. Aasland <[email protected]>
Automerge-Triggered-By: GH:erlend-aasland
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 20, 2023
@erlend-aasland @miss-islington
pythongh-101981: Build macOS as recommended by the devguide (pythonGH…
1054aa5
…-102070)

(cherry picked from commit 2713631)

Co-authored-by: Erlend E. Aasland <[email protected]>
Automerge-Triggered-By: GH:erlend-aasland
@corona10

corona10 commented Feb 20, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

it makes debugging the CI easier. Also, I did not touch any of the tests.

It looks like the GHA performance issue is resolved.
During the weekend it was not.

erlend-aasland 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.

@corona10

corona10 commented Feb 20, 2023

Copy link
Copy Markdown
Member

AFAICS, my PR is slightly cleaner in that it still uses multiple build steps (first set environment variables, then run configure

see: #101991 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk

hugovk commented Feb 20, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Re: caching Homebrew:

https://stackoverflow.com/a/65056232/724176 shows how to do it, but warns:

You should note that this cache is unlikely to speed up your workflow. Installing Homebrew bottles (the default) will usually have similar performance to downloading from GitHub/Azure's own storage cache since the bottle files are served on bintray's CDN.

https://stackoverflow.com/a/63681598/724176 has 3 options, which aren't great: 1 is caching everything; 2 means identifying and copying binaries; 3 is Docker.


Looking at the log:

==> Running `brew cleanup pkg-config`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

We can set that if it makes things quicker, we don't need to do any cleanup, the whole CI run is disposed of after the run. And the first SO answer above sets HOMEBREW_NO_AUTO_UPDATE, that may save time too.

Here's a run of main with this PR, brew install takes 25s:

  • https://github.com/hugovk/cpython/actions/runs/4223815148/jobs/7333994448

With HOMEBREW_NO_AUTO_UPDATE it drops to 15s:

  • https://github.com/hugovk/cpython/actions/runs/4223831861/jobs/7334030713

And with HOMEBREW_NO_INSTALL_CLEANUP it's 16s, basically the same:

  • https://github.com/hugovk/cpython/actions/runs/4223836429/jobs/7334040607

So let's add them.

     needs: check_source
     if: needs.check_source.outputs.run_tests == 'true'
     env:
+      HOMEBREW_NO_AUTO_UPDATE: 1
+      HOMEBREW_NO_INSTALL_CLEANUP: 1
       PYTHONSTRICTEXTENSIONBUILD: 1
     steps:
     - uses: actions/checkout@v3

Edit: Well, these are all within the expected range anyway:

Installing the Homebrew dependencies takes between 10 to 20 seconds of CI time.

But these env vars shouldn't add time :)

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington added a commit that referenced this pull request Feb 20, 2023
@miss-islington @erlend-aasland
gh-101981: Build macOS as recommended by the devguide (GH-102070)
95751b9
(cherry picked from commit 2713631)

Co-authored-by: Erlend E. Aasland <[email protected]>
Automerge-Triggered-By: GH:erlend-aasland
@erlend-aasland

erlend-aasland commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

@hugovk, yeah adding the HOMEBREW_* variables makes sense. @corona10, can you update your PR to include those?

corona10 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.

@hugovk

hugovk commented Feb 20, 2023

Copy link
Copy Markdown
Member

And they're documented at https://docs.brew.sh/Manpage#environment

erlend-aasland 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.

erlend-aasland pushed a commit that referenced this pull request Feb 20, 2023
@miss-islington
[3.10] gh-101981: Build macOS as recommended by the devguide (GH-102070…
63877f6
…) (#102073)

gh-101981: Build macOS as recommended by the devguide (GH-102070)

(cherry picked from commit 2713631)
jaraco pushed a commit to jaraco/cpython that referenced this pull request Feb 20, 2023
@erlend-aasland @jaraco
pythongh-101981: Build macOS as recommended by the devguide (pythonGH…
462aaa3
…-102070)

Automerge-Triggered-By: GH:erlend-aasland
@jaraco jaraco mentioned this pull request Feb 20, 2023
gh-88233: zipfile: refactor _strip_extra #102083
Closed
carljm added a commit to carljm/cpython that referenced this pull request Feb 20, 2023
@carljm
Merge branch 'main' into inlinecomp2
9f0fc5b
* main: (60 commits)
  pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078)
  pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012)
  pythongh-101566: Sync with zipp 3.14. (pythonGH-102018)
  pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589)
  pythongh-88233: zipfile: handle extras after a zip64 extra (pythonGH-96161)
  pythongh-101981: Apply HOMEBREW related environment variables (pythongh-102074)
  pythongh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (pythonGH-101912)
  pythongh-101819: Adapt _io types to heap types, batch 1 (pythonGH-101949)
  pythongh-101981: Build macOS as recommended by the devguide (pythonGH-102070)
  pythongh-97786: Fix compiler warnings in pytime.c (python#101826)
  pythongh-101578: Amend PyErr_{Set,Get}RaisedException docs (python#101962)
  Misc improvements to the float tutorial (pythonGH-102052)
  pythongh-85417: Clarify behaviour on branch cuts in cmath module (python#102046)
  pythongh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
  Add missing 'is' to `cmath.log()` docstring (python#102049)
  pythongh-100210: Correct the comment link for unescaping HTML (python#100212)
  pythongh-97930: Also include subdirectory in makefile. (python#102030)
  pythongh-99735: Use required=True in argparse subparsers example (python#100927)
  Fix incorrectly documented attribute in csv docs (python#101250)
  pythonGH-84783: Make the slice object hashable (pythonGH-101264)
  ...
@ned-deily

ned-deily commented Feb 21, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Sorry that I'm a bit late to this discussion but I have to point out that there appears to be a bit of a misunderstanding here of what configure does and, thus, this PR is not doing what its title asserts :)

configure goes to great lengths to ensure that the necessary environment specified at the time configure is run is preserved in the generated Makefile such that whenever make is run the necessary environment variable values are created in the make environment. That means that, once you have run configure, you can go back later, in a different terminal session, say, and run make without having to define the essential environment variables (like CFLAGS and LDFLAGS) as they were set at configure time.

However, the Makefile does allow for augmenting those environment variables if they are defined in the environment when running make. So, if those environment variables have been defined externally when running make, you may get different results of a build. That's fine if that's what you want to do. But, by default, you should not have to define those variables for a normal build after running configure. That's the way things have worked for a very long time.

Note that the devguide recipe for 3.10+ deliberately does not export any environment variables in the shell environment when running configue and make; by placing the environment variables definitions on the configure command line, they are local to the configure process and its children (and preserved by it in the Makefile). With the github workflow as merged here, the CFLAGS and LDFLAGS values are effectively unnecessarily being exported into each subsequent build step by using GITHUB_ENV. This isn't just a stylistic change; it bypasses a small but important test of the build process that those variables are being properly preserved and recreated by make steps so that we are confident that the Makefile stands alone and is not dependent on externally defining any configuration-related variables.

CAM-Gerlach, erlend-aasland, gpshead, and hauntsaninja reacted with thumbs up emoji
All reactions
  • 👍 4 reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Feb 21, 2023

Copy link
Copy Markdown
Contributor Author

@ned-deily, this is true (I noticed my error post merge, see my comments on Discord). Dong-hee had a fixup PR ready at some point, but he reverted that specific change. I definitely agree that we should provide the environment variables only when configure is run!

ned-deily 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.

@erlend-aasland erlend-aasland added needs backport to 3.8 labels Feb 21, 2023
@miss-islington

miss-islington commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington

miss-islington commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington

miss-islington commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 27136310414965a3ea7f835e416cf74b91cefb48 3.9

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington miss-islington self-assigned this Feb 21, 2023
@miss-islington

miss-islington commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

Sorry @erlend-aasland, I had trouble checking out the 3.8 backport branch.
Please retry by removing and re-adding the "needs backport to 3.8" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 27136310414965a3ea7f835e416cf74b91cefb48 3.8

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Feb 21, 2023

Copy link
Copy Markdown
Contributor Author

I'll create backports for 3.9 and 3.8 with the fixup in #102131 applied.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland mentioned this pull request Feb 22, 2023
test_freeze_simple_script in test_tools fails to fetch CONFIG_ARGS #102151
Closed
carljm added a commit to carljm/cpython that referenced this pull request Feb 22, 2023
@carljm
Merge branch 'main' into inlinecomp
544b30c
* main: (225 commits)
  pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078)
  pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012)
  pythongh-101566: Sync with zipp 3.14. (pythonGH-102018)
  pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589)
  pythongh-88233: zipfile: handle extras after a zip64 extra (pythonGH-96161)
  pythongh-101981: Apply HOMEBREW related environment variables (pythongh-102074)
  pythongh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (pythonGH-101912)
  pythongh-101819: Adapt _io types to heap types, batch 1 (pythonGH-101949)
  pythongh-101981: Build macOS as recommended by the devguide (pythonGH-102070)
  pythongh-97786: Fix compiler warnings in pytime.c (python#101826)
  pythongh-101578: Amend PyErr_{Set,Get}RaisedException docs (python#101962)
  Misc improvements to the float tutorial (pythonGH-102052)
  pythongh-85417: Clarify behaviour on branch cuts in cmath module (python#102046)
  pythongh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
  Add missing 'is' to `cmath.log()` docstring (python#102049)
  pythongh-100210: Correct the comment link for unescaping HTML (python#100212)
  pythongh-97930: Also include subdirectory in makefile. (python#102030)
  pythongh-99735: Use required=True in argparse subparsers example (python#100927)
  Fix incorrectly documented attribute in csv docs (python#101250)
  pythonGH-84783: Make the slice object hashable (pythonGH-101264)
  ...
@bedevere-bot

bedevere-bot commented Feb 23, 2023

Copy link
Copy Markdown

GH-102186 is a backport of this pull request to the 3.9 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Feb 23, 2023
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request Feb 23, 2023
@erlend-aasland
[3.9] pythongh-101981: Build macOS as recommended by the devguide (py…
6f1e95b
…thonGH-102070)

Automerge-Triggered-By: GH:erlend-aasland.
(cherry picked from commit 2713631)

Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-bot

bedevere-bot commented Feb 23, 2023

Copy link
Copy Markdown

GH-102187 is a backport of this pull request to the 3.8 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.8 label Feb 23, 2023
python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request Sep 1, 2024
@erlend-aasland @python-sidebar
pythongh-101981: Build macOS as recommended by the devguide (pythonGH…
f1d6e3e
…-102070)

Automerge-Triggered-By: GH:erlend-aasland
python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request Sep 1, 2024
@erlend-aasland @python-sidebar
pythongh-101981: Build macOS as recommended by the devguide (pythonGH…
d4d4136
…-102070)

Automerge-Triggered-By: GH:erlend-aasland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 approved these changes
@ned-deily ned-deily Awaiting requested review from ned-deily
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti ezio-melotti is a code owner

Uh oh!

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

Assignees

@miss-islington miss-islington

Labels

skip news

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.

6 participants

@erlend-aasland @corona10 @miss-islington @bedevere-bot @hugovk @ned-deily
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.