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

Use extract-to if using --archive-file with nextest #266

Merged
merged 11 commits into from
Dec 28, 2023

Conversation

magnusja
Copy link
Contributor

@magnusja magnusja commented Apr 26, 2023

Addresses #265

Fails with

error: no input files specified. See llvm-profdata merge -help
error: failed to merge profile data: process didn't exit successfully: `/home/magnus/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -sparse -f /home/magnus/Documents/code/luminovo/epibator/rust-workspace/target/llvm-cov-target/rust-workspace-profraw-list -o /home/magnus/Documents/code/luminovo/epibator/rust-workspace/target/llvm-cov-target/rust-workspace.profdata` (exit status: 1)

That file rust-workspace-profraw-list is 0 bytes.

Not sure what is going on, maybe you can hint me what to check.

Closes: #265

@magnusja magnusja changed the title Use extract-to if using --archive-filewith nextest Use extract-to if using --archive-file with nextest Apr 26, 2023
@magnusja
Copy link
Contributor Author

Oh so these profraw files are created during compilation?

Then I guess I need to wrap around this command as well

cargo nextest archive --archive-file nextest-archive.tar.zst

Currently I think you are defaulting to nextest run always.

@magnusja
Copy link
Contributor Author

Update:

So unfortunately, the archive nextest creates do not include the profraw files or the llvm-cov-target folder. If I create the archive manually from target/ nextest complains that the directory structure is not as expected

@taiki-e

This comment was marked as outdated.

@taiki-e
Copy link
Owner

taiki-e commented Apr 28, 2023

Ok, the following patch should fix the failure.

diff --git a/src/main.rs b/src/main.rs
index c45191b..de0284d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -648,6 +648,11 @@ fn walk_target_dir<'a>(
     // This is not the ideal way, but the way unstable book says it is cannot support them.
     // https://doc.rust-lang.org/nightly/rustc/instrument-coverage.html#tips-for-listing-the-binaries-automatically
     let mut target_dir = cx.ws.target_dir.clone();
+    if cx.args.subcommand == Subcommand::Nextest
+        && cx.args.cargo_args.iter().any(|a| a == "--archive-file")
+    {
+        target_dir.push("target");
+    }
     // https://doc.rust-lang.org/nightly/cargo/guide/build-cache.html
     if let Some(target) = &cx.args.target {
         target_dir.push(target);

@taiki-e
Copy link
Owner

taiki-e commented Aug 22, 2023

What is the status of this? As far as I know, if you apply my patch, this should be mergeable, but is there any other problem?

@magnusja
Copy link
Contributor Author

magnusja commented Sep 6, 2023

Let me try that patch.

I think the problem was that nextest still was not really happy with the structure, but I forgot I have to check again, sorry

@taiki-e taiki-e merged commit 221c4dc into taiki-e:main Dec 28, 2023
18 checks passed
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.

Any plans to make this work with --archive-file ?
2 participants