Open philiptaron opened 3 months ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/call-for-testing-nix-formatter/39179/21
Did a quick check for false positives, found four:
lib.cleanSourceWith
to filter out default.nixpkgs/build-support/node/fetch-npm-deps/default.nix maintainers/scripts/convert-to-import-cargo-lock/default.nix pkgs/misc/documentation-highlighter/default.nix
src = ./.
in a commentThanks! I updated the listing to check those off.
Note that we can use the new lib.fileset
library (tutorial) to fix this now!
Made a bunch of PRs to fix some of these, see the links above :)
Made a bunch of PRs to fix some of these, see the links above :)
All ✅ by me or someone else.
Also mentioning it here, this is a hack to print the filtered out files of a fileset by default :P:
diff --git a/lib/fileset/default.nix b/lib/fileset/default.nix
index bb327226731e..32bfcf21ecf6 100644
--- a/lib/fileset/default.nix
+++ b/lib/fileset/default.nix
@@ -123,6 +123,7 @@ let
isPath
pathExists
seq
+ trace
typeOf
nixVersion
;
@@ -473,6 +474,8 @@ in {
- Set `fileset` to a file set that cannot contain files outside the `root` (${toString root}). This could change the files included in the result.''
else
seq sourceFilter
+ trace "lib.fileset.toSource: These files are excluded:"
+ seq (_printFileset (_difference (_singleton root) fileset))
cleanSourceWith {
name = "source";
src = root;
Whoops it looks like we missed https://github.com/NixOS/nixpkgs/pull/300428
For pkgs/tools/nix/nixos-option/default.nix, consider merging https://github.com/NixOS/nixpkgs/pull/313497 instead.
@Infinidoge and I fixed fetchYarnDeps unaware of this tracking issue. It appears to have been missed in this list somehow, perhaps your regex needs updating.
Fixing a bunch here: https://github.com/NixOS/nixpkgs/pull/326430
Issue description
Derivations that use
src = ./.
will be rebuilt on any change to the.nix
file that includes them, including formatting changes caused bynixfmt-rfc-style
for RFC 166.List of files where this may be the case
Generated with
rg -F 'src = ./.' --sort=path -l -tnix
and not very thoroughly audited. Unchecked entries need work or attention.cleanSourceWith
)cleanSourceWith
)[ ] pkgs/development/compilers/ghcjs/8.10/stage0.nix(not used)[ ] pkgs/development/compilers/pakcs/curry-frontend.nix(not used)cleanSourceWith
)