experiencing strange hangs when recompiling

162 views
Skip to first unread message

Martin R

unread,
Oct 11, 2025, 5:03:00 PMOct 11
to sage-devel
since 10.8.beta6, on ubuntu, I am experiencing strange hangs when trying to recompile sage, for example most recently when doing sage -i dot2tex.

I have no idea how to debug this, here is what make printed last.  top tells me that meson is now using all of the cpu.

After such a failed recompilation, sage does not start anymore.

Martin

make --no-print-directory sagelib-SAGE_VENV-no-deps
[sagelib-10.8.beta6] Setting up build directory /home/martin/sage-trac/local/var/lib/sage/venv-python3.12/var/tmp/sage/build/sagelib-10.8.beta6
[sagelib-10.8.beta6] Host system: Linux toolbox 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
[sagelib-10.8.beta6] C compiler: gcc, Using built-in specs., COLLECT_GCC=gcc, COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper, OFFLOAD_T
ARGET_NAMES=nvptx-none:amdgcn-amdhsa, OFFLOAD_TARGET_DEFAULT=1, Target: x86_64-linux-gnu, Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3
.0-6ubuntu2~24.04' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-
major-version-only --program-suffix=-13 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-inclu
ded-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=ye
s --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --wit
h-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --wit
h-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-13-fG75R
i/gcc-13-13.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-13-fG75Ri/gcc-13-13.3.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --e
nable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serial
ization=2, Thread model: posix, Supported LTO compression algorithms: zlib zstd, gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)
[sagelib-10.8.beta6] No stamp file for package 'sagelib' in /home/martin/sage-trac/local/var/lib/sage/venv-python3.12/var/lib/sage/installed
[sagelib-10.8.beta6] No spkg-legacy-uninstall script; nothing to do
[sagelib-10.8.beta6] [spkg-install] Installing sagelib-10.8.beta6 (editable mode)
[sagelib-10.8.beta6] [spkg-install] Using pip 24.2 from /home/martin/sage-trac/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/pip (python 3.
12)
[sagelib-10.8.beta6] [spkg-install] Obtaining file:///home/martin/sage-trac
[sagelib-10.8.beta6] [spkg-install]   Checking if build backend supports build_editable: started
[sagelib-10.8.beta6] [spkg-install]   Running command Checking if build backend supports build_editable
[sagelib-10.8.beta6] [spkg-install]   Checking if build backend supports build_editable: finished with status 'done'
[sagelib-10.8.beta6] [spkg-install]   Preparing editable metadata (pyproject.toml): started
[sagelib-10.8.beta6] [spkg-install]   Running command Preparing editable metadata (pyproject.toml)
[sagelib-10.8.beta6] [spkg-install]   + meson setup --reconfigure /home/martin/sage-trac /home/martin/sage-trac/build/sage-distro -Dbuildtype=release -Db_nde
bug=if-release -Db_vscrt=md --default-library=static -DSAGE_LOCAL=/home/martin/sage-trac/local --native-file=/home/martin/sage-trac/build/sage-distro/meson-p
ython-native-file.ini


Martin R

unread,
Oct 11, 2025, 6:36:48 PMOct 11
to sage-devel
Turns out that this is reproducible.

make distclean
make
sage -i dot2tex

results in a hang and a non-working sage.

Martin

Volker Braun

unread,
Oct 11, 2025, 7:12:02 PMOct 11
to sage-devel
Does it actually hang there? the "meson setup" step takes quite a long time but eventually completes for me

Dima Pasechnik

unread,
Oct 11, 2025, 7:37:46 PMOct 11
to sage-...@googlegroups.com
and if you do

   make dot2tex

instead?

Dima Pasechnik

unread,
Oct 11, 2025, 10:14:24 PMOct 11
to sage-...@googlegroups.com
it might take a lot of time to create the correct list of targets, as you don't follow the best way, which is

./configure --enable-dot2tex=yes
make # this should also build do2tex



--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-devel/6c3d9ed1-a99f-4c4c-a8b8-278d2338bbd9n%40googlegroups.com.

Martin R

unread,
Oct 12, 2025, 3:36:04 AMOct 12
to sage-devel
On Sunday, 12 October 2025 at 04:14:24 UTC+2 dim...@gmail.com wrote:
it might take a lot of time to create the correct list of targets, as you don't follow the best way, which is

./configure --enable-dot2tex=yes
make # this should also build do2tex

I thought that this would be the default (if installed, which it is):

--enable-dot2tex={no|if_installed (default)|yes}
                         enable build and use of the optional package dot2tex: Create PGF/TikZ
                         commands from Graphviz output
                         * package info: ./sage -info dot2tex

I'll try anyway.  But in fact, that also means that I have to be more careful than previously, since there are several packages I only install when I notice that something isn't working (eg., dot2tex, lie, coxeter3, gap_packages, fricas, bliss, macaulay2 ...)
 
On Sat, Oct 11, 2025 at 6:12 PM Volker Braun <vbrau...@gmail.com> wrote:
Does it actually hang there? the "meson setup" step takes quite a long time but eventually completes for me

More than 3 minutes?  If so, it would be nice if there could be some progress output.

I'll report,

Martin

Martin R

unread,
Oct 12, 2025, 3:38:43 AMOct 12
to sage-devel
(for comparison, previously installing dot2tex took just a few seconds)

Martin R

unread,
Oct 12, 2025, 3:47:27 AMOct 12
to sage-devel
OK, it took about ten minutes with configure --enable-dot2tex=yes

Martin

Dima Pasechnik

unread,
Oct 12, 2025, 11:25:58 PMOct 12
to sage-devel
I do see a progress output while meson is generating build.ninja (i.e. ninja's makefile), and it took about 230 seconds of wallclock time.
(Often it's much faster, but major rebuilds, when you touched configure.ac and what not, are like this)

[sagelib-10.8.beta6] [spkg-install]   Build targets in project: 1680
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]   SageMath 10.8.beta6
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]     User defined options
[sagelib-10.8.beta6] [spkg-install]       Native files   : /home/dima/software/sage-src/build/pkgs/../platform/meson/sage-configure-native-file.ini
[sagelib-10.8.beta6] [spkg-install]                        /home/dima/software/sage-src/build/sage-distro/meson-python-native-file.ini
[sagelib-10.8.beta6] [spkg-install]       SAGE_LOCAL     : /home/dima/software/sage-src/local
[sagelib-10.8.beta6] [spkg-install]       b_ndebug       : if-release
[sagelib-10.8.beta6] [spkg-install]       b_vscrt        : md
[sagelib-10.8.beta6] [spkg-install]       buildtype      : release
[sagelib-10.8.beta6] [spkg-install]       default_library: static
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]   Found ninja-1.13.1 at /usr/bin/ninja
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]   Generating targets:   0%|          | 0/1680 eta ?
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  11%|█▏        | 189/1680 eta 00:00
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  22%|██▎       | 378/1680 eta 00:00
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  51%|█████     | 850/1680 eta 00:00
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  84%|████████▍ | 1419/1680 eta 00:00
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  84%|████████▍ | 1419/1680 eta 00:00
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  89%|████████▉ | 1494/1680 eta 00:04
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  89%|████████▉ | 1495/1680 eta 00:04
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  89%|████████▉ | 1495/1680 eta 00:04
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  91%|█████████ | 1530/1680 eta 00:10
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  91%|█████████ | 1531/1680 eta 00:10
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  91%|█████████ | 1531/1680 eta 00:10
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  91%|█████████▏| 1537/1680 eta 00:40
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  92%|█████████▏| 1538/1680 eta 00:40
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  92%|█████████▏| 1538/1680 eta 00:40
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  92%|█████████▏| 1552/1680 eta 00:44
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  92%|█████████▏| 1553/1680 eta 00:44
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  92%|█████████▏| 1553/1680 eta 00:44
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  94%|█████████▍| 1576/1680 eta 00:50
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  94%|█████████▍| 1577/1680 eta 00:50
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  94%|█████████▍| 1577/1680 eta 00:50
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  95%|█████████▌| 1600/1680 eta 00:49
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  95%|█████████▌| 1601/1680 eta 00:49
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  95%|█████████▌| 1601/1680 eta 00:49
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  96%|█████████▌| 1616/1680 eta 02:12
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  96%|█████████▋| 1617/1680 eta 02:07
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  98%|█████████▊| 1644/1680 eta 00:39
[sagelib-10.8.beta6] [spkg-install]   Generating targets:  99%|█████████▉| 1663/1680 eta 00:13
[sagelib-10.8.beta6] [spkg-install]   Generating targets: 100%|█████████▉| 1677/1680 eta 00:02
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]
[sagelib-10.8.beta6] [spkg-install]   Writing build.ninja:   0%|          | 0/3487 eta ?

That's of course a constraint satisfaction problem to find the targets to rebuild, and it's not a very easy one.
I actually don't know what these almost 1700 dependencies are. Are they the sage-distro dependencies, or only sagelib?

Once build.ninja is generated, things move quite fast in general.

Dima

Tobia...@gmx.de

unread,
Oct 13, 2025, 12:15:11 AMOct 13
to sage-devel
Most of these targets are coming from the docbuild. Does someone knows if sphinx's incremental rebuild is now good enough that we can remove our custom-made multi-stage docbuild? 

Dima Pasechnik

unread,
Oct 13, 2025, 8:12:08 AMOct 13
to sage-...@googlegroups.com, Tobias Diez


On October 12, 2025 11:15:10 PM CDT, "'Tobia...@gmx.de' via sage-devel" <sage-...@googlegroups.com> wrote:
>Most of these targets are coming from the docbuild.

Why would one consider docbuild targets
for the task of building sagelib?

Shouldn't src/doc be considered separately?


> Does someone knows if
>sphinx's incremental rebuild is now good enough that we can remove our
>custom-made multi-stage docbuild?

As far as I understand, the main objective of the old docbuild was to speed it up, compared to how sphinx was doing more than 10 years ago. I imagine it's good enough now, but it doesn't seem to be a trivial task to rewire our docs to use the standard sphinx build.

Dima

Tobia...@gmx.de

unread,
Oct 13, 2025, 9:29:19 AMOct 13
to sage-devel
The doc-build targets are only created but never invoked if you install sagelib - they get only triggered as subtargets of the doc-html target. 

But it's the declaration of the targets that takes so long here, probably because the dependency tree is quite big (every html doc depends on all inventory docs etc). Hopefully I find some time next week to optimize a bit.

Travis Scrimshaw

unread,
Oct 18, 2025, 11:01:03 AMOct 18
to sage-devel
This meson setup issue seems to happen every time I want to add an additional optional package. This is completely untenable waiting 10+ minutes every time as I want to install a number of them.

Travis

Dima Pasechnik

unread,
Oct 18, 2025, 6:55:26 PMOct 18
to sage-...@googlegroups.com, Travis Scrimshaw, Kwankyu Lee, Tobias Diez
A quick hack to basically cut these delays is to disable doc building - comment out dealing with Sage docs.
As long as you don't need to rebuild the docs, you don't need that line (which triggers re-scanning of doc targets)

--- a/src/meson.build
+++ b/src/meson.build
@@ -280,4 +280,4 @@ src = meson.current_source_dir()
 
 # Submodules
 subdir('sage')
-subdir('doc')
+# subdir('doc')


We can make this `subdir('doc') conditional on a parameter. but it's unclear to me whether switching it on/off is seamless.
(if you had it off, and then turn it on, then it seems it's not automatically starting to re-scan 'doc').
But I am not a meson expert.

HTH,
Dima







--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Tobia...@gmx.de

unread,
Oct 18, 2025, 9:01:38 PMOct 18
to sage-devel
Does the workaround mentioned by Dima above mitigates the issue?

If it is really the doc build, then the cleanest solution would be to completely reimplement it to be just a single `sphinx` call - instead of having hundreds of targets for this that each depend on each other (each 'doc' has 4 - inventory, references, html, pdf; and you have to run first all inventory targets before you can do the references, and then afterwards the html).
Reply all
Reply to author
Forward
0 new messages