docs: update build instructions and foundation (#38)
Reviewed-on: #38 Reviewed-by: vlinkz <vlinkz@snowflakeos.org> Co-authored-by: KFears <kfearsoff@gmail.com> Co-committed-by: KFears <kfearsoff@gmail.com>
This commit is contained in:
parent
cb654dbfd0
commit
76cd63f5fe
2 changed files with 16 additions and 28 deletions
|
|
@ -35,19 +35,19 @@ in
|
|||
To build a package, you can run the following command inside of the `tidepool` directory:
|
||||
|
||||
```console
|
||||
nix-build -A packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix-build -A packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
If you have `nix-command` experimental feature enabled, you can v3 CLI instead:
|
||||
|
||||
```console
|
||||
nix build -f . packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build -f . packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Using flakes, the difference is only in calling:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
This interface is verbose, but stable. We are still working out the details for
|
||||
|
|
@ -56,44 +56,44 @@ a friendlier interface!
|
|||
The full command syntax looks like this:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.${version}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.${version}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
Tidepool packages can have multiple versions available. Tidepool also provides aliases
|
||||
for convenience, currently "stable" and "latest". Aliases go directly after `${package}`:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.${alias}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.${alias}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
The actual available versions live one level deeper, under `versions` namespace:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.versions.${version}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.versions.${version}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
Here are a few practical examples for Tidepool. We can use a specific Bash version:
|
||||
|
||||
```console
|
||||
nix-build -A packages.foundation.bash.versions."5.2.15-stage1".packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix-build -A packages.foundation.bash.versions."5.2.15-stage1".packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Get Bash cross-compiled from `i686-linux` to `x86_64-linux`:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.i686-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.i686-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Or a native `aarch64-linux` Bash:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.aarch64-linux.aarch64-linux.aarch64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.aarch64-linux.aarch64-linux.package
|
||||
```
|
||||
|
||||
Running this command will:
|
||||
|
||||
- Bootstrap `i686-linux` `gcc` as a dependency of `x86_64-linux` `gcc`
|
||||
- Incrementally bootstrap the actual `x86_64-linux` `gcc`
|
||||
- Bootstrap `i686-linux` `gcc` using Foundation
|
||||
- Incrementally bootstrap `x86_64-linux` `gcc`
|
||||
- Incrementally bootstrap `aarch64-linux` `gcc` from `x86_64-linux` `gcc`
|
||||
- Build the native `aarch64-linux` `gcc`
|
||||
- Build the native `aarch64-linux` `bash`
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ In this folder, the Tidepool package sets are stored.
|
|||
## Foundation
|
||||
|
||||
The package set under `foundation` is a minimal set to start building everything
|
||||
else. It builds upon and uses packages from [Foundation](https://git.auxolotl.org/auxolotl/foundation),
|
||||
our early bootstrap chain. It provides a comprehensive set of packages that are
|
||||
else. It provides a comprehensive set of packages that are
|
||||
used to build all other basic Linux utilities, and are often transitive dependencies
|
||||
of higher-level packages.
|
||||
|
||||
|
|
@ -25,21 +24,10 @@ binaries to point to our dependencies. This "unbreaks" proprietary
|
|||
binaries by making them point to Tidepool-provided dependencies.
|
||||
Neat!
|
||||
|
||||
The bootstrap chain is based on [full-source](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/)
|
||||
bootstrap, made possible with amazing work by Guix's people,
|
||||
and Emily Trau's effort on porting it to Nix!
|
||||
It bootstraps a proper `gcc` for `i686-linux`, which can then
|
||||
be used to cross-compile a `gcc` for other architectures, such
|
||||
as `x86_64-linux`.
|
||||
|
||||
To build stage1 (`i686-linux`), run:
|
||||
|
||||
```console
|
||||
nix build --system i686-linux .#packages.foundation.glibc.versions."2.38-stage1-passthrough".packages.i686-linux.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
The full bootstrap chain is available in a confusingly-named
|
||||
[Foundation repository](https://git.auxolotl.org/auxolotl/foundation).
|
||||
The `foundation` package set builds upon and uses packages from [Foundation](https://git.auxolotl.org/auxolotl/foundation),
|
||||
our early bootstrap chain. It augments the packages from Foundation with
|
||||
Tidepool's cross-compilation capabilities, and adds additional flags
|
||||
to compilers to better support our use case.
|
||||
|
||||
## Aux
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue