astral-sh / astral-sh/python-build-standalone
Unable to compile cpython-3.x with optimizations on Ubuntu
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 314
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
# Summary
I've tried to build Python on both of the Ubuntu platforms listed below, and the process always fails on `cpython`. Over several iterations on the Ubuntu server VM:
- Tried to compile with flags `--python=cypthon-3.8` and `--optimizations=pgo+lto`, but failed ([gist](https://gist.github.com/jwarner112/9f18f3e77eb4d60c10f74a09bff37f13)).
- Tried to compile with flags `--python=cypthon-3.7` and `--optimizations=pgo+lto`, but failed ([gist](https://gist.github.com/jwarner112/8c29c0297d3284bedad159db66ac516d)).
- Tried to compile with flags `--python=cypthon-3.7` and `--optimizations=pgo`, but failed ([gist](https://gist.github.com/jwarner112/31e2de9a3c2b2dfe02ee0e385a58683e)).
- Tried to compile with the `--python=cpython-3.7` flag but *no optimizations* and succeeded! ([download](https://github.com/indygreg/python-build-standalone/files/4637822/cpython-3.7.7-x86_64-unknown-linux-musl-noopt-20200516T0354.tar.zst.zip) and slice off the `.zip` from the end, sha256 is `f994d12161adcf3ced5ad2daf964cab6e8f70913cc90534ee3ac1feb41420404`).
- Tried to compile with the `--python=cpython-3.8` flag but *no optimizations* and succeeded! ([download](https://github.com/indygreg/python-build-standalone/files/4637823/cpython-3.8.2-x86_64-unknown-linux-musl-noopt-20200516T0415.tar.zst.zip) and slice off the `.zip` from the end, sha256 is `9743d8927e82503bd464bf645014ade886a01f29a8d20999081d4acb95050f41`)
With this evidence, I'd have to say that @indygreg is [probably right about musl not liking optimization](https://github.com/indygreg/python-build-standalone/issues/42#issuecomment-629573231).
# Host Information
| Platform | Laptop |
| --- | --- |
| **Notes** | Default development machine |
| **System Model** | `Purism Librem 15v3 w/ TPM` |
| **Operating System** | `Ubuntu 18.04 LTS x86_64` |
| **Kernel** | `5.3.0-51-generic #44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020` |
| **CPU** | `Intel Core i7-6500U @ 2.5GHz (x4)`
| **RAM** | `8GB` |
| Platform | Tower PC |
| --- | --- |
| **Notes** | Used *only* to host the Ubuntu server VM, via `VirtualBox v6.1.6 r137129 (Qt5.6.2)`; *not used for building itself!* |
| **System Model** | `Beefy (custom) build` |
| **Operating System** | `Windows 10 Pro 64-bit, v1909 (build 18363.836)` |
| **CPU** | `AMD Ryzen 9 3900X (x12)`
| **RAM** | `32GB` |
| Platform | Ubuntu server (virtualized) |
| --- | --- |
| **Notes** | AMD-V hypervisor, Nested paging, PAE/NX, and KVM paravirtualization are all enabled |
| **Operating System** | `Ubuntu Server 20.04 LTS x86_64` |
| **Kervel** | `5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020`
| **CPU** | `AMD Ryzen 9 3900X (x12)` |
| **RAM** | `16GB` |
Contributor guide
Assessment
This issue has not been assessed yet.