mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
stdenv: deprecate is* aliases in favor of hostPlatform.is*
These shorthands hide the platform distinction and are unfit for cross-compilation. Wrap them in `lib.warn` so each access prints a deprecation notice, and gate them on `config.allowAliases` so they can be removed entirely. Assisted-by: claude-code with claude-opus-4-8
This commit is contained in:
@@ -201,25 +201,35 @@ let
|
||||
extraSandboxProfile
|
||||
;
|
||||
|
||||
# Utility flags to test the type of platform.
|
||||
inherit (hostPlatform)
|
||||
isDarwin
|
||||
isLinux
|
||||
isSunOS
|
||||
isCygwin
|
||||
isBSD
|
||||
isFreeBSD
|
||||
isOpenBSD
|
||||
isi686
|
||||
isx86_32
|
||||
isx86_64
|
||||
is32bit
|
||||
is64bit
|
||||
isAarch32
|
||||
isAarch64
|
||||
isMips
|
||||
isBigEndian
|
||||
;
|
||||
}
|
||||
// lib.optionalAttrs config.allowAliases (
|
||||
lib.mapAttrs
|
||||
(
|
||||
name: value: lib.warn "stdenv.${name} is deprecated, use stdenv.hostPlatform.${name} instead" value
|
||||
)
|
||||
{
|
||||
# Added 2026-05-09
|
||||
inherit (hostPlatform)
|
||||
isDarwin
|
||||
isLinux
|
||||
isSunOS
|
||||
isCygwin
|
||||
isBSD
|
||||
isFreeBSD
|
||||
isOpenBSD
|
||||
isi686
|
||||
isx86_32
|
||||
isx86_64
|
||||
is32bit
|
||||
is64bit
|
||||
isAarch32
|
||||
isAarch64
|
||||
isMips
|
||||
isBigEndian
|
||||
;
|
||||
}
|
||||
)
|
||||
// {
|
||||
|
||||
# Override `system` so that packages can get the system of the host
|
||||
# platform through `stdenv.system`. `system` is originally set to the
|
||||
|
||||
Reference in New Issue
Block a user