Skip to content

lib/meta: Remove evalConstraints & intermediate bool constraint attrsets - #1

Open
adisbladis wants to merge 4 commits into
Atemu:lib/meta-platform-constraintsfrom
adisbladis:lib/meta-platform-constraints
Open

adisbladis wants to merge 4 commits into
Atemu:lib/meta-platform-constraintsfrom
adisbladis:lib/meta-platform-constraints

Conversation

@adisbladis

Copy link
Copy Markdown

By "compiling" the constraints into a function taking the constraint to compute compatibility for.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Atemu and others added 2 commits October 13, 2024 13:04
Previously, we were able to express platform constraints in packages using e.g.

    meta.platforms = with lib.platforms; linux ++ darwin;

These platform checks only worked on a coarse level using lists of pre-defined
platform strings. It was not possible to express that only e.g. 64bit platforms
or that only GNU libcs are supported previously.

This introduces an algebra based on platform patterns which allows you to
express arbitrarily complex platform constraints using simple expressions
without needing to rely on `stdenv.*Platform.is*` bools.

Once this is in wide-spread use, it can be used for accurate rendering of
platform support in manuals and search sites.

It also removes the need for dependency on a package's `stdenv` for expressing
which platforms are broken as this can now be expressed using platform
constraints instead. This makes progress of potentially evaluating a package's
meta information independently of the package or its inputs.
By "compiling" the constraints into a function taking the constraint to compute compatibility for.
Atemu pushed a commit that referenced this pull request Oct 16, 2024
The first assumption[1] we had was that the `aarch64-unknown-none`
target was missing from rustc and that this was the cause for the
regression.

However, it turns out that the relevant code from `rustc` wasn't used
anyways because the Makefile does `--sysroot /dev/null`[2] which prevents
rustc from using its own libcore. So luckily we don't have to patch the
Rust bootstrap to get aarch64-linux back working[3].

In fact, the Rust part seems broken for both 6.10 and 6.11[4], but I
decided to not bother since none of those are longterm versions.

So all that's left here is to enable Rust for aarch64-linux because it
clearly works[5].

[1] NixOS#315121 (comment)
[2] https://lore.kernel.org/all/[email protected]/
[3] Of course I only realized this _after_ I spent some time hacking a rustc
    patch together 🙃
[4] This broke with

        error[E0463]: can't find crate for `core`
          |
          = note: the `aarch64-unknown-none` target may not be installed
          = help: consider downloading the target with `rustup target add aarch64-unknown-none`
          = help: consider building the standard library from source with `cargo build -Zbuild-std`

[5] While the build is fine, the VM tests are still panicking, but
    that's also the case for `kernel-generic` because of a 9p
    regression:

        switch_root: can't execute '/nix/store/zv87gw0yxfsslq0mcc35a99k54da9a4z-nixos-system-machine-test/init': Exec format error
        [    1.734997] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
        [    1.736002] CPU: 0 UID: 0 PID: 1 Comm: switch_root Not tainted 6.12.0-rc1 #1-NixOS
        [...]

    Reported as https://lore.kernel.org/all/[email protected]/T/#u
Atemu pushed a commit that referenced this pull request Dec 12, 2024
Added bolt-launcher, an alternative launcher for Runescape 3 / Old
School Runescape.

https://github.com/Adamcake/Bolt/releases/tag/0.9.0

bolt-launcher: add plugin loader for rs3

Building the app with luajit, which allows for Runescape 3 plugin
loading.

bolt-launcher: add runescape 3 dependencies

Added Runescape 3 dependencies inside the buildFHSEnv, so that it can be
used by the binary (downloaded from the internet by bolt-launcher
itself, hence why the fhs env is needed here).

bolt-launcher: fix dependency issues

Added libbolt-plugin.so into $out/lib, which allows the program to use
the Runescape 3 plugin loader. Also updated the mainProgram as well as
runScript so that the program can be ran from nix run instead of just
being able to be ran manually.

Add feature flags for RS3 and HDOSAndRuneLite as well as .desktop and icon file support (#1)

* Add enable flags for RS3 and HDOSAndRuneLite

* Add .desktop and icon

* Fix formatting w/ nixfmt

* Remove enableHDOSAndRuneLite feature flag

* Fix formatting

Co-authored-by: Thomas King <[email protected]>
@Atemu
Atemu force-pushed the lib/meta-platform-constraints branch 3 times, most recently from 0e467a3 to ead9589 Compare July 2, 2025 14:48
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.

2 participants