Skip to content

Remove cruft from platform descriptions #34274

@Ericson2314

Description

@Ericson2314

Simply put, I should be able to do

$ nix-build '<nixpkgs>' --arg crossSystem '{ config = "aarch64-unknown-linux-gnu"; }' -A stdenv

and that should work. I could make it work right now with a dirty white-list and fall-backs, but that's kind of defeats the point.

Currently, the biggest culprits are

  1. Random top-level fields, like withTLS and openssl.system. See https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix
  2. The platform field, see https://github.com/NixOS/nixpkgs/blob/master/lib/systems/platforms.nix
  3. arch which overlaps with the far more principled parsed,arch. See elaborate https://github.com/NixOS/nixpkgs/blob/master/lib/systems/default.nix#L17.

The general design issue is we need to handle the per-package random crap in a more modular way, without giving up the possibility of the user to override with their own values. My GNU ld emulation picking logic at https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/bintools-wrapper/default.nix#L167-L179 is certainly in a more modular location, but also cannot be nicely overridden.

Checklist


CC @dtzWill @dezgeg @infinisil @teto

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used on9.needs: documentationThis needs to be documented well.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions