Commit graph

44 commits

Author SHA1 Message Date
be0d6bc0e1 refactor: remove target (#31)
WIP. Posting just to make sure people know this is something I'd like to do.

Context: https://matrix.to/#/!PvnunzXUk4Vm1CmKS4:auxolotl.org/$bOm6iaBpWbo-KRJgo7FUZdeFIv9StzRHxklbx7OQ23g?via=auxolotl.org&via=matrix.org&via=catgirl.cloud

Reasons:

1. Why should GCC inflict complication upon all of tidepool just because of its own architectural deficiencies?
2. Most other compilers are multi-target so it doesn't matter
2. Target is useless for 99.9% of packages and only leads to user confusion, especially since many compilers also call what would be host here "target".
3. Canadian-cross is not very well supported. GCC barely supports it, and is broken in many cases. Nixpkgs does not support it (regardless of what its API may imply) and no one has ever complained.

Plan:

1. Remove most target related things. No reason to have it.
2. Add configuration parameter on GCC that selects its target

What does this mean:

This basically moves target to be a GCC-specific artifact rather than an official parameter every package must endure the cognitive load of. This is because it is.  Nixpkgs plans on dumping target in the future as well because of this. Or at least making it an alias.

If you want to create a compiler with a different target, then override GCC to do so. No need to pervade all of tidepool just for GCC.

Co-authored-by: Victor Fuentes <vlinkz@snowflakeos.org>
Reviewed-on: #31
Reviewed-by: vlinkz <vlinkz@snowflakeos.org>
Co-authored-by: Ross Smyth <snix@treefroog.com>
Co-committed-by: Ross Smyth <snix@treefroog.com>
2025-10-07 03:46:52 +00:00
8174d3a494 fix lib.systems.validate.compatible (#35)
Use builtins and aux `lib.fp.id` instead of nixpkgs functions for `lib.systems.validate.compatible`.

Reviewed-on: #35
Reviewed-by: Ruby Iris Juric <ruby+auxolotl@srxl.me>
Co-authored-by: Victor Fuentes <vlinkz@snowflakeos.org>
Co-committed-by: Victor Fuentes <vlinkz@snowflakeos.org>
2025-10-06 15:10:56 +00:00
b67847e7eb fix: Correctly resolve packages from preferences.packages.version (#33)
Before this, a value that does not correspond to an attribute under a
package alias' `versions` would make it default to the latest as defined
by `lib.packages.getLatest`, which isn't a silver bullt: it choose
"bash5.2.15-bootstrap" for instance instead of stage1-passthrough (and I
don;t think we have an easy fix for that).

Given values like `"1.2.3"` makes little sense in
`config.preferences.packages.version` (because it's a package-set-wide
preference), this means it was hardly ever useful.

before:

```console
❯ nix eval -f tidepool --apply 't:
  t.extend {modules = [{config.preferences.packages.version = "latest";}];}
  |> (t: t.config.lib.packages.resolve t.config.packages.foundation.bash)
  |> (p: p.version)'
"5.2.15-bootstrap"
❯ nix eval -f tidepool --apply 't:
  t.extend {modules = [{config.preferences.packages.version = "stable";}];}
  |> (t: t.config.lib.packages.resolve t.config.packages.foundation.bash)
  |> (p: p.version)'
"5.2.15-bootstrap"
```

after:

```console
❯ nix eval -f tidepool --apply 't:
  t.extend {modules = [{config.preferences.packages.version = "latest";}];}
  |> (t: t.config.lib.packages.resolve t.config.packages.foundation.bash)
  |> (p: p.version)'
"5.2.15-stage1-passthrough"
❯ nix eval -f tidepool --apply 't:
  t.extend {modules = [{config.preferences.packages.version = "stable";}];}
  |> (t: t.config.lib.packages.resolve t.config.packages.foundation.bash)
  |> (p: p.version)'
"5.2.15-bootstrap"
```

Co-authored-by: austreelis <git@swhaele.net>
Reviewed-on: #33
Reviewed-by: Ruby Iris Juric <ruby+auxolotl@srxl.me>
Co-authored-by: Austreelis <austreelis@noreply.git.auxolotl.org>
Co-committed-by: Austreelis <austreelis@noreply.git.auxolotl.org>
2025-10-04 00:40:05 +00:00
8ffc63ae42 fix: package license causing hydra eval fails (#30)
Difference in license attrset schema between lib and tidepool caused eval fails, as in [here](https://hydra.aux-cache.dev/jobset/aux/tidepool#tabs-errors).

This PR changes tidepool's scheme to align it with lib:
```console
❯ nix eval -f tidepool packages.foundation.bash.latest.meta.license --json | jq
{
  "free": true,
  "fullName": "GNU General Public License v3.0 or later",
  "name": "gpl3Plus",
  "redistributable": true,
  "spdxId": "GPL-3.0-or-later",
  "url": "https://spdx.org/licenses/GPL-3.0-or-later.html"
}
```

I kinda liked the previous schema of tidepool, but it's a lower impact fix than bumping lib's major, and I think we want to think more about licenses in lib (e.g. it would probably make sense to move tidepool's license type there to avoid dupplicating the code for the default behavior).

Co-authored-by: austreelis <git@swhaele.net>
Reviewed-on: #30
Reviewed-by: vlinkz <vlinkz@snowflakeos.org>
Co-authored-by: Austreelis <austreelis@noreply.git.auxolotl.org>
Co-committed-by: Austreelis <austreelis@noreply.git.auxolotl.org>
2025-10-03 05:15:39 +00:00
0ae450a116 feat: add lib.fetchurl function (#27)
See comment in `tidepool/src/lib/fetchurl.nix` for details on rationale.

I've made this a function in `lib` instead of defining this as a builder, since we don't have a great mechanism at the moment for specifying the source of a package as another package. We'll need to tackle this eventually, but given that this is a bit of a special case in that it's only intended to be used to fetch sources during bootstrap, I think it's fine to just have this be a function that returns a derivation, instead of being a full builder. Open to other opinions, though.

Reviewed-on: #27
Reviewed-by: vlinkz <vlinkz@snowflakeos.org>
Co-authored-by: Ruby Iris Juric <ruby@srxl.me>
Co-committed-by: Ruby Iris Juric <ruby@srxl.me>
2025-10-01 05:20:06 +00:00
ab85ed8550
refactor: default host and target platforms based on build 2025-09-19 21:03:13 -07:00
1f7ae040bc
feat: add package settings 2025-09-14 09:39:57 -07:00
9fb80e319d
chore: format 2025-09-14 09:36:55 -07:00
6854e9ccac
refactor: namespace builders 2025-09-14 09:27:13 -07:00
f4f1f0aea7
feat: build contexts for build, host, and target 2025-09-14 01:36:33 -07:00
2f31813c88 feat: add support for platform specs (#15)
This PR adds a new way of declaring supported platforms for packages. Previously individual build, host, and target values needed to be set for a given platform combination. Now, a platform spec can be written to generate many platform combinations.

This allows for easy mapping of all possible systems with `@all`, linux systems with `@linux` or any other available alias of `lib.systems.doubles.<alias>` by using `@<alias>`. In addition, you can use `@build` and `@host` to lock either the host or target respectively to match the prior platform.

Reviewed-on: #15
2025-09-10 12:32:11 +00:00
2c19b9ff12
refactor: enable system build info assertions 2025-08-31 18:44:45 -07:00
5d8dc6e478
refactor: allow src to be an attribute set of sources 2025-08-31 01:48:01 -07:00
1ae64357af
refactor: make builders portable and extendable, make creating new package sets easy 2025-08-31 01:34:49 -07:00
01db12d713
refactor: stable reference package platforms to improve eval time 2025-08-30 22:36:20 -07:00
5a222fa399
feat: working native x86_64-linux gcc 2025-08-29 12:32:37 -07:00
8b9b072d56
wip: working gcc stage1, stage2, stage3 2025-08-28 04:06:51 -07:00
8fe3a90993
wip: (broken gcc) add additional foundation packages 2025-08-26 04:55:10 -07:00
c393a33a1d
feat: passthrough foundation 2025-08-25 01:37:11 -07:00
1d8f94fabe
feat: working aux package builds, auto-naming 2025-08-23 20:33:46 -07:00
397419d8ab
chore: format code 2025-03-11 22:47:02 -07:00
d7762a5a78 add bootstraped x86_64-linux cross compiled gcc (#8)
Some checks failed
buildbot/nix-eval Build done.
Work in progress cross compiler for x86_64. I've managed to get a full x86_64 gcc using the binaries built from foundation, and am working on implementing their builds into tidepool.

### Bootstrapping steps
0) Start with i686 tools (gcc, binutils, musl, etc)
1) Build binutils targeting x86_64-linux
2) Build a minimal gcc cross compiler using the cross binutils. This minimal cross compiler does not have support for libc, so is pretty much only useful for building musl or glibc.
3) Use the minimal cross compiler to build x86_64-linux glibc or musl
4) Now that we have a cross compiler and x86_64-linux libc, we can build gcc for the target architecture!
5) Profit! We can now build anything x86_64 using our gcc compiler!

Co-authored-by: Jake Hamilton <jake.hamilton@hey.com>
Reviewed-on: #8
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Victor Fuentes <vmfuentes64@gmail.com>
Co-committed-by: Victor Fuentes <vmfuentes64@gmail.com>
2024-09-22 02:55:02 +00:00
7d94b7f665
feat: package extend, dynamic propagation 2024-07-09 02:54:33 -07:00
3f9d287065
refactor: format 2024-07-09 01:49:44 -07:00
ea200d834e
feat: pass through package dependencies via context 2024-07-08 23:18:11 -07:00
62bc2f4eee
feat: propagating hooks and context 2024-07-08 23:07:59 -07:00
0a63667459
refactor(format): apply formatting 2024-07-07 15:03:48 -07:00
7774f65079
refactor: minor cleanup 2024-07-07 15:03:46 -07:00
fd9b85f29e
feat: apply platform to deps inside submodules 2024-07-07 15:03:45 -07:00
193a52cbc8
fix: cross-platform deps 2024-07-07 15:03:44 -07:00
2b5f90d4e5
refactor: make dependencies dynamically built per-package 2024-07-07 15:03:42 -07:00
008632bc8b
feat: working transient deps 2024-07-07 15:03:41 -07:00
0f602b1cb7
wip: working single dependency reference via coercion 2024-07-07 15:03:38 -07:00
a707b0f06b
refactor: format all nix code 2024-06-22 10:58:44 -07:00
403420fd4b
fix: missing semicolon 2024-06-22 10:43:47 -07:00
9316874396
fix: add missing prefix for submodules, incorrect var name 2024-06-22 09:11:33 -07:00
69a8760bd3
feat: working linux-headers build 2024-06-22 09:11:32 -07:00
9850da8aa9
fix: resolve issue with extending cross package 2024-06-16 02:24:21 -07:00
0312e3c4cc
feat: working gcc build 2024-06-15 07:08:45 -07:00
6bd35bf4d5
feat: rich platform information 2024-06-15 04:18:05 -07:00
2989fdc4fe
refactor: more elegant shorthand support 2024-06-15 02:35:37 -07:00
3713635d76
feat: simple builder 2024-06-14 07:01:18 -07:00
fea8c2cd9c
feat: working package export 2024-06-14 04:47:54 -07:00
cdc90a4656
refactor: potluck -> tidepool 2024-06-14 02:12:19 -07:00