René's URL Explorer Experiment


Title: python.h setting HAVE_THREAD_LOCAL breaks numpy build · Issue #142163 · python/cpython · GitHub

Open Graph Title: python.h setting HAVE_THREAD_LOCAL breaks numpy build · Issue #142163 · python/cpython

X Title: python.h setting HAVE_THREAD_LOCAL breaks numpy build · Issue #142163 · python/cpython

Description: Currently NumPy will fail to build on some systems using CPython main with the following error: FAILED: [code=1] numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c.o cc -Inumpy/_core/_multiarray_umath.cpy...

Open Graph Description: Currently NumPy will fail to build on some systems using CPython main with the following error: FAILED: [code=1] numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c....

X Description: Currently NumPy will fail to build on some systems using CPython main with the following error: FAILED: [code=1] numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c....

Opengraph URL: https://github.com/python/cpython/issues/142163

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"python.h setting HAVE_THREAD_LOCAL breaks numpy build","articleBody":"Currently NumPy will fail to build on some systems using CPython `main` with the following error:\n\n```\n FAILED: [code=1] numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c.o\n  cc -Inumpy/_core/_multiarray_umath.cpython-315-darwin.so.p -Inumpy/_core -I../numpy/_core -Inumpy/_core/include -I../numpy/_core/include -I../numpy/_core/src/common -I../numpy/_core/src/multiarray -I../numpy/_core/src/npymath -I../numpy/_core/src/umath -I../numpy/_core/src/highway -I/Users/goldbaum/.pyenv/versions/3.15-dev/include/python3.15 -I/Users/goldbaum/Documents/numpy/.mesonpy-9trjlyib/meson_cpu -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c11 -O3 -fno-strict-aliasing -ftrapping-math -DNPY_HAVE_CLANG_FPSTRICT -DNPY_HAVE_NEON_VFPV4 -DNPY_HAVE_NEON_FP16 -DNPY_HAVE_NEON -DNPY_HAVE_ASIMD -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework -idirafter/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers -DACCELERATE_NEW_LAPACK -DHAVE_CBLAS '-DBLAS_SYMBOL_SUFFIX=$NEWLAPACK' -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -MD -MQ numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c.o -MF numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c.o.d -o numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c.o -c numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/scalartypes.c\n  In file included from ../numpy/_core/src/multiarray/scalartypes.c.src:28:\n  ../numpy/_core/src/multiarray/conversion_utils.h:116:22: error: unknown type name 'thread_local'\n    116 | extern NPY_NO_EXPORT NPY_TLS int evil_global_disable_warn_O4O8_flag;\n        |                      ^\n  ../numpy/_core/include/numpy/npy_common.h:131:21: note: expanded from macro 'NPY_TLS'\n    131 |     #define NPY_TLS thread_local\n        |                     ^\n  1 error generated.\n```\n\nYou can see why that's happening by looking at `npy_common.h` and noting that it depends on `HAVE_THREAD_LOCAL` being set by NumPy's meson build configuration based on a configure-time check:\n\nhttps://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/include/numpy/npy_common.h#L128-L140\n\nhttps://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/meson.build#L269-L294\n\nSince #140690 was merged, `python.h` now unconditionally sets `HAVE_THREAD_LOCAL`, breaking the logic in `npy_common.h`.\n\nMaybe on the NumPy side we should be prepending macros that depend on configure-time checks with a `NPY_` prefix to avoid issues like this but also numpy might not be the only library where `HAVE_THREAD_LOCAL` is load-bearing. I don't see anything besides Python and NumPy in a github search: https://github.com/search?q=HAVE_THREAD_LOCAL+language%3AC+python.h\u0026type=code\u0026p=2\n\ncc @ZeroIntensity. Also h/t to @tacaswell for originally finding this, reporting it on Discord, and bisecting it.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-142164\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ngoldbaum","@type":"Person","name":"ngoldbaum"},"datePublished":"2025-12-01T23:06:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/142163/cpython/issues/142163"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5b7e8262-6632-bcd0-edff-afc4f4daa9e1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC984:146FD0:B0D3EA:F6C37B:696A33EC
html-safe-nonce36d52bc8c862b6a5f7dd98b079a6ed1a28d9521a3a9c18693a492ecfd1e94bea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTg0OjE0NkZEMDpCMEQzRUE6RjZDMzdCOjY5NkEzM0VDIiwidmlzaXRvcl9pZCI6IjI0MTczNTcxODUzNzMzMjAxNzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac83aeabd57b2739f51aa4acc7f01e4c4f62013dadd89d8f0db9105ef7edf3c734
hovercard-subject-tagissue:3683235562
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/142163/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2974ae343a2680f6570c4ee8dfafbdcdf4bbda38c7e317d76b7fcde8e7d910d3/python/cpython/issues/142163
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2974ae343a2680f6570c4ee8dfafbdcdf4bbda38c7e317d76b7fcde8e7d910d3/python/cpython/issues/142163
og:image:altCurrently NumPy will fail to build on some systems using CPython main with the following error: FAILED: [code=1] numpy/_core/_multiarray_umath.cpython-315-darwin.so.p/meson-generated_scalartypes.c....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamengoldbaum
hostnamegithub.com
expected-hostnamegithub.com
None321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/142163#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F142163
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F142163
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/142163
Reloadhttps://github.com/python/cpython/issues/142163
Reloadhttps://github.com/python/cpython/issues/142163
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/142163
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/142163
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/142163
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/142163
python.h setting HAVE_THREAD_LOCAL breaks numpy buildhttps://github.com/python/cpython/issues/142163#top
https://github.com/ZeroIntensity
3.15new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
buildThe build process and cross-buildhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22build%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/ngoldbaum
https://github.com/ngoldbaum
ngoldbaumhttps://github.com/ngoldbaum
on Dec 1, 2025https://github.com/python/cpython/issues/142163#issue-3683235562
https://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/include/numpy/npy_common.h#L128-L140https://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/include/numpy/npy_common.h#L128-L140
https://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/meson.build#L269-L294https://github.com/numpy/numpy/blob/fb0578d3973e926eee2e68ce9fd9996459b8534b/numpy/_core/meson.build#L269-L294
#140690https://github.com/python/cpython/pull/140690
https://github.com/search?q=HAVE_THREAD_LOCAL+language%3AC+python.h&type=code&p=2https://github.com/search?q=HAVE_THREAD_LOCAL+language%3AC+python.h&type=code&p=2
@ZeroIntensityhttps://github.com/ZeroIntensity
@tacaswellhttps://github.com/tacaswell
gh-142163: Only define HAVE_THREAD_LOCAL when Py_BUILD_CORE is set #142164https://github.com/python/cpython/pull/142164
ZeroIntensityhttps://github.com/ZeroIntensity
3.15new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
buildThe build process and cross-buildhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22build%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.