The indentation stripping semantics of strings are fairly bad and have a few gotchas where they behave unintuitively. But the good news is, that these cases are easy to catch and can be avoided. This commit adds a warning in the parser when such strings are detected. Unfortunately Nixpkgs uses this kind of a lot, so we won't be able to actually enable this warning for a while to come. Co-authored-by: Commentator2.0 <lix@crystal-cavern.systems> Change-Id: I3b3b68c2eee4cd70959d3f4ca643cb6caf3a2217
30 lines
812 B
Nix
30 lines
812 B
Nix
{
|
|
lib,
|
|
runCommand,
|
|
nix,
|
|
|
|
nixpkgs-regression,
|
|
}:
|
|
|
|
let
|
|
inherit (lib) concatStringsSep;
|
|
|
|
# FIXME: All of these are fixed in Nixpkgs already, so clear the list on the next `nixpkgs-regression` bump
|
|
deprecatedFeatures = [
|
|
"broken-string-indentation"
|
|
];
|
|
in
|
|
|
|
runCommand "eval-nixos"
|
|
{
|
|
buildInputs = [ nix ];
|
|
env.NIX_CONFIG = "extra-deprecated-features = ${concatStringsSep " " deprecatedFeatures}";
|
|
}
|
|
''
|
|
type -p nix-env
|
|
# Note: we're filtering out nixos-install-tools because https://github.com/NixOS/nixpkgs/pull/153594#issuecomment-1020530593.
|
|
time nix-env --store dummy:// -f ${nixpkgs-regression} -qaP --drv-path | sort | grep -v nixos-install-tools > packages
|
|
[[ $(sha1sum < packages | cut -c1-40) = 402242fca90874112b34718b8199d844e8b03d12 ]]
|
|
mkdir $out
|
|
''
|