Skip to content

qcp: init at 0.8.1#361923

Open
terrorbyte wants to merge 1 commit intoNixOS:masterfrom
terrorbyte:pkgs/terrorbyte/qcp
Open

qcp: init at 0.8.1#361923
terrorbyte wants to merge 1 commit intoNixOS:masterfrom
terrorbyte:pkgs/terrorbyte/qcp

Conversation

@terrorbyte
Copy link
Copy Markdown
Member

Adds the qcp package. This package is an experimental high-performance remote file copy utility used for long-distance transfers.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 5, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Dec 5, 2024
@terrorbyte terrorbyte changed the title qcp: init at 0.1.3 qcp: init at 0.2.0 Dec 31, 2024
@github-actions github-actions bot removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Dec 31, 2024
@terrorbyte terrorbyte changed the title qcp: init at 0.2.0 qcp: init at 0.2.1 Jan 25, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 25, 2025
@crazyscot
Copy link
Copy Markdown

FYI qcp 0.3.0 has been released. It is a breaking protocol change, dropping the dependency on capnp.

@terrorbyte terrorbyte changed the title qcp: init at 0.2.1 qcp: init at 0.3.0 Feb 12, 2025
@terrorbyte
Copy link
Copy Markdown
Member Author

I bumped to 0.3.0 and added the man page handling from our flake discussions.

@Tert0
Copy link
Copy Markdown
Member

Tert0 commented Feb 14, 2025

Some suggestions:

diff --git a/pkgs/by-name/qc/qcp/package.nix b/pkgs/by-name/qc/qcp/package.nix
index 89ac71723a12..ae84c97df689 100644
--- a/pkgs/by-name/qc/qcp/package.nix
+++ b/pkgs/by-name/qc/qcp/package.nix
@@ -1,7 +1,9 @@
 {
   lib,
-  fetchFromGitHub,
   rustPlatform,
+  fetchFromGitHub,
+  versionCheckHook,
+  nix-update-script,
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -10,31 +12,40 @@ rustPlatform.buildRustPackage rec {
 
   src = fetchFromGitHub {
     owner = "crazyscot";
-    repo = pname;
-    rev = "v${version}";
+    repo = "qcp";
+    tag = "v${version}";
     hash = "sha256-9nJ01OPAU60veLpL2BlSSUTMu/xdUBDVkV0YEFNQ3FU=";
   };
 
-  cargoHash = "sha256-7LfwJa64ZUE0i8/bMecMoxzykJvuINzXctopyh4Qlak=";
+  useFetchCargoVendor = true;
+  cargoHash = "sha256-vVlwhXaCumgwTcHjnGwD6mi+ZtZvqmtCWukQaPBQcsA=";
+
+  postInstall = ''
+    install -Dm644 $src/misc/qcp.1 $out/share/man/man1/qcp.1
+    install -Dm644 $src/misc/qcp_config.5 $out/share/man/man5/qcp_config.5
+    install -Dm644 $src/misc/20-qcp.conf $out/etc/sysctl.d/20-qcp.conf
+    install -Dm644 $src/misc/qcp.conf $out/etc/qcp.conf
+    install -Dm644 $src/README.md $out/share/doc/qcp/README.md
+    install -Dm644 $src/LICENSE $out/share/doc/qcp/LICENSE
+  '';
 
   checkFlags = [
     # SSH home directory tests will not work in nix sandbox
     "--skip=config::ssh::includes::test::home_dir"
   ];
 
+  nativeInstallCheckInputs = [ versionCheckHook ];
+  doInstallCheck = true;
+  versionCheckProgramArg = "--version";
+
+  passthru.updateScript = nix-update-script {};
+
   meta = {
-    description = "The QUIC Copier (qcp) is an experimental high-performance remote file copy utility for long-distance internet connections.";
+    description = "Experimental high-performance remote file copy utility for long-distance internet connections";
     homepage = "https://github.com/crazyscot/qcp";
-    license = lib.licenses.agpl3Only;
+    changelog = "https://github.com/crazyscot/qcp/releases/tag/v{version}";
+    license = lib.licenses.agpl3Plus;
     maintainers = with lib.maintainers; [ poptart ];
+    mainProgram = "qcp";
   };
-
-  postInstall = ''
-    install -Dm644 $src/misc/qcp.1 $out/share/man/man1/qcp.1
-    install -Dm644 $src/misc/qcp_config.5 $out/share/man/man5/qcp_config.5
-    install -Dm644 $src/misc/20-qcp.conf $out/etc/sysctl.d/20-qcp.conf
-    install -Dm644 $src/misc/qcp.conf $out/etc/qcp.conf
-    install -Dm644 $src/README.md $out/share/doc/qcp/README.md
-    install -Dm644 $src/LICENSE $out/share/doc/qcp/LICENSE
-  '';
 }

@terrorbyte
Copy link
Copy Markdown
Member Author

terrorbyte commented Feb 14, 2025

These are great suggestions and this is my first time packaging a Rust program so I appreciate the feedback. Almost everything I agree with but one thing:

-    repo = pname;
-    rev = "v${version}";
+    repo = "qcp";
+    tag = "v${version}";

Did you intend to fully replace the rev with tag? I hadn't seen that become the norm and figured it'd break the older fetcher calls.

@Tert0
Copy link
Copy Markdown
Member

Tert0 commented Feb 14, 2025

I am not aware of any downsides to using tag instead of rev.

rev corresponds to the Git commit hash or tag (e.g v1.0) that will be downloaded from Git. If you need to fetch a tag however, you should prefer to use the tag parameter which achieves this in a safer way with less boilerplate.

Source: https://nixos.org/manual/nixpkgs/stable/#fetchfromgithub

@terrorbyte
Copy link
Copy Markdown
Member Author

Looks like my confusion is because rev has been a required argument up until about 2 months ago which this PR is not based off of so the builds were failing missing that argument. Let me rebase and see if the changes work as stated.

Copy link
Copy Markdown
Contributor

@0xda157 0xda157 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also squash everything into one commit

@crazyscot
Copy link
Copy Markdown

Hello! Upstream author of qcp here. Darwin is not (yet) a supported platform, so I'm not surprised that the CI build failed there. Is darwin support essential for this PR to be accepted?

@0xda157
Copy link
Copy Markdown
Contributor

0xda157 commented Mar 25, 2025

Is darwin support essential for this PR to be accepted?

It's fine is darwin isn't supported

@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from 8cf69a3 to cff99e7 Compare April 4, 2025 20:16
@terrorbyte terrorbyte changed the title qcp: init at 0.3.0 qcp: init at 0.3.3 Apr 4, 2025
@terrorbyte
Copy link
Copy Markdown
Member Author

please also squash everything into one commit

Done. I also added a build required flag and bumped the version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
maintainers = with lib.maintainers; [ poptart ];
maintainers = with lib.maintainers; [ poptart ];
platforms = lib.platforms.linux;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it's fine to leave platforms as the default, even if it's untested upstream

@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from cff99e7 to 959a9f7 Compare April 4, 2025 20:29
Copy link
Copy Markdown
Contributor

@0xda157 0xda157 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 6, 2025
@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from 959a9f7 to 19ff522 Compare May 30, 2025 18:32
@terrorbyte terrorbyte changed the title qcp: init at 0.3.3 qcp: init at 0.4.1 May 30, 2025
@terrorbyte
Copy link
Copy Markdown
Member Author

We got quite a bit out of sync with upstream so I decided to rebase again, so it may need another re-review.

@github-actions github-actions bot removed the 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. label May 30, 2025
@timon-schelling
Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 361923

Logs: https://github.com/timon-schelling/run-nixpkgs-review/actions/runs/15914872379


x86_64-linux (sandbox = true)

✅ 1 package built:
  • qcp

aarch64-linux (sandbox = true)

✅ 1 package built:
  • qcp

x86_64-darwin (sandbox = true)

❌ 1 package failed to build:
  • qcp

Error logs: `x86_64-darwin`
qcp

failures:
control::channel::test::happy_path
os::unix::test::test_buffers_gigantic_err
os::unix::test::test_buffers_small_ok
os::windows::test::test_buffers_gigantic_err
os::windows::test::test_buffers_small_ok
session::put::test::write_fail_dest_dir_missing
session::put::test::write_fail_io_error
session::put::test::write_fail_permissions
util::socket::test::bind_ipv6
util::socket::test::bind_range
util::socket::test::set_socket_bufsize_direct
util::socket::test::set_udp_buffer_sizes_large_fails
util::socket::test::set_udp_buffer_sizes_small_succeeds

test result: FAILED. 173 passed; 13 failed; 1 ignored; 0 measured; 7 filtered out; finished in 0.95s

error: test failed, to rerun pass -p qcp --lib


aarch64-darwin (sandbox = true)

❌ 1 package failed to build:
  • qcp

Error logs: `aarch64-darwin`
qcp

failures:
control::channel::test::happy_path
os::unix::test::test_buffers_gigantic_err
os::unix::test::test_buffers_small_ok
os::windows::test::test_buffers_gigantic_err
os::windows::test::test_buffers_small_ok
session::put::test::write_fail_dest_dir_missing
session::put::test::write_fail_io_error
session::put::test::write_fail_permissions
util::socket::test::bind_ipv6
util::socket::test::bind_range
util::socket::test::set_socket_bufsize_direct
util::socket::test::set_udp_buffer_sizes_large_fails
util::socket::test::set_udp_buffer_sizes_small_succeeds

test result: FAILED. 173 passed; 13 failed; 1 ignored; 0 measured; 7 filtered out; finished in 0.65s

error: test failed, to rerun pass -p qcp --lib

@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from 19ff522 to 40d778d Compare July 11, 2025 16:50
@terrorbyte terrorbyte changed the title qcp: init at 0.4.1 qcp: init at 0.4.2 Jul 11, 2025
@terrorbyte
Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 361923

Logs: https://github.com/timon-schelling/run-nixpkgs-review/actions/runs/15914872379

x86_64-linux (sandbox = true)

✅ 1 package built:

aarch64-linux (sandbox = true)

✅ 1 package built:

x86_64-darwin (sandbox = true)

❌ 1 package failed to build:

Error logs: x86_64-darwin

aarch64-darwin (sandbox = true)

❌ 1 package failed to build:

Error logs: aarch64-darwin

I unfortunately do not have a Darwin/mac to test this with, but I applied some buildtime checks for skipping the tests and bumped versions again.

@terrorbyte terrorbyte requested a review from 0xda157 July 21, 2025 23:44
@0xda157
Copy link
Copy Markdown
Contributor

0xda157 commented Jul 23, 2025

I'll run nixpkgs-review-gha again and it darwin isn't fixed you can just mark it as meta.broken = isDarwin

@0xda157
Copy link
Copy Markdown
Contributor

0xda157 commented Jul 23, 2025

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 361923

Logs: https://github.com/awwpotato/nixpkgs-review-gha/actions/runs/16460044796


x86_64-linux

✅ 1 package built:
  • qcp

aarch64-linux

✅ 1 package built:
  • qcp

x86_64-darwin (sandbox = true)

✅ 1 package built:
  • qcp

aarch64-darwin (sandbox = true)

✅ 1 package built:
  • qcp

@0xda157
Copy link
Copy Markdown
Contributor

0xda157 commented Jul 23, 2025

everything should just be in one qcp: init at 0.4.2 commit, aside from that LGTM

@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from de6d1e4 to 3512da8 Compare July 24, 2025 15:21
@terrorbyte
Copy link
Copy Markdown
Member Author

Done.

@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from 3512da8 to c668a8d Compare July 25, 2025 15:35
@terrorbyte terrorbyte force-pushed the pkgs/terrorbyte/qcp branch from c668a8d to b181ded Compare August 29, 2025 22:19
@terrorbyte terrorbyte changed the title qcp: init at 0.4.2 qcp: init at 0.5.1 Aug 29, 2025
@terrorbyte terrorbyte changed the title qcp: init at 0.5.1 qcp: init at 0.6.0 Nov 29, 2025
@terrorbyte terrorbyte changed the title qcp: init at 0.6.0 qcp: init at 0.8.1 Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants