Skip to content

Live bootstrap to guix#578

Draft
vxtls wants to merge 243 commits intofosslinux:masterfrom
vxtls:live-bootstrap-to-guix
Draft

Live bootstrap to guix#578
vxtls wants to merge 243 commits intofosslinux:masterfrom
vxtls:live-bootstrap-to-guix

Conversation

@vxtls
Copy link
Copy Markdown

@vxtls vxtls commented Mar 15, 2026

No description provided.

vxtls added 30 commits February 18, 2026 10:14
…flow

- add --stage0-image in rootfs.py for qemu to boot an existing kernel-bootstrap image
- when --stage0-image is combined with --build-guix-also, update BUILD_GUIX_ALSO in image config and sync /steps-guix into the image
- require stage0 /init to contain guix handoff marker instead of patching /init implicitly
- add run_steps_guix_if_requested() to make_bootable-generated /init so rebooted stage0 images can enter steps-guix directly
- run /steps-guix/0.sh with bash in after.sh
- make script-generator start mode convention-based: /steps stays kaem-first, alternate roots (e.g. /steps-guix) start in bash
- remove redundant explicit /steps config-root argument from seed/preseeded/reconfigure script-generator calls
Drop the manual make -C opcodes i386-gen call from pass1.sh and rely on default_src_compile instead.

This avoids failures when opcodes/ is not yet available in the current build context (make: *** opcodes: No such file or directory) and matches the stable top-level recursive build flow used elsewhere in the project.
- add gcc-15.2.0 to steps-guix manifest after binutils-2.41
- keep full gcc-15.2.0 pass1 src_prepare cleanup/regeneration flow
- switch configure/build/install to kernel toolchain bootstrap mode:
  --without-headers, --enable-multilib, all-gcc, all-target-libgcc
- install into /kernel-toolchain and prioritize /kernel-toolchain/bin in PATH
- add missing gcc distfiles entry for SARIF spec
- include decDPD helper files used during src_prepare
The stage1 gcc build runs with --without-headers, but all-target-libgcc was
still pulling in gthr-default.h and failing on missing pthread.h.

Adjust steps-guix/gcc-15.2.0/pass1.sh configure flags to match a headers-free
bootstrap profile:
- add --disable-threads
- add --disable-shared
- add --disable-libssp
- add --disable-libsanitizer
- add --disable-libquadmath
- add --disable-libatomic
- add --disable-libgomp

Keep the existing multilib bootstrap flow:
- make all-gcc
- make all-target-libgcc
- make install-gcc
- make install-target-libgcc
- add steps-guix/argp-standalone-1.4.1/pass1.sh
- run autoreconf before configure
- build/install with standard flow into /kernel-toolchain
- wire argp-standalone-1.4.1 into steps-guix manifest after gcc
- prepare argp for later kernel-side elfutils dependency
When booting with --stage0-image, mirror ports can change between runs
(e.g. file:// -> transient SimpleMirror port), but the reused image kept
stale MIRRORS/MIRRORS_LEN values in /steps/bootstrap.cfg.

Update stage0-work image preparation to patch bootstrap.cfg on each run:
- rewrite MIRRORS and MIRRORS_LEN from current CLI mirrors
- keep existing --build-guix-also handoff checks/sync behavior

This fixes guest downloads trying old 10.0.2.2:<stale-port> endpoints
during steps-guix builds.
…stsuite

argp-standalone pass1 builds in a separate build directory. Its testsuite
compiles sources that include <argp.h>, but without an explicit include path
the header in the source root is not found and build fails.

Set:
- CPPFLAGS=-I/Users/luoyanpan/CLionProjects/guix/live-bootstrap/..

in src_configure so testsuite objects can resolve argp.h during the normal
 phase.
…al LIBS and setting host/build + kernel-toolchain env
…hs, and disable unused-but-set-variable as error
@vxtls
Copy link
Copy Markdown
Author

vxtls commented Mar 26, 2026

@Googulator

I've run into a new problem. While building glibc-2.2.5-mesboot0, it's been stuck at this step for a long time (about 12 hours now), and I'm not sure what's causing it(maybe a deadlock? I am not sure, It may related to the bootstrap binary). Could you please take a look at this issue please?
And I have one more question: Is there a detailed def that explains how the bootstrap binary is built?

updating cache ./config.cache
creating ./config.status
creating config.make
creating glibcbug
creating config.h
phase `configure' succeeded after 150.8 seconds
starting phase `fixup-configure'
phase `fixup-configure' succeeded after 0.0 seconds
starting phase `patch-generated-file-shebangs'
patch-shebang: ./config.status: changing `/bin/sh' to `/gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh'
patch-shebang: ./manual/libm-err-tab.pl: warning: no binary for interpreter `perl' found in $PATH
patch-shebang: ./math/gen-libm-test.pl: warning: no binary for interpreter `perl' found in $PATH
patch-shebang: ./scripts/gen-FAQ.pl: warning: no binary for interpreter `perl' found in $PATH
patch-shebang: ./scripts/test-installation.pl: warning: no binary for interpreter `perl' found in $PATH
phase `patch-generated-file-shebangs' succeeded after 0.8 seconds
starting phase `build'
(echo 'sysd-rules-sysdirs := sysdeps/i386/elf sysdeps/unix/sysv/linux/i386/i686 sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdep\
 for dir in '$(..)sysdeps/i386/elf' '$(..)sysdeps/unix/sysv/linux/i386/i686' '$(..)sysdeps/unix/sysv/linux/i386' '$(..)sysdeps/unix/sysv/linux' '$(..)sysdeps/gnu' '$(..)sysdeps/unix/common' '$(..)sysdeps/uni\
   for o in .o .os .op .og .ob .oS; do \
      \
     echo "\$(objpfx)%$o: $dir/%.S \$(before-compile); \
          \$(compile-command.S)";                                     \
     echo "\$(objpfx)%$o: $dir/%.s \$(before-compile); \
          \$(compile-command.s)";                                     \
        \
     echo "\$(objpfx)%$o: $dir/%.c \$(before-compile); \
          \$(compile-command.c)";                                     \
   done; \
    \
   echo "\$(objpfx)%.d: $dir/%.s \$(common-objpfx)dummy.d; \
        \$(make-dummy-dep)";                           \
   echo "\$(objpfx)%.d: $dir/%.S \$(before-compile); \
        \$(+make-deps)";                                              \
        \
   echo "\$(objpfx)%.d: $dir/%.c \$(before-compile); \
        \$(+make-deps)";                                              \
 done;                                                                \
 echo 'sysd-rules-done = t') > sysdeps/../sysd-rulesT
mv -f sysdeps/../sysd-rulesT sysdeps/../sysd-rules
for dir in sysdeps/i386/elf sysdeps/unix/sysv/linux/i386/i686 sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 s\
  test -f $dir/syscalls.list && \
  { /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; }; \
  test $dir = sysdeps/unix && break; \
done > sysdeps/../sysd-syscallsT

pstree command shows like this:

bash-5.3# pstree -p 7200
pstree -p 7200
-+- 00001 root /bin/bash /init
 \-+= 00121 root bash -i
   \-+- 00148 root python3 -c import pty; pty.spawn("/bin/bash")
     \-+= 00149 root /bin/bash
       \-+= 03910 root guix-daemon --build-users-group=guixbuild --listen=/var/guix/daemon-socket/socket
         \-+= 11082 root guix-daemon 11068                         --listen=/var/guix/daemon-socket/socket
           \-+= 11088 guixbuil /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile --no-auto-compile -L /gnu/store/q7kwm29ipj6igcw1fvan3sk2dvkgx0s4-module-import -C /gnu/store/jcc8csyk93ld95iffxrbr2rv0p9fd21h-module-import-compiled /gnu/store/n3jz2gckaqhf35iahh2r41b2dwsizl5b-glibc-mesboot0-2.2.5-builder
             \-+- 11101 guixbuilder01 /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile --no-auto-compile -L /gnu/store/q7kwm29ipj6igcw1fvan3sk2dvkgx0s4-module-import -C /gnu/store/jcc8csyk93ld95iffxrbr2rv0p9fd21h-module-import-compiled /gnu/store/n3jz2gckaqhf35iahh2r41b2dwsizl5b-glibc-mesboot0-2.2.5-builder
               \-+- 06987 guixbuil make SHELL=/gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh
                 \-+- 07055 guixbuil /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile \ /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh -c for dir in sysdeps/i386/elf sysdeps/unix/sysv/linux/i386/i686 sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 sysdeps/unix/sysv sysdeps/unix/i386 sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu sysdeps/i386/i686 sysdeps/i386/i486 sysdeps/i386/fpu sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic; do  test -f $dir/syscalls.list &&  { /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; };  test $dir = sysdeps/unix && break;  done > sysdeps/../sysd-syscallsT
                   \-+- 07133 guixbuil /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile \ /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh sysdeps/unix/make-syscalls.sh sysdeps/unix/sysv/linux/i386
                     \-+- 07200 guixbuil /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile \ /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh sysdeps/unix/make-syscalls.sh sysdeps/unix/sysv/linux/i386
                       \--- 07202 guixbuil /gnu/store/6i1bgpkzw52sjzxrqc9hmcvc5s44j3cr-guile-bootstrap-2.0/bin/guile \ /gnu/store/174av9wa102bh1a6pssa17740dw8draf-gash-boot-0.3.1/bin/sh sysdeps/unix/make-syscalls.sh sysdeps/unix/sysv/linux/i386

@Googulator
Copy link
Copy Markdown
Collaborator

I've seen the same issue as well on bare metal. Seems like an issue with our bootstrap Guile - did you try if using the official binary one (2.0.9) fixes it?

@vxtls
Copy link
Copy Markdown
Author

vxtls commented Mar 27, 2026

I've seen the same issue as well on bare metal. Seems like an issue with our bootstrap Guile - did you try if using the official binary one (2.0.9) fixes it?

sorry maybe that is my issue, i didn't put sed to the static-binary
This is the conclusion I reached after comparing the contents of the files, but I don’t believe there is a single definition that precisely specifies how Bootstrap Guile is built.

https://ftpmirror.gnu.org/guix/bootstrap/i686-linux/20190815/

base on this, it shows that 2.2.4 is what actually been used

So the key is to figure out exactly how these Bootstrap binaries are built. Of course, we also need to debug why it’s getting stuck here.

EDIT: not the sed problem

@vxtls
Copy link
Copy Markdown
Author

vxtls commented Mar 28, 2026

@Googulator I hope these issues can be resolved. A standard Guix system works fine, so perhaps the problem still lies in the preparation of the bootstrap binaries. Debugging these binaries is quite difficult, and I’m afraid there’s not much I can do about it. If you have the time, I’d really love for us to work together to solve this problem.
I'm completely stumped right now, I have no idea how to troubleshoot this issue, do you have any idea on this?

@vxtls
Copy link
Copy Markdown
Author

vxtls commented Mar 29, 2026

I am trying guile 2.0.9 right now

@vxtls
Copy link
Copy Markdown
Author

vxtls commented Mar 31, 2026

Using Guile 2.0.9 with the official patches, I successfully built glibc-2.2.5-mesboot0
And there is a new problem from glibc-headers-mesboot-2.16.0
This is the logs
ky1i2g4lswnjdqg2xsknk84s4401dj-glibc-headers-mesboot-2.16.0.drv.gz
It seems to be cut off a bit, so use

gzip -dc > log

to see the content

I'll run it again right away to see if I can get the full log, It might still be related to a Bootstrap Guile bug or a memory issue.

EDIT: i didn't see the issue now, if anyone have a idea, pls share

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.

3 participants