Skip to content

Commit

Permalink
Update flake.lock (ipetkov#382)
Browse files Browse the repository at this point in the history
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/919d646de7be200f3bf08cb76ae1f09402b6f9b4' (2023-07-11)
  → 'github:numtide/flake-utils/f9e7cf818399d17d347f847525c5a5a8032e4e44' (2023-08-23)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5068bc8fe943bde3c446326da8d0ca9c93d5a682' (2023-08-07)
  → 'github:NixOS/nixpkgs/e7f35e03abd06a2faef6684d0de813370e13bda8' (2023-09-02)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/b520a3889b24aaf909e287d19d406862ced9ffc9' (2023-08-07)
  → 'github:oxalica/rust-overlay/98ccb73e6eefc481da6039ee57ad8818d1ca8d56' (2023-09-03)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ipetkov and github-actions[bot] authored Sep 3, 2023
1 parent 7b92b59 commit 6630354
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
15 changes: 14 additions & 1 deletion checks/cleanCargoTomlTests/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ cleanCargoToml
, lib
, linkFarmFromDrvs
, remarshal
, runCommand
, writeTOML
}:
Expand All @@ -12,9 +14,20 @@ let
};
cleanedToml = writeTOML "cleaned.toml" cleaned;
expected = path + "/expected.toml";

# 23.05 has remarshal 0.14 which sorts keys by default
# starting with version 0.16 ordering is preserved unless
# --sort-keys is specified
sortKeys = lib.optionalString
(lib.strings.versionAtLeast remarshal.version "0.16.0")
"--sort-keys";
in
runCommand "compare-${name}" { } ''
diff ${expected} ${cleanedToml}
function reformat {
${remarshal}/bin/remarshal ${sortKeys} -i "$1" --of toml
}
diff <(reformat ${expected}) <(reformat ${cleanedToml})
touch $out
'';
in
Expand Down
19 changes: 18 additions & 1 deletion checks/mkDummySrcTests/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, linkFarmFromDrvs
, mkDummySrc
, remarshal
, runCommand
, writeText
}:
Expand All @@ -12,10 +13,26 @@ let
cp --recursive ${orig_actual} --no-target-directory $out --no-preserve=mode,ownership
find $out -name Cargo.toml | xargs sed -i"" 's!/nix/store/[^-]\+-dummy.rs!cranespecific-dummy.rs!'
'';

# 23.05 has remarshal 0.14 which sorts keys by default
# starting with version 0.16 ordering is preserved unless
# --sort-keys is specified
sortKeys = lib.optionalString
(lib.strings.versionAtLeast remarshal.version "0.16.0")
"--sort-keys";
in
runCommand "compare-${name}" { } ''
echo ${expected} ${actual}
diff -r ${expected} ${actual}
cp -r --no-preserve=ownership,mode ${expected} ./expected
cp -r --no-preserve=ownership,mode ${actual} ./actual
find ./expected ./actual \
-name Cargo.toml \
-exec mv '{}' '{}.bak' \; \
-exec ${remarshal}/bin/remarshal ${sortKeys} --if toml -i '{}.bak' --of toml -o '{}' \;
find ./expected ./actual -name Cargo.toml.bak -delete
diff -r ./expected ./actual
touch $out
'';

Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6630354

Please sign in to comment.