mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
ci/parse: only show first error
There is no point in running the much slower `parse-each` part for each interpreter/version. The CI job is not meant as a development tool that should report all parse errors at once, but as a confirmation that no parse errors are present on *different interpreter versions*. Once this test fails, Eval, nixpkgs-vet and treefmt will most likely fail as well - with more information for multiple parse errors.
This commit is contained in:
parent
203b1670b3
commit
7a8622a0af
1 changed files with 5 additions and 15 deletions
20
ci/parse.nix
20
ci/parse.nix
|
|
@ -23,21 +23,11 @@ runCommand "nix-parse-${nix.name}"
|
|||
|
||||
cd "${nixpkgs}"
|
||||
|
||||
# Passes all files to nix-instantiate at once.
|
||||
# Much faster, but will only show first error.
|
||||
parse-all() {
|
||||
find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse >/dev/null 2>/dev/null
|
||||
}
|
||||
|
||||
# Passes each file separately to nix-instantiate with -n1.
|
||||
# Much slower, but will show all errors.
|
||||
parse-each() {
|
||||
find . -type f -iname '*.nix' | xargs -n1 -P $(nproc) nix-instantiate --parse >/dev/null
|
||||
}
|
||||
|
||||
if ! parse-all; then
|
||||
parse-each
|
||||
fi
|
||||
# This will only show the first parse error, not all of them. That's fine, because
|
||||
# the other CI jobs will report in more detail. This job is about checking parsing
|
||||
# across different implementations / versions, not about providing the best DX.
|
||||
# Returning all parse errors requires significantly more resources.
|
||||
find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse >/dev/null
|
||||
|
||||
touch $out
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue