Commit graph

22 commits

Author SHA1 Message Date
81f071f1ec fix: Build tcc-musl through an intermediate stage
If tinycc is linked with a musl which in turn was built by tcc-mes,
then this musl has broken implementations of the math library on
certain arches, which is in turn caused tcc-mes having stubbed math
functions. The only way to get a trustworthy musl is to build it with
an intermediate tcc-musl, where the intermediate tcc-musl has at least
working ldexp and frexp.

Issues in the math library were surfacing on RISC-V when building gmp.
2025-10-28 03:31:26 +00:00
d4efe9b6ad fix: Replace unsound TCC array type patch
The base version of TinyCC does not correctly support complex array
types in function parameters. A patch was applied to add this support,
but the old version of this patch broke VLA code generation, which in
turn caused execvp() in musl to be miscompiled. Here, I have replaced
this patch with a sound version.
2025-10-28 03:31:26 +00:00
austreelis
c584232c96 fixup! Assert that foundation supports bootstrapping for the configured system 2025-10-28 02:43:02 +00:00
austreelis
5f7e04dbd9 update README 2025-10-28 02:43:02 +00:00
austreelis
e21819a2aa Assert that foundation supports bootstrapping for the configured system
Should we wait for lib modules to provide assertions before merging this ?

closes #10
2025-10-28 02:43:02 +00:00
21fddcd49e Read TCC_VERSION from tinycc source tree itself; it is important to set
this to a valid value otherwise __TINYC__ ends up being misdefined, and
some things in the build depend on this.

Ironically, we have another build problem in libc.c which was hidden
by the incorrect __TINYC__ value - for the moment, bodge this in sources.nix..
2025-10-27 16:58:06 +00:00
5448ed8b49 hard-wrap the README to 80-columns
directly analogous to foundation#12
2025-10-23 22:49:28 +00:00
0c4741dfab update lib in npins
I ran `npins upgrade` and `npins update lib`.

this should unblock PR #11, since it includes the merge of lib PR #8.
2025-10-23 21:46:42 +00:00
cfd878fcad Add simple script to check reproducibility
Fixes: #16
2025-10-23 19:49:22 +00:00
9dec523254
bash stage1: set HEREDOC_PIPESIZE explicitly to fix non-reproducability 2025-10-20 16:39:13 +01:00
0959de9f48 add format.sh from labs, reformat tree (#18)
Co-authored-by: Jake Hamilton <jake.hamilton@hey.com>
Reviewed-on: #18
Co-authored-by: 5225225 <5225225@mailbox.org>
Co-committed-by: 5225225 <5225225@mailbox.org>
2025-10-18 15:40:01 +00:00
f67099f486 flake: add checks (#21)
this way, you can run `nix flake check --all-systems` after making a change to ensure the entire foundation still builds

Reviewed-on: #21
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Piper McCorkle <contact@piperswe.me>
Co-committed-by: Piper McCorkle <contact@piperswe.me>
2025-10-18 15:38:32 +00:00
7505679c24 Allow overriding configuration from outside (#14)
Use case: downstream users may want to override the GNU mirror URL,
as the main ftp.gnu.org repository has caused slow downloads. Now it is possible to
perform e.g.
```nix
((import ./default.nix).extend {
  modules = [{ config.aux.mirrors.gnu = "https://www.nic.funet.fi/pub/gnu/ftp.gnu.org/pub/gnu/"; }];
}).config.exports.resolved.packages
```

Reviewed-on: #14
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Aleksi Hannula <ahannula4+auxolotl@gmail.com>
Co-committed-by: Aleksi Hannula <ahannula4+auxolotl@gmail.com>
2025-10-18 15:35:16 +00:00
187b21870e use SOURCE_DATE_EPOCH for python (#17)
To test: `nix build .#packages.i686-linux.stage1-python && nix build --rebuild --keep-failed .#packages.i686-linux.stage1-python`.

Python does print its build date on startup, which means this is a bit confusing, but eh

```
# ./result/bin/python3
Python 3.12.0 (main, Jan  1 1970, 00:00:00) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
```

Reviewed-on: #17
Reviewed-by: vlinkz <vlinkz@snowflakeos.org>
Co-authored-by: 5225225 <5225225@mailbox.org>
Co-committed-by: 5225225 <5225225@mailbox.org>
2025-10-05 23:50:05 +00:00
9a32c3d132 refactor: use ftpmirror.gnu.org for gnu packages (#8)
https://ftp.gnu.org is very, *very* slow. From the [GNU downloads page](https://www.gnu.org/prep/ftp.en.html):

> [...]please try to use one of the many mirrors of our site listed below: the mirrors will give you faster response. [...] You can use the generic URLs https://ftpmirror.gnu.org and http://ftpmirror.gnu.org to automatically choose a nearby and up-to-date mirror.

Indeed, in my experience the mirrors are much faster. I don't see a reason we shouldn't default to them personally, so I've changed the default here.

Also see: auxolotl/labs#26

Reviewed-on: #8
Co-authored-by: Ruby Iris Juric <ruby@srxl.me>
Co-committed-by: Ruby Iris Juric <ruby@srxl.me>
2025-10-04 21:25:06 +00:00
deb8e03cb2 Add instructions on how to fix errors when downloading tarballs (#12)
Reviewed-on: #12
Reviewed-by: Ruby Iris Juric <ruby+auxolotl@srxl.me>
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: 5225225 <5225225@mailbox.org>
Co-committed-by: 5225225 <5225225@mailbox.org>
2025-10-04 20:08:59 +00:00
f39cac8cae Fix URLs in readme to point to foundation instead of labs (#9)
Reviewed-on: #9
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: 5225225 <5225225@mailbox.org>
Co-committed-by: 5225225 <5225225@mailbox.org>
2025-10-02 17:36:23 +00:00
7344532f72 fix python zlib (#6)
Right now when running the `stage1-python` binary and attempting to import zlib module, you get
```
>>> import zlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: Error loading shared library libz.so.1: No such file or directory (needed by .../lib/python3.12/lib-dynload/zlib.cpython-312-i386-linux-gnu.so)
```
By linking with rpath instead, the resulting binary knows the exact path to look for zlib

Reviewed-on: #6
Co-authored-by: Victor Fuentes <vlinkz@snowflakeos.org>
Co-committed-by: Victor Fuentes <vlinkz@snowflakeos.org>
2025-10-01 05:39:27 +00:00
032292458a Bypass problematic configure check in stage1-bash (#3)
When trying to build stage1-bash under a 32bit kernel, the configure script crashes because of a segmentation fault during the test for sigsetjmp/siglongjmp.
This can be fixed by bypassing the test and always assuming that the functions are not available. This does not have a negative impact on any downstream packages and makes the bootstrap chain complete.

From what I could find out, this seems to be a problem that only occurs when trying to build bash on a 32bit kernel using tcc. I can also get the build to work without the patch by either running it under a 64bit kernel, or by using the gcc from my host instead of the bootstrapped tcc.

Reviewed-on: #3
Reviewed-by: vlinkz <vlinkz@snowflakeos.org>
Co-authored-by: nzbr <mail@nzbr.de>
Co-committed-by: nzbr <mail@nzbr.de>
2025-10-01 05:38:31 +00:00
921fd24635 sources.json: use git+https not git+ssh for lib (public repo) (#5)
I can't see any reason not to do this and it makes building with e.g. hydra easier. AFAICS forgejo doesn't support anonymous/public git+ssh access?

Reviewed-on: #5
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: srd424 <srd424@noreply.git.auxolotl.org>
Co-committed-by: srd424 <srd424@noreply.git.auxolotl.org>
2025-09-20 18:16:41 +00:00
ec6ba87775
Added needed chmod'ing to fix stage1
I'm pretty sure this is the minimal set of files to make things work, but feel free to experiment.

We still need to figure out why I'm the only one this failed for, and write some tests. I suspect it may be that I had to run as root, due to lix not allowing the `--system` argument when run by an ordinary user. I don't think we, uh, have a test framework yet, so I'm leaving that for another CL...
2025-05-28 10:41:18 -07:00
47707c015d
chore: extract from labs 2025-03-30 06:50:39 -07:00