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 — CI: add windows free-threaded CI by ngoldbaum · Pull Request #27819 · numpy/numpy

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Nov 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This enables CI for the free-threaded build on Windows. The CI config follows what I did for Linux and MacOS.

It adds two new CI jobs to our Github Actions config.

This also fixes a number of issues with the extbuild helper for testing C extensions, both on the free-threaded build and in general.

While I was here, I fixed some questionable software engineering choices like using mutables as the default value for keyword arguments and an unnecessary try/except I found annoying for debugging.

It also fixes the way libpython is linked against on the free-threaded build. Meson's link_args can use unix-style -L/path -lname_of_library syntax on all platforms, so I used it here even if it looks weird in Windows-specific configuration.

Also fixes issues caused by python.h not setting Py_GIL_DISABLED on Windows, so we need to do that ourselves.

Sorry, something went wrong.

Uh oh!

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

All reactions
@ngoldbaum ngoldbaum added the 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) label Nov 22, 2024
@ngoldbaum

ngoldbaum commented Nov 22, 2024

Copy link
Copy Markdown
Member Author

Darn looks like this breaks 32-bit 3.10 on windows. I'll try to fix that on Monday.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rgommers rgommers added the component: CI label Nov 23, 2024
rgommers
rgommers reviewed Nov 23, 2024
View reviewed changes

@rgommers rgommers 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.

Thanks Nathan. Overall this looks good. I would prefer to not add two new jobs, that's a bit too heavyweight. Why not just switch one job over? E.g., use MSVC for 3.11 and Clang-cl for 3.13t. There shouldn't be much (if any) cross-talk between compilers and Python versions.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread numpy/testing/_private/extbuild.py Resolved

Uh oh!

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

@ngoldbaum

ngoldbaum commented Nov 25, 2024

Copy link
Copy Markdown
Member Author

Last push adds py.extension_module. I might need some more changes if CI shakes out issues on platforms I didn't test on locally.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ngoldbaum

This comment was marked as outdated.

Sign in to view
@ngoldbaum

ngoldbaum commented Nov 25, 2024

Copy link
Copy Markdown
Member Author

@rgommers I think this is ready now.

All reactions

Sorry, something went wrong.

Uh oh!

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

ngoldbaum added 6 commits November 25, 2024 11:10
@ngoldbaum
MNT: add free-threaded windows CI
aaabf2d
@ngoldbaum
MNT: fix extbuild on windows free-threaded build
e6c163f
@ngoldbaum
CI: try to fix 3.11 builds
b7dcfcf
@ngoldbaum
fix linter
24e7cf0
@ngoldbaum
TST: use py.extension_module to simplify extbuild helper
3080a51
@ngoldbaum
CI: use only two windows CI jobs
cc8350a
@ngoldbaum
ngoldbaum force-pushed the windows-nogil-ci branch from a351955 to cc8350a Compare November 25, 2024 18:10
@rgommers rgommers added this to the 2.3.0 release milestone Nov 25, 2024
rgommers
rgommers reviewed Nov 25, 2024
View reviewed changes

@rgommers rgommers 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.

Looks quite good overall - a few small comments/questions.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread numpy/testing/_private/extbuild.py Resolved

Uh oh!

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

Comment thread numpy/testing/_private/extbuild.py
if sys.platform == 'win32':
compile_extra = ["/we4013"]
link_extra = ["/LIBPATH:" + os.path.join(sys.base_prefix, 'libs')]
link_extra.append('/DEBUG') # generate .pdb file

@rgommers rgommers Nov 25, 2024

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.

Not sure this will be robust, but I don't mind adding it if CI is happy

Sorry, something went wrong.

Uh oh!

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

All reactions

@ngoldbaum ngoldbaum Nov 25, 2024

Copy link
Copy Markdown
Member Author

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.

This is just keeping the behavior we had before, there's another sys.platform == 'win32' block below I merged with this one.

I did delete the LIBPATH stuff because meson handles this now.

Sorry, something went wrong.

Uh oh!

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

rgommers reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread numpy/testing/_private/extbuild.py
and os.path.exists(s + 'include')):
include_dirs.append(s + 'include')
if s + 'lib' not in library_dirs and os.path.exists(s + 'lib'):
library_dirs.append(s + 'lib')

@rgommers rgommers Nov 25, 2024

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.

This mess can indeed go now I think.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread numpy/testing/_private/extbuild.py Resolved

Uh oh!

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

@ngoldbaum
MNT: respond to Ralf's comments
1bea58b
rgommers
rgommers approved these changes Nov 25, 2024
View reviewed changes

@rgommers rgommers 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 now, let's give this a go. Thanks Nathan!

Sorry, something went wrong.

Uh oh!

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

All reactions
@rgommers
rgommers merged commit cf95985 into numpy:main Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mattip mattip mattip left review comments
@rgommers rgommers rgommers approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) component: CI

Projects

None yet

Milestone

2.3.0 release

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@ngoldbaum @rgommers @mattip
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 01402775 — 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.