Deprecating some interfaces for 18.09

In treewide: Deprecate platform aliases by Ericson2314 · Pull Request #45717 · NixOS/nixpkgs · GitHub, I do the following deprecations (given with their alternatives):

  1. system ==> stdenv.buildPlatform.system
    
  2. stdenv.system ==> stdenv.buildPlatform.system
    
  3. configureFlags = "--foo --bar"; ==> configureFlags = [ "--foo" "--bar" ];
    
  4. isArm ==> isAarch32 # Already done during 18.03 but message improved
    
  5. buildPlatform ==> stdenv.buildPlatform
    
  6. hostPlatform ==> stdenv.hostPlatform
    
  7. targetPlatform ==> stdenv.targetPlatform
    

with the idea that later the deprecated interfaces will be removed idea. On one hand, this will allows simplifying infrastructure, which benefits advanced users. On the other hand, by removing conflicting idioms, I hope new contributors will be able to learn things faster by being able to assume that different looking things indeed have different meanings.

As this PR affects the trajectory of highly visible interfaces, I’d like to solicit more feedback. I hope to reach a conclusion soon as the fork is immanent and this bit-rots fast.

3 Likes

I can only fully agree with the proposed deprecation. The latter improve in my opinion the experience for package maintainers in terms of expressing their demand on the stdenv build chain. In addition it makes the separation between native and cross chains more visible.

I’ve on question though for the nix tool interface. Would that also mean that someone requesting the crosschain has still the opportunity to do that by current option 1:

nix build -f default.nix --system x86_64-linux

or option 2:

nix build -f default.nix --arg stdenv.buildPlatform.system x86_64-linux

The correct syntax is --argstr system x86_64-linux (or corresponding --arg variant). I’m convinced nothing changes there.

Yes, nothing is changing there regarding instantiating nixpkgs as a whole at this time.

(off-topic) As an aside, you have indeed predicted what I eventually want to do, however. Currently, NixOS doesn’t support dots in args so

--argstr localSystem.system x86_64-linux

wouldn’t work. Attribute paths with --arg and --argstr · Issue #1850 · NixOS/nix · GitHub tracks that. Once it is fixed, I would like to make localSystem and crossSystem the only way to instantiate nixpkgs, disallowing top-level system and platform. That would eventually allow simplifying nixpkgs/impure.nix at master · NixOS/nixpkgs · GitHub, and also fixing up the nixpkgs module for nixos, as it is very hard to support two different options controlling the same thing and each defaulting to the other.

Using --arg '{localSystem.system = "x86_64-linux";}' should work tho.

3 Likes