Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: replace stdenv.is with stdenv.hostPlatform.is #341407

Merged
merged 2 commits into from
Sep 24, 2024

Commits on Sep 24, 2024

  1. treewide: replace stdenv.is with stdenv.hostPlatform.is

    In preparation for the deprecation of `stdenv.isX`.
    
    These shorthands are not conducive to cross-compilation because they
    hide the platforms.
    
    Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
    
    One example of why this is bad and especially affects compiler packages
    https://www.github.com/NixOS/nixpkgs/pull/343059
    
    There are too many files to go through manually but a treewide should
    get users thinking when they see a `hostPlatform.isX` in a place where it
    doesn't make sense.
    
    ```
    fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
    fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
    fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
    ```
    Artturin committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    e0464e4 View commit details
    Browse the repository at this point in the history
  2. treewide: reformat files which need reformatting after

    `treewide: replace stdenv.is with stdenv.hostPlatform.is`
    Artturin committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    63fa53d View commit details
    Browse the repository at this point in the history