Title: build-details.json is incorrect when using ./configure --with-build-python on a non-cross build · Issue #140266 · python/cpython · GitHub
Open Graph Title: build-details.json is incorrect when using ./configure --with-build-python on a non-cross build · Issue #140266 · python/cpython
X Title: build-details.json is incorrect when using ./configure --with-build-python on a non-cross build · Issue #140266 · python/cpython
Description: Bug report Bug description: We noticed that python-build-standalone's build-details.json contains "platform": "" on non-cross builds. I think I know why. For consistency (I think), python-build-standalone always uses ./configure --with-b...
Open Graph Description: Bug report Bug description: We noticed that python-build-standalone's build-details.json contains "platform": "" on non-cross builds. I think I know why. For consistency (I think), python-build-sta...
X Description: Bug report Bug description: We noticed that python-build-standalone's build-details.json contains "platform": "" on non-cross builds. I think I know why. For consistency (I ...
Opengraph URL: https://github.com/python/cpython/issues/140266
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"build-details.json is incorrect when using ./configure --with-build-python on a non-cross build","articleBody":"# Bug report\n\n### Bug description:\n\nWe noticed that python-build-standalone's build-details.json contains `\"platform\": \"\"` on non-cross builds.\n\nI think I know why. For consistency (I think), python-build-standalone always uses `./configure --with-build-python` on both cross builds and normal builds.\n\nThis causes configure.ac to do\n```sh\n PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`) '$with_build_python\n```\n\n(line 167 in 3.15.0a1), as opposed to `PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'` in the without-build-python case.\n\nHowever, `$_PYTHON_HOST_PLATFORM` is only actually _set_ to something in the cross-compile case (line 820 in 3.15.0a1), meaning that `$PYTHON_FOR_BUILD` is effectively doing `_PYTHON_HOST_PLATFORM= python3`.\n\nThe fact that this variable is an empty string, in turn, causes `sysconfig.get_platform()` to return an empty string:\n\n```\n$ uvx python3.15\nPython 3.15.0a1 (main, Oct 14 2025, 21:28:08) [Clang 20.1.4 ] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import sysconfig\n>>> sysconfig.get_platform()\n'linux-x86_64'\n>>> import os\n>>> os.environ['_PYTHON_HOST_PLATFORM'] = ''\n>>> sysconfig.get_platform()\n''\n```\n\nwhich makes generate-build-details.py output an empty string.\n\nArguably this is two bugs: configure.ac should not set `_PYTHON_HOST_PLATFORM` to an empty string, and sysconfig should not misbehave if `_PYTHON_HOST_PLATFORM` is set to an empty string (and should treat that as equivalent to being unset). Or maybe only one of these is a bug and the other is intended behavior. Also, of course, generate-build-details.py could work around this itself. I'm happy to provide a PR for any or all of these given some feedback on which direction to take this.\n\nThis applies to 3.14+ (all versions with build-details.json). If it's helpful, here are our full build logs for [3.14](https://github.com/astral-sh/python-build-standalone/actions/runs/18510022224/job/52748664133) and [3.15](https://github.com/astral-sh/python-build-standalone/actions/runs/18510022224/job/52748664126) in GHA; expand the \"Build\" section and search for `generate-build-details`. I've patched generate-build-details.py with `print(f\"generate-build-details debug: {sysconfig=} {sysconfig.get_platform()=}\", file=sys.stderr)`.\n\n(FYI I am probably about to file another bug about build-details.json generation in a moment, which might have a related cause and influence what the fix should be. EDIT: was already reported, #136267, left some analysis there)\n\n### CPython versions tested on:\n\n3.14\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-142375\n* gh-161530\n* gh-162373\n* gh-162374\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/geofft","@type":"Person","name":"geofft"},"datePublished":"2025-10-17T17:53:45Z","url":"https://github.com/python/cpython/issues/140266"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eb8d1dce-e33f-e8f2-3e0e-a84af52892a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8342:3DD488:362B16C:44E1F51:6B01EC1B |
| html-safe-nonce | c826ec5fc56a358c800cd937c40035b169ea9b572b986ae7d3d35e20b093b8fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzQyOjNERDQ4ODozNjJCMTZDOjQ0RTFGNTE6NkIwMUVDMUIiLCJ2aXNpdG9yX2lkIjoiNjMzMjU5NTc1ODM1Njg4NDUwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 321e5c967b6198ba5bbb934916b22fbb708fd56fa5dd14e6c3a15a0e9c210080 |
| hovercard-subject-tag | issue:3527016221 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/140266/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee4ed23a7fa23158c4de64f276701e1d9249dec417b5a532d6f4d969a0a74d71/python/cpython/issues/140266 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee4ed23a7fa23158c4de64f276701e1d9249dec417b5a532d6f4d969a0a74d71/python/cpython/issues/140266 |
| og:image:alt | Bug report Bug description: We noticed that python-build-standalone's build-details.json contains "platform": "" on non-cross builds. I think I know why. For consistency (I think), python-build-sta... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | geofft |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width