This commit is contained in:
Nathan Goldbaum 2025-01-21 13:28:54 -05:00 committed by GitHub
commit b2b97168ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View File

@ -164,6 +164,12 @@ You can set certain environment variables to control the build process.
* `PYTHON_BUILD_SKIP_HOMEBREW`, if set, will not search for libraries installed by Homebrew when it would normally will.
* `PYTHON_BUILD_USE_HOMEBREW`, if set, will search for libraries installed by Homebrew when it would normally not.
* `PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA`, override the Homebrew OpenSSL formula to use.
* `PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL`, add DWARF debug information on MacOS. Available on Python 3.12 and newer.
* `PYTHON_BUILD_FREE_THREADING`, build an interpreter with the free-threaded (GIL-disabled) ABI. Available on Python 3.13 and newer.
* `PYTHON_BUILD_ADDRESS_SANITIZER`, build an interpreter with address sanitizer.
* `PYTHON_BUILD_MEMORY_SANITIZER`, build an interpreter with memory sanitizer.
* `PYTHON_BUILD_UNDEFINED_BEHAVIOR_SANITIZER`, build an interpreter with undefined behavior sanitizer.
* `PYTHON_BUILD_THREAD_SANITIZER`, build an interpreter with thread sanitizer. Available on Python 3.13 and newer.
* `PYTHON_BUILD_ROOT` overrides the default location from where build definitions
in `share/python-build/` are looked up.
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get

View File

@ -826,6 +826,10 @@ build_package_standard_build() {
fi
use_dsymutil || true
use_free_threading || true
use_address_sanitizer || true
use_memory_sanitizer || true
use_undefined_behavior_sanitizer || true
use_thread_sanitizer || true
fi
( if [[ -n "${!PACKAGE_CFLAGS}" ]]; then
@ -1784,6 +1788,30 @@ use_free_threading() {
fi
}
use_address_sanitizer() {
if [[ -n "$PYTHON_BUILD_ADDRESS_SANITIZER" ]]; then
package_option python configure --with-address-sanitizer
fi
}
use_memory_sanitizer() {
if [[ -n "$PYTHON_BUILD_MEMORY_SANITIZER" ]]; then
package_option python configure --with-memory-sanitizer
fi
}
use_undefined_behavior_sanitizer() {
if [[ -n "$PYTHON_BUILD_UNDEFINED_BEHAVIOR_SANITIZER" ]]; then
package_option python configure --with-undefined-behavior-sanitizer
fi
}
use_thread_sanitizer() {
if [[ -n "$PYTHON_BUILD_THREAD_SANITIZER" ]]; then
package_option python configure --with-thread-sanitizer
fi
}
build_package_enable_shared() {
package_option python configure --enable-shared
}