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

Option to build and export Rust tests and executables #74

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

szg251
Copy link
Collaborator

@szg251 szg251 commented Feb 7, 2025

  • Export tests option for Rust
  • Don't check exported tests

@szg251 szg251 force-pushed the szg251/rust-build-artifacts branch from 0b7a41c to 64923fb Compare February 8, 2025 20:22
@szg251 szg251 requested a review from jaredponn February 9, 2025 14:14
Copy link
Collaborator

@jaredponn jaredponn left a comment

Choose a reason for hiding this comment

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

Amazing!!

cargoExtraArgs = cargoNextestExtraArgs + " --tests";
nativeBuildInputs = commonArgs.nativeBuildInputs ++ testTools ++ [ pkgs.jq ];
installPhaseCommand = ''
files=$(cat $cargoBuildLog | jq -r 'select(.target.kind | . != null and contains(["test"])).executable')
Copy link
Collaborator

@jaredponn jaredponn Feb 9, 2025

Choose a reason for hiding this comment

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

Just wanted to note that this requires that the test executables have "non-weird names" e.g. tests shoudln't have names with spaces in them etc. Is this a requirement in cargo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants