From b0c8ad3e3b98d92e3678efe66b1a630ea0d93841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:05:16 +0000 Subject: [PATCH 1/5] just: 1.26.0 -> 1.28.0 --- pkgs/by-name/ju/just/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index d635d1271a2e..8801ae721038 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -11,17 +11,17 @@ rustPlatform.buildRustPackage rec { pname = "just"; - version = "1.26.0"; + version = "1.28.0"; outputs = [ "out" "man" "doc" ]; src = fetchFromGitHub { owner = "casey"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-jPVvKxTHTOFkjpTsnjy9/IxQtHLgv1fInKA6knKUmu8="; + hash = "sha256-GdDpFY9xdjA60zr+i5O9wBWF682tvi4N/pxEob5tYoA="; }; - cargoHash = "sha256-ssZ5JxOd0XVs4hsvnSz1IvtKE7ftEKX3nN2B8SsMesw="; + cargoHash = "sha256-Cvl4EY57TanJK1XGVahPHGtuEAIR44qwGEPDkXfgw5I="; nativeBuildInputs = [ installShellFiles mdbook ]; buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; From 1a45d56a7a0b9532a0c0dc7f28027a7ff783407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Fri, 31 May 2024 14:50:06 +0200 Subject: [PATCH 2/5] just: make test exclusion more precise Added test module names where absent, also added problematic test names where the whole module was excluded previously. --- pkgs/by-name/ju/just/package.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index 8801ae721038..6f5d5afa03ef 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -54,10 +54,11 @@ rustPlatform.buildRustPackage rec { ''; checkFlags = [ - "--skip=edit" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched - "--skip=run_shebang" # test case very rarely fails with "Text file busy" - "--skip=invoke_error_function" # wants JUST_CHOOSER to be fzf + "--skip=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell + "--skip=choose::invoke_error_function" # wants JUST_CHOOSER to be fzf "--skip=choose::default" # symlinks cat->fzf which fails as coreutils doesn't understand name + "--skip=edit::editor_precedence" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched + "--skip=shebang::run_shebang" # test case very rarely fails with "Text file busy" ]; postInstall = '' From 21ea0e48c85bd1b674aa77b295b6c727419e9211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Fri, 31 May 2024 14:52:05 +0200 Subject: [PATCH 3/5] just: New test in 1.27.0 assumes JUST_CHOOSER is unset --- pkgs/by-name/ju/just/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index 6f5d5afa03ef..a8b66340ec22 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -57,6 +57,7 @@ rustPlatform.buildRustPackage rec { "--skip=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell "--skip=choose::invoke_error_function" # wants JUST_CHOOSER to be fzf "--skip=choose::default" # symlinks cat->fzf which fails as coreutils doesn't understand name + "--skip=config::tests::show_arguments" # interferes with JUST_CHOOSER being set "--skip=edit::editor_precedence" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched "--skip=shebang::run_shebang" # test case very rarely fails with "Text file busy" ]; From 8d548d61ec95cc01efa14206f78eb2f8b593aaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:30:41 +0200 Subject: [PATCH 4/5] just: make new bash completion test work from build --- .../ju/just/fix-just-path-in-tests.patch | 20 +++++++++++++++++++ pkgs/by-name/ju/just/package.nix | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/by-name/ju/just/fix-just-path-in-tests.patch diff --git a/pkgs/by-name/ju/just/fix-just-path-in-tests.patch b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch new file mode 100644 index 000000000000..63587ebc698a --- /dev/null +++ b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch @@ -0,0 +1,20 @@ +diff --git a/tests/completions/just.bash b/tests/completions/just.bash +index 6d5c12c..13bff87 100755 +--- a/tests/completions/just.bash ++++ b/tests/completions/just.bash +@@ -17,11 +17,13 @@ reply_equals() { + fi + } + ++just() { ++ cargo run -- "$@" ++} ++ + # --- Initial Setup --- + source "$1" + cd tests/completions +-cargo build +-PATH="$(git rev-parse --show-toplevel)/target/debug:$PATH" + exit_code=0 + + # --- Tests --- diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index a8b66340ec22..1a24bd46d8fc 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , rustPlatform +, bashInteractive , coreutils , installShellFiles , libiconv @@ -42,8 +43,16 @@ rustPlatform.buildRustPackage rec { # Return unchanged string.rs cp $TMPDIR/string.rs tests/string.rs + + # For shell completion tests + export PATH=${bashInteractive}/bin:$PATH + patchShebangs tests ''; + patches = [ + ./fix-just-path-in-tests.patch + ]; + postBuild = '' cargo run --package generate-book From 669bc7294960d973f43dfee3e200ca06186aee29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:40:46 +0200 Subject: [PATCH 5/5] just: genereate man pages and shell completions dynamically These assets are no longer present in the repository --- pkgs/by-name/ju/just/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index 1a24bd46d8fc..c598c2d1ed5a 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -56,6 +56,14 @@ rustPlatform.buildRustPackage rec { postBuild = '' cargo run --package generate-book + mkdir -p completions man + + cargo run -- --man > man/just.1 + + for shell in bash fish zsh; do + cargo run -- --completions $shell > completions/just.$shell + done + # No linkcheck in sandbox echo 'optional = true' >> book/en/book.toml mdbook build book/en