-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
--enable-experimental-jit
fails to build: AssertionError: SHT_NOTE
in 3.13.0b1
#118836
Comments
Thanks for the report! @savannahostrowski: I think we don’t care about these sections, so it’s probably just a matter of updating the assert. (There may be other missing sections too.) |
This assert (and others) were originally added early on to make sure we didn’t miss any “important” sections when parsing. Not sure if it’s too fragile in its current form, or if |
Thanks for the report! Makes sense @brandtbucher, I can take a look later today if you'd like. |
Alright, so I've probably spent too long trying to set up a Gentoo dev environment 😅 and I'm going to admit defeat. @mgorny Would you be able to try adding that statement to the assert and let me know if that resolves the issue? |
I'm happy to help (either now or in future) if you need it, fwiw (and/or can give a Dockerfile where hopefully it's reproducible). Would either of those help? |
Ah! If you have a Dockerfile, that'd be amazing. I tried to write one of my own and got stuck in a loop of masked packages. Then, once I got LLVM to start installing, it ultimately failed... |
Let me know how this goes... FROM gentoo/stage3
# Disable bits which don't work within Docker.
RUN echo 'FEATURES="-ipc-sandbox -pid-sandbox -network-sandbox -usersandbox -mount-sandbox -sandbox"' | cat >> /etc/portage/make.conf
# Speed things up a bit.
RUN echo 'FEATURES="${FEATURES} parallel-install parallel-fetch -merge-sync"' | cat >> /etc/portage/make.conf
RUN echo 'EMERGE_DEFAULT_OPTS="--binpkg-respect-use=y --getbinpkg=y --autounmask-write --autounmask-continue --autounmask-keep-keywords=y --autounmask-use=y"' | cat >> /etc/portage/make.conf
# XXX: Replace -j$(nproc) with some smaller -jN if you run out of RAM
RUN echo "MAKEOPTS='-j$(nproc) -l$(nproc)'" >> /etc/portage/make.conf
RUN emerge-webrsync --quiet
RUN getuto
RUN echo "*/*" >> /etc/portage/package.accept_keywords/all
# By doing this step first (just the deps, not Python itself), we avoid
# losing all our progress if/when Python fails to build.
RUN USE=jit emerge --verbose --oneshot --onlydeps dev-lang/python:3.13
RUN mkdir -p /etc/portage/patches/dev-lang/python:3.13
# You can put patches in /etc/portage/patches/dev-lang/python:3.13/aaa.patch
# to test them.
CMD USE=jit emerge --verbose --oneshot dev-lang/python:3.13 To build it:
Building LLVM takes a little while - it needs LLVM 18 for the failure, I think, which isn't yet marked stable in Gentoo so there's no binary packages available for it unfortunately. I added a note about MAKEOPTS in the Dockerfile -- if you get an issue, try reducing that first. |
Thanks for writing the Dockerfile! Unfortunately, I landed in the same place that I did last night when trying to write my own Dockerfile. I keep hitting this error: 857.1 * ERROR: sys-devel/llvm-18.1.5::gentoo failed (compile phase):
857.1 * ninja -v -j11 -l11 distribution failed
857.1 *
857.1 * Call stack:
857.1 * ebuild.sh, line 136: Called src_compile
857.1 * environment, line 3924: Called multilib-minimal_src_compile
857.1 * environment, line 2731: Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2998: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2691: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2689: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
857.1 * environment, line 600: Called multilib-minimal_abi_src_compile
857.1 * environment, line 2725: Called multilib_src_compile
857.1 * environment, line 3218: Called tc-env_build 'cmake_build' 'distribution'
857.1 * environment, line 4159: Called cmake_build 'distribution'
857.1 * environment, line 1425: Called eninja 'distribution'
857.1 * environment, line 1896: Called die
857.1 * The specific snippet of code:
857.1 * "$@" || die -n "${*} failed"
857.1 *
857.1 * If you need support, post the output of `emerge --info '=sys-devel/llvm-18.1.5::gentoo'`,
857.1 * the complete build log and the output of `emerge -pqv '=sys-devel/llvm-18.1.5::gentoo'`.
857.1 * The complete build log is located at '/var/tmp/portage/sys-devel/llvm-18.1.5/temp/build.log'.
857.1 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/llvm-18.1.5/temp/environment'.
857.1 * Working directory: '/var/tmp/portage/sys-devel/llvm-18.1.5/work/llvm_build-.arm64'
857.1 * S: '/var/tmp/portage/sys-devel/llvm-18.1.5/work/llvm'
857.1
857.1 >>> Failed to emerge sys-devel/llvm-18.1.5, Log file:
857.1
857.1 >>> '/var/tmp/portage/sys-devel/llvm-18.1.5/temp/build.log'
857.1 * Messages for package sys-libs/libomp-18.1.5:
857.1 * Unable to find kernel sources at /usr/src/linux
857.1 * Unable to calculate Linux Kernel version for build, attempting to use running version
857.1 * Messages for package sys-devel/llvm-18.1.5:
857.1 * ERROR: sys-devel/llvm-18.1.5::gentoo failed (compile phase):
857.1 * ninja -v -j11 -l11 distribution failed
857.1 *
857.1 * Call stack:
857.1 * ebuild.sh, line 136: Called src_compile
857.1 * environment, line 3924: Called multilib-minimal_src_compile
857.1 * environment, line 2731: Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2998: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2691: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
857.1 * environment, line 2689: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
857.1 * environment, line 600: Called multilib-minimal_abi_src_compile
857.1 * environment, line 2725: Called multilib_src_compile
857.1 * environment, line 3218: Called tc-env_build 'cmake_build' 'distribution'
857.1 * environment, line 4159: Called cmake_build 'distribution'
857.1 * environment, line 1425: Called eninja 'distribution'
857.1 * environment, line 1896: Called die
857.1 * The specific snippet of code:
857.1 * "$@" || die -n "${*} failed"
857.1 *
857.1 * If you need support, post the output of `emerge --info '=sys-devel/llvm-18.1.5::gentoo'`,
857.1 * the complete build log and the output of `emerge -pqv '=sys-devel/llvm-18.1.5::gentoo'`.
857.1 * The complete build log is located at '/var/tmp/portage/sys-devel/llvm-18.1.5/temp/build.log'.
857.1 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/llvm-18.1.5/temp/environment'.
857.1 * Working directory: '/var/tmp/portage/sys-devel/llvm-18.1.5/work/llvm_build-.arm64'
857.1 * S: '/var/tmp/portage/sys-devel/llvm-18.1.5/work/llvm'
857.1
857.1
857.1
857.1
857.1
857.1 * Regenerating GNU info directory index...
857.1 * Processed 104 info files.
857.1
857.1 * IMPORTANT: 16 news items need reading for repository 'gentoo'.
857.1 * Use eselect news read to view new items.
857.1
------
Dockerfile:17
--------------------
15 | # By doing this step first (just the deps, not Python itself), we avoid
16 | # losing all our progress if/when Python fails to build.
17 | >>> RUN USE=jit emerge --verbose --oneshot --onlydeps dev-lang/python:3.13
18 | RUN mkdir -p /etc/portage/patches/dev-lang/python:3.13
19 |
--------------------
ERROR: failed to solve: process "/bin/sh -c USE=jit emerge --verbose --oneshot --onlydeps dev-lang/python:3.13" did not complete successfully: exit code: 1``` |
My guess is you OOMed (check dmesg?) -- could you try changing the MAKEOPTS line to -j4 or something? (You want it to be roughly: min(threads_on_your_cpu, RAM/2GB).) |
I can confirm that CPython built correctly now (i.e. with that assert change). I'm testing some packages too, no regressions so far. |
@thesamesam Thanks - I realized that right after sending that reply. That said, this doesn't repro on arm64 and when I try to build the image for amd64, I get an illegal exception (I'm on an M3 Pro). @mgorny Thanks for taking a look and validating that we build correctly now with that change. If you're able to put up a PR, that'd be much appreciated. Happy to review! |
…pythonGH-119000) (cherry picked from commit e04cd96) Co-authored-by: Michał Górny <mgorny@gentoo.org>
Looks like this can be closed now, as #119000 and #119020 have been merged. Thanks @mgorny and @thesamesam for your help! |
Bug report
Bug description:
When trying to build CPython with
--enable-experimental-jit
against LLVM 18.1.5, I'm getting the following error:I don't recall which alpha I've tested it last on, but I'm pretty sure it used to work (against LLVM 16). I'm getting the same result on main as of 7c87ce7.
This is Gentoo Linux amd64.
I've reproduced by doing (in git repo):
Resulting log (70k): python-log.txt
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: