Compare commits

...

6 commits

Author SHA1 Message Date
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: auxolotl/foundation#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: auxolotl/foundation#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: auxolotl/foundation#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: auxolotl/foundation#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: auxolotl/foundation#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: auxolotl/foundation#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
4 changed files with 54 additions and 7 deletions

View file

@ -9,7 +9,7 @@ Packages can be imported both with and without Nix Flakes. To import them using
add this repository as an input.
```nix
inputs.foundation.url = "https://git.auxolotl.org/auxolotl/labs/archive/main.tar.gz?dir=foundation";
inputs.foundation.url = "https://git.auxolotl.org/auxolotl/foundation/archive/main.tar.gz";
```
To import this library without using Nix Flakes, you will need to use `fetchTarball` and
@ -17,11 +17,11 @@ import the library entrypoint.
```nix
let
labs = builtins.fetchTarball {
url = "https://git.auxolotl.org/auxolotl/labs/archive/main.tar.gz";
foundation_tarball = builtins.fetchTarball {
url = "https://git.auxolotl.org/auxolotl/foundation/archive/main.tar.gz";
sha256 = "<sha256>";
};
foundation = import "${labs}/foundation" {
foundation = import foundation_tarball {
# Specifying a system is optional. By default it will use the current system.
system = "i686-linux";
};
@ -29,6 +29,50 @@ in
# ...
```
### Bypassing Geoblocking
If you get an error(possibly with different hashes) such as
```
error: hash mismatch in file downloaded from 'https://repo.or.cz/tinycc.git/snapshot/fd6d2180c5c801bb0b4c5dde27d61503059fc97d.tar.gz':
specified: sha256-R81SNbEmh4s9FNQxCWZwUiMCYRkkwOHAdRf0aMnnRiA=
got: sha256-YFl5pQIdfJAn4ijH1UU8OY+DRtJ0LPd5r0eoIF8iyMI=
```
and you're in the UK, you will need to manually add the tinycc revisions to the store, because of
Online Safety Act-caused geoblocking.
If you have [Tor](https://www.torproject.org/) running, you can use it as a proxy with the below
script to manually add the items to your nix store.
```
curl --proxy socks5://localhost:9050 -LO https://repo.or.cz/tinycc.git/snapshot/86f3d8e33105435946383aee52487b5ddf918140.tar.gz
curl --proxy socks5://localhost:9050 -LO https://repo.or.cz/tinycc.git/snapshot/fd6d2180c5c801bb0b4c5dde27d61503059fc97d.tar.gz
nix-store --add-fixed sha256 86f3d8e33105435946383aee52487b5ddf918140.tar.gz
nix-store --add-fixed sha256 fd6d2180c5c801bb0b4c5dde27d61503059fc97d.tar.gz
```
Alternatively, use a VPN or some other form of proxy to download the files
* <https://repo.or.cz/tinycc.git/snapshot/86f3d8e33105435946383aee52487b5ddf918140.tar.gz>
* <https://repo.or.cz/tinycc.git/snapshot/fd6d2180c5c801bb0b4c5dde27d61503059fc97d.tar.gz>
and add them to your nix store as shown above.
This will fix the build until a garbage collection run.
### `ftpmirror.gnu.org` HTTP errors
If you get an error such as
`error: unable to download 'https://ftpmirror.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz': HTTP error 403
(Forbidden)`
or any other HTTP error, try re-running the build. Some of the mirrors in the `ftpmirror.gnu.org`
pool may be flaky, and retrying will get a different mirror chosen. Once it's downloaded, it will
be cached in your nix store, so you won't run into the issue again until a garbage collection run.
## Development
This foundational package set is created using modules. Each builder and package is separated

View file

@ -3,7 +3,7 @@
options.aux.mirrors = {
gnu = lib.options.create {
type = lib.types.string;
default.value = "https://ftp.gnu.org/gnu";
default.value = "https://ftpmirror.gnu.org/gnu";
description = "The GNU mirror to use";
};
};

View file

@ -110,7 +110,8 @@ in
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \
--without-bash-malloc
--without-bash-malloc \
bash_cv_func_sigsetjmp=n
# Build
make -j $NIX_BUILD_CORES SHELL=bash

View file

@ -103,12 +103,14 @@ in
export CC=musl-gcc
export C_INCLUDE_PATH="${stage1.zlib.package}/include"
export LIBRARY_PATH="${stage1.zlib.package}/lib"
export LD_LIBRARY_PATH="$LIBRARY_PATH"
export LDFLAGS="-Wl,-rpath,${stage1.zlib.package}/lib"
bash ./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}
export SOURCE_DATE_EPOCH=0
# Build
make -j $NIX_BUILD_CORES