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

ruff: skip some failing tests on darwin #374697

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

natsukium
Copy link
Member

fix for #374335

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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jan 18, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 18, 2025
@nix-owners nix-owners bot requested review from figsoda and GaetanLepage January 18, 2025 02:13
@natsukium natsukium marked this pull request as draft January 18, 2025 02:37
@natsukium
Copy link
Member Author

I'm not sure why this option is unexpected.

ruff-aarch64-darwin>      Running tests/fixtures/main.rs (target/aarch64-apple-darwin/debug/deps/fixtures-e8e11b634bb8a8d8)
ruff-aarch64-darwin> error: unexpected argument '--skip=added_package' found
ruff-aarch64-darwin> 
ruff-aarch64-darwin> Usage: fixtures-e8e11b634bb8a8d8 [OPTIONS] [FILTER]
ruff-aarch64-darwin> 
ruff-aarch64-darwin> For more information, try '--help'.
ruff-aarch64-darwin> error: test failed, to rerun pass `-p ruff_annotate_snippets --test fixtures`
ruff-aarch64-darwin> 
ruff-aarch64-darwin> Caused by:
ruff-aarch64-darwin>   process didn't exit successfully: `/private/tmp/nix-build-ruff-0.9.2.drv-0/source/target/aarch64-apple-darwin/debug/deps/fixtures-e8e11b634bb8a8d8 --test-threads=8 -- --test-threads=8 --skip=added_package --skip=add_search_path --skip=changed_file --skip=changed_versions_file --skip=deleted_file --skip=directory_deleted --skip=directory_moved_to_project --skip=directory_moved_to_trash --skip=directory_moved_to_workspace --skip=directory_renamed --skip=hard_links_in_project --skip=hard_links_in_workspace --skip=hard_links_to_target_outside_project --skip=hard_links_to_target_outside_workspace --skip=move_file_to_project --skip=move_file_to_trash --skip=move_file_to_workspace --skip=nested_packages_delete_root --skip=nested_projects_delete_root --skip=new_file --skip=new_ignored_file --skip=removed_package --skip=rename_file --skip=search_path '--skip=unix::changed_metadata' '--skip=unix::symlink_inside_project' '--skip=unix::symlink_inside_workspace' '--skip=unix::symlinked_module_search_path'` (exit status: 2)

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374697


x86_64-darwin

❌ 10 packages failed to build:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references

aarch64-darwin

❌ 10 packages failed to build:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references

@GaetanLepage
Copy link
Contributor

error: unexpected argument '--skip=add_search_path' found

@erratic-pattern
Copy link
Contributor

error: unexpected argument '--skip=add_search_path' found

I'm seeing this as well, and I'm also getting a similar error on current nixpkgs-unstable:

error: unexpected argument '--skip=added_package' found

Is there something wrong with how these flags are being passed to cargo?

@erratic-pattern
Copy link
Contributor

Removing all of the --skip flags works for me on darwin:

For example in the following overlay:

self: super: {
  ruff = super.ruff.overrideAttrs (oldAttrs: {
    checkFlags = [];
  });
}

Perhaps these flags are no longer needed?

nix-shell -p nix-info --run "nix-info -m"

  • system: "aarch64-darwin"
  • host os: Darwin 23.6.0, macOS 14.6.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.25.3
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/store/l9nb64iii15y0nr37qrs1cfm6rlpg6gh-source

@erratic-pattern erratic-pattern mentioned this pull request Jan 19, 2025
13 tasks
@natsukium
Copy link
Member Author

Perhaps these flags are no longer needed?

I got the following error when checkFlags was empty.

ruff-aarch64-darwin> failures:
ruff-aarch64-darwin>     add_search_path
ruff-aarch64-darwin>     changed_file
ruff-aarch64-darwin>     changed_versions_file
ruff-aarch64-darwin>     deleted_file
ruff-aarch64-darwin>     directory_deleted
ruff-aarch64-darwin>     directory_moved_to_project
ruff-aarch64-darwin>     directory_moved_to_trash
ruff-aarch64-darwin>     directory_renamed
ruff-aarch64-darwin>     hard_links_in_project
ruff-aarch64-darwin>     hard_links_to_target_outside_project
ruff-aarch64-darwin>     move_file_to_project
ruff-aarch64-darwin>     move_file_to_trash
ruff-aarch64-darwin>     nested_projects_delete_root
ruff-aarch64-darwin>     new_file
ruff-aarch64-darwin>     new_ignored_file
ruff-aarch64-darwin>     rename_file
ruff-aarch64-darwin>     search_path
ruff-aarch64-darwin>     unix::changed_metadata
ruff-aarch64-darwin>     unix::symlink_inside_project
ruff-aarch64-darwin>     unix::symlinked_module_search_path
ruff-aarch64-darwin> 
ruff-aarch64-darwin> test result: FAILED. 1 passed; 20 failed; 1 ignored; 0 measured; 0 filtered out; finished in 31.27s

@natsukium
Copy link
Member Author

sandbox: no

I think it is because the sandbox is disabled in your environment.
We build with sandbox = relaxed.

@natsukium natsukium marked this pull request as ready for review January 19, 2025 02:57
@natsukium
Copy link
Member Author

I changed to using cargoTestFlags instead of checkFlags.
Also, cargoCheckHook was called twice, so it was removed.

@github-actions github-actions bot added 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 19, 2025
@natsukium
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374697


x86_64-linux

✅ 8 packages built:
  • nbqa
  • nixpkgs-openjdk-updater
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references

aarch64-linux

❌ 4 packages failed to build:
✅ 4 packages built:
  • nbqa
  • nixpkgs-openjdk-updater
  • ruff
  • tests.testers.nixosTest-example

x86_64-darwin

❌ 5 packages failed to build:
✅ 3 packages built:
  • nbqa
  • nixpkgs-openjdk-updater
  • ruff

aarch64-darwin

❌ 1 package failed to build:
✅ 7 packages built:
  • nbqa
  • nixpkgs-openjdk-updater
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374697


x86_64-linux

✅ 10 packages built:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references

aarch64-linux

✅ 10 packages built:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references

x86_64-darwin

❌ 5 packages failed to build:
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references
✅ 5 packages built:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff

aarch64-darwin

❌ 5 packages failed to build:
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example
  • tests.trivial-builders.references
✅ 5 packages built:
  • nbqa
  • nbqa.dist
  • nixpkgs-openjdk-updater
  • nixpkgs-openjdk-updater.dist
  • ruff

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

Thanks @natsukium !

@GaetanLepage GaetanLepage merged commit 935af66 into NixOS:master Jan 19, 2025
28 of 30 checks passed
@natsukium natsukium deleted the ruff/darwin-fix branch January 19, 2025 09:59
9999years added a commit to 9999years/dotfiles that referenced this pull request Jan 21, 2025
Move to `master` from `nixos-unstable` until this PR fixing the `ruff`
build is available on `nixos-unstable`:
NixOS/nixpkgs#374697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants