Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025

Conversation

mmoll
Copy link
Contributor

@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
Contributor Author

mmoll commented May 8, 2025

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

@tianon tianon merged commit 4c3ad30 into docker-library:master May 9, 2025
47 checks passed
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 9, 2025
Changes:

- docker-library/python@4c3ad300: Merge pull request docker-library/python#1038 from mmoll/no_lto_on_riscv
- docker-library/python@90aa4272: disable LTO in RISC-V to speed up build
@mmoll mmoll deleted the no_lto_on_riscv branch May 9, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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