Skip to content

disable LTO in RISC-V to speed up build #1038

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmoll
Copy link

@mmoll mmoll commented May 5, 2025

Closes #1011

@yosifkit
Copy link
Member

yosifkit commented May 8, 2025

After doing some emulated, local tests, I think this seems reasonable to try again. It'll be a less optimized python, but that's better than no riscv64 python image. (though users could just install the alpine-provided python3 package in an image FROM alpine, but then they are limited to a specific version)

None of these builds are as slow as I was getting in #931 and it's on the same machine. 😕 🤷

$ # --with-lto
$ for ver in 3.10 3.11 3.12; do time docker build --no-cache --platform linux/riscv64 ./$ver/alpine3.20/; done
real    19m13.374s

real    30m32.618s

real    33m12.560s

$ # without lto
$ for ver in 3.10 3.11 3.12; do time docker build --no-cache --platform linux/riscv64 ./$ver/alpine3.20/; done
real    8m49.526s

real    9m41.161s

real    9m22.683s

Requested change: also remove this part of generate-stackbrew-library.sh to stop removing the riscv64 from the architecture lists.

@@ -182,7 +182,7 @@ RUN set -eux; \
# <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance
# <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance
# skip LTO on alpine on riscv64: https://github.com/docker-library/python/pull/935, https://github.com/docker-library/python/pull/1038

@mmoll mmoll force-pushed the no_lto_on_riscv branch from fd64c04 to 90aa427 Compare May 8, 2025 22:27
@mmoll
Copy link
Author

mmoll commented May 8, 2025

thanks for the comments, should all be done :bowtie:

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Docker Images for Python 3.11, 3.12, 3.13, 3.14 on RISCV64 Architecture
3 participants