From 8d26e1dafc2cba4e98856575524309e493cdfe21 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Sat, 17 Feb 2024 12:43:16 +0800 Subject: [PATCH 1/3] git-branchless: improve for cross compiling In a previous commit d5a849cb0fc23af09f1a668e46d20510cf446884, the `postInstall` hook invokes the host binary `git-branchless`, which would probably fail when cross compiling. In this commit, we simply disable the hook in these cases. Also, add myself to meta.maintainers. --- .../applications/version-management/git-branchless/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-branchless/default.nix b/pkgs/applications/version-management/git-branchless/default.nix index 0e83d17d33a7..fd835a3b924b 100644 --- a/pkgs/applications/version-management/git-branchless/default.nix +++ b/pkgs/applications/version-management/git-branchless/default.nix @@ -40,7 +40,7 @@ rustPlatform.buildRustPackage rec { libiconv ]; - postInstall = '' + postInstall = lib.optionalString (with stdenv; buildPlatform.canExecute hostPlatform) '' $out/bin/git-branchless install-man-pages $out/share/man ''; @@ -63,6 +63,7 @@ rustPlatform.buildRustPackage rec { maintainers = with maintainers; [ nh2 hmenke + bryango ]; }; } From 56698b568306357793c932dee01ee4b3d0e22aa6 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Tue, 15 Oct 2024 10:53:57 +0800 Subject: [PATCH 2/3] git-branchless: 0.9.0 -> 0.10.0 & fix build --- .../git-branchless/default.nix | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/version-management/git-branchless/default.nix b/pkgs/applications/version-management/git-branchless/default.nix index fd835a3b924b..683b5fd813a2 100644 --- a/pkgs/applications/version-management/git-branchless/default.nix +++ b/pkgs/applications/version-management/git-branchless/default.nix @@ -15,16 +15,16 @@ rustPlatform.buildRustPackage rec { pname = "git-branchless"; - version = "0.9.0"; + version = "0.10.0"; src = fetchFromGitHub { owner = "arxanas"; repo = "git-branchless"; rev = "v${version}"; - hash = "sha256-4RRSffkAe0/8k4SNnlB1iiaW4gWFTuYXplVBj2aRIdU="; + hash = "sha256-8uv+sZRr06K42hmxgjrKk6FDEngUhN/9epixRYKwE3U="; }; - cargoHash = "sha256-Jg4d7tJXr2O1sEDdB/zk+7TPBZvgHlmW8mNiXozLKV8="; + cargoHash = "sha256-AEEAHMKGVYcijA+Oget+maDZwsk/RGPhHQfiv+AT4v8="; nativeBuildInputs = [ pkg-config ]; @@ -48,11 +48,39 @@ rustPlatform.buildRustPackage rec { export TEST_GIT=${git}/bin/git export TEST_GIT_EXEC_PATH=$(${git}/bin/git --exec-path) ''; - # FIXME: these tests deadlock when run in the Nix sandbox + + # Note that upstream has disabled CI tests for git>=2.46 + # See: https://github.com/arxanas/git-branchless/issues/1416 + # https://github.com/arxanas/git-branchless/pull/1417 checkFlags = [ + # FIXME: these tests deadlock when run in the Nix sandbox "--skip=test_switch_pty" "--skip=test_next_ambiguous_interactive" "--skip=test_switch_auto_switch_interactive" + # harmless failures, also appear in upstream CI + # see e.g. https://github.com/user-attachments/files/17016948/git-branchless-job-logs.txt + "--skip=test_amend_undo" # git-branchless#1345 + # harmless, extra: "branchless: processing 1 update: ref HEAD" + "--skip=test_symbolic_transaction_ref" + "--skip=test_move_branch_on_merge_conflict_resolution" + "--skip=test_move_branches_after_move" + "--skip=test_move_delete_checked_out_branch" + "--skip=test_move_no_reapply_squashed_commits" + "--skip=test_move_orphaned_root" + "--skip=test_restore_snapshot_basic" + "--skip=test_restore_snapshot_delete_file_only_in_index" + "--skip=test_restore_snapshot_deleted_files" + "--skip=test_sync_basic" + "--skip=test_sync_no_delete_main_branch" + # probably harmless, without the extra "Check out from ... to ..." step + "--skip=test_undo_doesnt_make_working_dir_dirty" + "--skip=test_undo_move_refs" + "--skip=test_undo_noninteractive" + # probably harmless, different EventCursor::event_id + "--skip=test_undo_hide" + ]; + cargoTestFlags = [ + "--no-fail-fast" # make post-mortem easier ]; meta = with lib; { From 8d7be6e3d03e3fae0ec597a312681ab61f16b0a7 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Tue, 15 Oct 2024 23:12:45 +0800 Subject: [PATCH 3/3] git-branchless: disable tests for now The previous commit is kept as a record of the currently failing tests, for future reference. --- .../git-branchless/default.nix | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/version-management/git-branchless/default.nix b/pkgs/applications/version-management/git-branchless/default.nix index 683b5fd813a2..b5dac8816441 100644 --- a/pkgs/applications/version-management/git-branchless/default.nix +++ b/pkgs/applications/version-management/git-branchless/default.nix @@ -52,35 +52,14 @@ rustPlatform.buildRustPackage rec { # Note that upstream has disabled CI tests for git>=2.46 # See: https://github.com/arxanas/git-branchless/issues/1416 # https://github.com/arxanas/git-branchless/pull/1417 + # To be re-enabled once arxanas/git-branchless#1416 is resolved + doCheck = false; + checkFlags = [ # FIXME: these tests deadlock when run in the Nix sandbox "--skip=test_switch_pty" "--skip=test_next_ambiguous_interactive" "--skip=test_switch_auto_switch_interactive" - # harmless failures, also appear in upstream CI - # see e.g. https://github.com/user-attachments/files/17016948/git-branchless-job-logs.txt - "--skip=test_amend_undo" # git-branchless#1345 - # harmless, extra: "branchless: processing 1 update: ref HEAD" - "--skip=test_symbolic_transaction_ref" - "--skip=test_move_branch_on_merge_conflict_resolution" - "--skip=test_move_branches_after_move" - "--skip=test_move_delete_checked_out_branch" - "--skip=test_move_no_reapply_squashed_commits" - "--skip=test_move_orphaned_root" - "--skip=test_restore_snapshot_basic" - "--skip=test_restore_snapshot_delete_file_only_in_index" - "--skip=test_restore_snapshot_deleted_files" - "--skip=test_sync_basic" - "--skip=test_sync_no_delete_main_branch" - # probably harmless, without the extra "Check out from ... to ..." step - "--skip=test_undo_doesnt_make_working_dir_dirty" - "--skip=test_undo_move_refs" - "--skip=test_undo_noninteractive" - # probably harmless, different EventCursor::event_id - "--skip=test_undo_hide" - ]; - cargoTestFlags = [ - "--no-fail-fast" # make post-mortem easier ]; meta = with lib; {