Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/cross-seed: create outputDir on start and re-enable test #384570

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pta2002
Copy link
Contributor

@pta2002 pta2002 commented Feb 23, 2025

Re-enables the test removed in #384279.

The issue with the broken test was multi-faceted:

  • There was a bug in cross-seed 6.9.1 when no client was set up where it would fail to start. The version was bumped to 6.11.1 which fixes this.
  • The outputDir was not being created. Added a tmpfiles rule that properly creates it.

I also changed the API endpoint to the /ping endpoint, and added an update script to the package.

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 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 23, 2025
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Feb 23, 2025
@pta2002
Copy link
Contributor Author

pta2002 commented Feb 23, 2025

@kevincox here's the fix!

As far as I could tell it's not really an issue with the sandboxing per-se, it's just a combination of a now-fixed bug in cross-seed and me forgetting to create the directory in the module. Both of those are now taken care of!

@pta2002 pta2002 requested a review from kevincox February 23, 2025 17:46
@pta2002 pta2002 removed the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Feb 23, 2025
@nix-owners nix-owners bot requested a review from mk3z February 23, 2025 17:53
services.cross-seed = {
enable = true;
settings = {
outputDir = "/var/lib/cross-seed/output";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the default right? Maybe we should not set it to emphasize that we are testing with only the minimal set of required options?

Copy link
Contributor

@kevincox kevincox left a comment

Choose a reason for hiding this comment

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

Please ensure that you run the tests before sending for review.

@@ -294,6 +294,7 @@ in {
curl-impersonate = handleTest ./curl-impersonate.nix {};
custom-ca = handleTest ./custom-ca.nix {};
croc = handleTest ./croc.nix {};
cross-seed = runTest ./cross-seed.nix {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cross-seed = runTest ./cross-seed.nix {};
cross-seed = runTest ./cross-seed.nix;

The test fails to evaluate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah damn, I was running the tests before rebasing on master and then accidentally re-added it wrong 🤦

Comment on lines +38 to +42
start_all()
machine.wait_for_unit("cross-seed.service")
machine.wait_for_open_port(2468)
# Check that the API is running
machine.succeed("curl --fail http://localhost:2468/api/ping?apiKey=${apiKey}")
Copy link
Contributor

Choose a reason for hiding this comment

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

This indent is broken causing the test to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants