Merge pull request #316156 from vlaci/just-127

Just: 1.26.0 -> 1.28.0
This commit is contained in:
Adam C. Stephens 2024-06-07 09:36:22 -04:00 committed by GitHub
commit 7f8967c1f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 6 deletions

View File

@ -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 ---

View File

@ -2,6 +2,7 @@
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, rustPlatform , rustPlatform
, bashInteractive
, coreutils , coreutils
, installShellFiles , installShellFiles
, libiconv , libiconv
@ -11,17 +12,17 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "just"; pname = "just";
version = "1.26.0"; version = "1.28.0";
outputs = [ "out" "man" "doc" ]; outputs = [ "out" "man" "doc" ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "casey"; owner = "casey";
repo = pname; repo = pname;
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
hash = "sha256-jPVvKxTHTOFkjpTsnjy9/IxQtHLgv1fInKA6knKUmu8="; hash = "sha256-GdDpFY9xdjA60zr+i5O9wBWF682tvi4N/pxEob5tYoA=";
}; };
cargoHash = "sha256-ssZ5JxOd0XVs4hsvnSz1IvtKE7ftEKX3nN2B8SsMesw="; cargoHash = "sha256-Cvl4EY57TanJK1XGVahPHGtuEAIR44qwGEPDkXfgw5I=";
nativeBuildInputs = [ installShellFiles mdbook ]; nativeBuildInputs = [ installShellFiles mdbook ];
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
@ -42,11 +43,27 @@ rustPlatform.buildRustPackage rec {
# Return unchanged string.rs # Return unchanged string.rs
cp $TMPDIR/string.rs tests/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 = '' postBuild = ''
cargo run --package generate-book 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 # No linkcheck in sandbox
echo 'optional = true' >> book/en/book.toml echo 'optional = true' >> book/en/book.toml
mdbook build book/en mdbook build book/en
@ -54,10 +71,12 @@ rustPlatform.buildRustPackage rec {
''; '';
checkFlags = [ 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=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell
"--skip=run_shebang" # test case very rarely fails with "Text file busy" "--skip=choose::invoke_error_function" # wants JUST_CHOOSER to be fzf
"--skip=invoke_error_function" # wants JUST_CHOOSER to be fzf
"--skip=choose::default" # symlinks cat->fzf which fails as coreutils doesn't understand name "--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"
]; ];
postInstall = '' postInstall = ''