Skip to content

[POC] Add pnut-exe as alternative to Mes#554

Open
laurenthuberdeau wants to merge 5 commits intofosslinux:masterfrom
laurenthuberdeau:laurent/speed-up-live-bootstrap-with-pnut
Open

[POC] Add pnut-exe as alternative to Mes#554
laurenthuberdeau wants to merge 5 commits intofosslinux:masterfrom
laurenthuberdeau:laurent/speed-up-live-bootstrap-with-pnut

Conversation

@laurenthuberdeau
Copy link
Copy Markdown

Context

Pnut-exe was recently made compatible with M2-Planet, with this PR working-around certain incompatibilities with M2-Planet, and oriansj/M2-Planet#161, oriansj/M2-Planet#162, oriansj/M2-Planet#163 extending M2-Planet. Since pnut-exe can bootstrap TCC, it means there is now a path from hex0 to TCC passing via pnut-exe.

This PR is a proof of concept to show how this can be done for x86 while keeping the tcc-0.9.26 checksum the same.

The main benefit of using pnut-exe is reduced bootstrap times, the time to reach tcc-0.9.26 goes from over 10 minutes to around 1 minute (with the steps involving pnut taking only a few seconds).

@@ -0,0 +1,3 @@
f https://github.com/udem-dlteam/pnut/archive/refs/heads/laurent/small-fixes-for-TCC.tar.gz 6e662dbf450c8ec2b3be0bfd5db6e198c566f430e63c29edd7225dbdf09de17b pnut-1.0.tar.gz
f https://github.com/udem-dlteam/pnut/archive/refs/heads/laurent/small-fixes-for-TCC.tar.gz 66df0ebd8e2507cbab63c253b1911c5cbb9ba90635f88e9017a4adc83c90ecb0 pnut-1.0.tar
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This URL is wrong. It seems the .tar.gz files produced by github cannot be decompressed with the ungz (at least I wasn't able to), so what I did was download the .tar.gz file and then unpack it manually.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In general, you shouldn't rely on GitHub producing tarballs on the fly - GitHub's archive generation isn't guaranteed to be deterministic. It's better to make your own tarball, and upload it as a release artifact.

The updated M2-Planet has some code generation
improvements, so the hash of these executables
is different.
Only for x86, but I suppose other architecture
will also need updated checksums.
@laurenthuberdeau laurenthuberdeau force-pushed the laurent/speed-up-live-bootstrap-with-pnut branch from 6aa4743 to 15a64fe Compare March 8, 2026 01:17
@fosslinux
Copy link
Copy Markdown
Owner

Question: Theoretically, could this skip tcc 0.9.26, and go straight to tcc 0.9.27 (or even more, tcc mob)?

@laurenthuberdeau
Copy link
Copy Markdown
Author

Question: Theoretically, could this skip tcc 0.9.26, and go straight to tcc 0.9.27 (or even more, tcc mob)?

A part of the NLnet funding we got is for compiling 0.9.27 with pnut, so definitely :)

@luggesexe
Copy link
Copy Markdown

Hello!
What is the general timeline planned here? When could this be actually usable?
Thanks and Kindly!

@laurenthuberdeau
Copy link
Copy Markdown
Author

@luggesexe

I haven't had much time in the past few months to complete this work. I still intend to complete it, and should hopefully have more time in the next few weeks. If you want to help, here's a list of the things that still need to be done to get this over the finish line:

  1. Update the upstream stage0-posix with the latest M2-Planet commit to include the pnut-specific M2-Planet fixes (@oriansj).
  2. Make a separate PR updating live-boostrap to use the latest stage0-posix changing the expected hash of the binaries compiled with M2-Planet or using the M2 libc (to keep the diff in this PR small).
  3. Rebase this PR, make the pnut step in steps/manifest conditional and make steps/tcc-0.9.26/pass1.kaem compatible with both mes and pnut.

Curious to know how you intend to use live-bootstrap with pnut, as I may be able to prioritize accordingly :)

@luggesexe
Copy link
Copy Markdown

Hello Laurent,
thank you for your kind answer. I am not super experienced with all the inner workings of live-bootstrap so I do not think I could be of a lot help.

I am a Maintainer of StageX, we use this path for our full source bootstrap distro.

https://codeberg.org/stagex/stagex/issues/848
Here is the issue one of our contributors created that made me aware of this PR.

It would be nice to have a faster and shorter path. No pressure though, this is an interesting and important project.

Thanks
Zoë

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.

4 participants