惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
博客园_首页
IT之家
IT之家
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
S
SegmentFault 最新的问题
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
小众软件
小众软件
有赞技术团队
有赞技术团队

Lobsters

Lunacy | Red Vice CIFSwitch: a non-universal Linux local root vulnerability RIPE NCC session fixation: poaching logins with an Atlas probe GNOME 2.20 but its Web Components Agentic Search for Context Engineering – Leonie Monigatti Garnix is shutting down [not OC] akashina.tngl.sh/jjc Concerning Emacs (and Jazz) Nitpicking the shell history scene in ‘Tron: Legacy’ What's cooking on SourceHut? Q2 2026 The tenth OpenPGP email summit Package managers that package package managers Clojure on Fennel part three: parsing WordPress at 23 Finding Miscompiles for Fun, Not Profit GitHub - creusot-rs/creusot: Creusot helps you prove your Rust code is correct. Announcing Rust 1.96.0 | Rust Blog A Love Letter to Neovim sqlite AGENTS.md Am I a Bad Friend? CSS vs. JavaScript • Josh W. Comeau Erlang Ecosystem Foundation - Supporting the BEAM community A brief note about slot access cost in Common Lisp Keyboard latency probe Rethinking the GNOME clipboard issues Back to the Building Blocks’ Building Blocks Tech Notes: Theseus: translating win32 to wasm Fast is better than slow Content-addressed Rust builds (or, what kache actually caches) Intent to Prototype: Embedding API
update docs with information about building with build.py...
github.com v · 2026-05-26 · via Lobsters

@@ -4,79 +4,81 @@

44

Building

55

========

667-

Linux

8-

=====

7+

A Python distribution can be built on a Linux, macOS or Windows host.

8+

Regardless of the operating system, `uv <https://docs.astral.sh/uv/>`_ must be installed.

9+

Additional operating system requirements are needed and outlined in the following sections.

91010-

The host system must be 64-bit. A Python 3.10+ interpreter must be

11-

available. The execution environment must have access to a Docker

12-

daemon (all build operations are performed in Docker containers for

13-

isolation from the host system).

11+

Regardless of the host, to build a Python distribution::

12+13+

$ uv run build.py

14+15+

On Linux and macOS, ``./build.py`` can also be used.

16+17+

To build a different version of Python::

18+19+

$ uv run build.py --python cpython-3.14

142015-

To build a Python distribution for Linux x64::

21+

Various build options can be specified::

162217-

$ ./build-linux.py

18-

# With profile-guided optimizations (generated code should be faster):

19-

$ ./build-linux.py --options pgo

23+

# With profile-guided optimizations (generated code should be faster)

24+

$ uv run build.py --options pgo

2025

# Produce a debug build.

21-

$ ./build-linux.py --options debug

26+

$ uv run build.py --options debug

2227

# Produce a free-threaded build without extra optimizations

23-

$ ./build-linux.py --options freethreaded+noopt

28+

$ uv run build.py --options freethreaded+noopt

242925-

You can also build another version of Python. e.g.::

30+

Different platforms support different build options.

31+

``uv run build.py --help`` will show the available build options and other usage information.

263227-

$ ./build-linux.py --python cpython-3.13

283329-

To build a Python distribution for Linux x64 using musl libc::

34+

Linux

35+

=====

303631-

$ ./build-linux.py --target x86_64-unknown-linux-musl

37+

The host system must be x86-64 or aarch64.

38+

The execution environment must have access to a Docker

39+

daemon (all build operations are performed in Docker containers for

40+

isolation from the host system).

324133-

Building a 32-bit x86 Python distribution is also possible::

42+

``build.py`` accepts a ``--target-triple`` argument to support building

43+

for non-native targets (i.e. cross-compiling).

344435-

$ ./build-linux.py --target i686-unknown-linux-gnu

45+

This option can be used to build for musl libc::

364637-

As are various other targets::

47+

$ ./build.py --target-triple x86_64-unknown-linux-musl

384839-

$ ./build-linux.py --target aarch64-unknown-linux-gnu

40-

$ ./build-linux.py --target armv7-unknown-linux-gnueabi

41-

$ ./build-linux.py --target armv7-unknown-linux-gnueabihf

42-

$ ./build-linux.py --target loongarch64-unknown-linux-gnu

43-

$ ./build-linux.py --target mips-unknown-linux-gnu

44-

$ ./build-linux.py --target mipsel-unknown-linux-gnu

45-

$ ./build-linux.py --target ppc64le-unknown-linux-gnu

46-

$ ./build-linux.py --target riscv64-unknown-linux-gnu

47-

$ ./build-linux.py --target s390x-unknown-linux-gnu

49+

Or on a x86-64 host for different architectures::

485049-

Additionally, an arm64 macOS host can be used to build Linux aarch64 targets

50-

using Docker::

51+

$ ./build.py --target-triple i686-unknown-linux-gnu

52+

$ ./build.py --target-triple armv7-unknown-linux-gnueabi

53+

$ ./build.py --target-triple armv7-unknown-linux-gnueabihf

54+

$ ./build.py --target-triple loongarch64-unknown-linux-gnu

55+

$ ./build.py --target-triple mips-unknown-linux-gnu

56+

$ ./build.py --target-triple mipsel-unknown-linux-gnu

57+

$ ./build.py --target-triple ppc64le-unknown-linux-gnu

58+

$ ./build.py --target-triple riscv64-unknown-linux-gnu

59+

$ ./build.py --target-triple s390x-unknown-linux-gnu

516052-

$ ./build-linux.py --target aarch64-unknown-linux-gnu

53615462

macOS

5563

=====

566457-

The XCode command line tools must be installed. A Python 3 interpreter

58-

is required to execute the build. ``/usr/bin/clang`` must exist.

65+

The XCode command line tools must be installed.

66+

``/usr/bin/clang`` must exist.

596760-

macOS SDK headers must be installed. Try running ``xcode-select --install``

61-

to install them if you see errors about e.g. ``stdio.h`` not being found.

62-

Verify they are installed by running ``xcrun --show-sdk-path``. It

63-

should print something like

68+

macOS SDK headers must be installed.

69+

If you see errors such as ``stdio.h`` not being found, try running ``xcode-select --install`` to install them.

70+

Verify they are installed by running ``xcrun --show-sdk-path``.

71+

It should print something like

6472

``/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk``

6573

on modern versions of macOS.

667467-

To build a Python distribution for macOS::

75+

The ``--target-triple`` argument can be used to build for an Intel Mac on an arm64 (Apple Silicon) host::

687669-

$ ./build-macos.py

77+

$ ./build.py --target-triple x86_64-apple-darwin

707871-

macOS uses the same build code as Linux, just without Docker.

72-

So similar build configuration options are available.

79+

Additionally, an arm64 macOS host can be used to build Linux aarch64 targets using Docker::

738074-

``build-macos.py`` accepts a ``--target-triple`` argument to support building

75-

for non-native targets (i.e. cross-compiling). By default, macOS builds target

76-

the currently running architecture. e.g. an Intel Mac will target

77-

``x86_64-apple-darwin`` and an M1 (ARM) Mac will target ``aarch64-apple-darwin``.

78-

It should be possible to build an ARM distribution on an Intel Mac and an Intel

79-

distribution on an ARM Mac.

81+

$ ./build.py --target-triple aarch64-unknown-linux-gnu

80828183

The ``APPLE_SDK_PATH`` environment variable is recognized as the path

8284

to the Apple SDK to use. If not defined, the build will attempt to find

@@ -89,24 +91,17 @@ an Intel 10.15 machine (as long as the 11.0+ SDK is used).

8991

Windows

9092

=======

919392-

Visual Studio 2017 (or later) is required. A compatible Windows SDK is required

93-

(10.0.17763.0 as per CPython 3.7.2).

94-95-

* A ``git.exe`` on ``PATH`` (to clone ``libffi`` from source).

96-

* An installation of Cygwin with the ``autoconf``, ``automake``, ``libtool``,

97-

and ``make`` packages installed. (``libffi`` build dependency.)

98-99-

To build a dynamically linked Python distribution for Windows x64::

100-101-

$ py.exe build-windows.py --options noopt

102-103-

It's also possible to build with optional PGO optimizations::

94+

Visual Studio 2022 (or later) is required.

95+

A compatible Windows SDK is required (10.0.26100.0 as of CPython 3.10).

96+

A ``git.exe`` must be on ``PATH`` (to clone ``libffi`` from source).

97+

Cygwin must be installed with the ``autoconf``, ``automake``, ``libtool``,

98+

and ``make`` packages. (``libffi`` build dependency.)

10499105-

$ py.exe build-windows.py --options pgo

100+

Building can be done from the ``x64 Native Tools Command Prompt``, by calling

101+

the vcvars batch file, or by adjusting the ``PATH`` and environment variables.

106102107-

You will need to specify the path to a ``sh.exe`` installed from cygwin. e.g.

103+

You will need to specify the path to ``sh.exe`` from cygwin::

108104109-

$ py.exe build-windows.py --python cpython-3.13 --sh c:\cygwin\bin\sh.exe --options noopt

105+

$ uv run build.py --sh c:\cygwin\bin\sh.exe

110106111-

To build a 32-bit x86 binary, simply use an ``x86 Native Tools

112-

Command Prompt`` instead of ``x64``.

107+

To build a 32-bit x86 binary, simply use an ``x86 Native Tools Command Prompt`` instead of ``x64``.