From ce271786deaef526b9c99da85bf84ab4ff24a472 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 02:16:49 +0100 Subject: [PATCH] tests.nixpkgs-check-by-name: More spaces in errors --- .../nixpkgs-check-by-name/src/nixpkgs_problem.rs | 15 ++++++++++----- .../tests/alt-callPackage/expected | 1 + .../tests/manual-definition/expected | 2 ++ .../non-syntactical-callPackage-by-name/expected | 1 + .../tests/override-different-file/expected | 1 + .../tests/override-empty-arg/expected | 1 + .../tests/override-no-call-package/expected | 1 + .../tests/override-no-file/expected | 1 + .../tests/override-non-path/expected | 1 + 9 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index cf40238f9cb6..762d0e9fb0e0 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -204,7 +204,8 @@ impl fmt::Display for NixpkgsProblem { Notably the second argument must not be empty, which is not the case. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -222,7 +223,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: A different `callPackage` is used. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -240,7 +242,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: The first callPackage argument is not right: It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -258,7 +261,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: The first `callPackage` argument is the wrong path. It is defined in {}:{}:{} as - {package_name} = callPackage {} {{ /* ... */ }};", + {package_name} = callPackage {} {{ /* ... */ }}; + ", structure::relative_dir_for_package(package_name).display(), create_path_expr(file, expected_path), file.display(), line, column, @@ -275,7 +279,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected index 80d79ecaba12..2d05db0d4699 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:5 as foo = self.alt.callPackage ({ }: self.someDrv) { }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index e619887012d0..71d78019604b 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -6,6 +6,7 @@ It is defined in all-packages.nix:9 as noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; + - Because pkgs/by-name/on/onlyMove exists, the attribute `pkgs.onlyMove` must be defined like onlyMove = callPackage ./pkgs/by-name/on/onlyMove/package.nix { /* ... */ }; @@ -14,4 +15,5 @@ It is defined in all-packages.nix:7 as onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index 5f914d1fce96..f56585ac4678 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:4 as foo = self.bar; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 6f439dd4b7d0..571ec8e09a5c 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2:3 as nonDerivation = callPackage ./someDrv.nix { /* ... */ }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index dc64698f4bfa..257030e9a6c0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.callPackage ./pkgs/by-name/no/nonDerivation/package.nix { }; + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index f1fc4892b2ab..eb13c4df1e88 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.someDrv; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index 040d7c635f7a..31679e55b7d6 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index 1f15c6473b4a..e7fd8242f5f4 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:3 as foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; + This PR introduces the above problems, merging would break the base branch