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

proc-macro crate in workspace unexpectently exits #1642

Open
Javagedes opened this issue Oct 28, 2024 · 7 comments
Open

proc-macro crate in workspace unexpectently exits #1642

Javagedes opened this issue Oct 28, 2024 · 7 comments
Assignees

Comments

@Javagedes
Copy link

Describe the bug
Workspaces with a proc-macro crate fail to execute tests (The failure happens when execution of the test exe begins, but before any test starts) with the following error:

2024-10-28T15:58:05.678629Z  INFO cargo_tarpaulin::process_handling: running D:\a\rust-ci-testing\rust-ci-testing\target\debug\deps\rust_proc_macro-6ef64dc17f0828ce.exe
2024-10-28T15:58:05.678931Z  INFO cargo_tarpaulin::process_handling: Setting LLVM_PROFILE_FILE
2024-10-28T15:58:05.686895Z ERROR cargo_tarpaulin: Test failed during run
Error: "Test failed during run"
Error: Process completed with exit code 1.

I can only reproduce on a github action windows-latest runner (but 100% of the time). It does not happen on ubuntu-latest image (even with the --engine llvm flag) and it does not happen on windows locally. it fails with or without any tests actually in the crate. It fails with engine llvm and --no-dead-code

I tried adding tests to see if that helped any, but it continued to fail. I also tried adding tests as described in #326 but it continues to fail.

I am currently on:
cargo-tarpaulin 0.31.2
1.80.0

To Reproduce
I have set up a repo with a CI job that hits the issue: Javagedes/rust-ci-testing with an example run here: action/Run Tests

Expected behavior
I would expect the test harness to not unexpectedly fail without running any tests.

@xd009642
Copy link
Owner

Hmm that's super odd, could you add --dump-traces to the tarpaulin flags. Hopefully it's not so long that GHA gives up on printing the logs.

I don't really use windows so this might take me some time to replicate (I need to find a windows machine and setup a dev env or find a friend who can help to get a quicker turnaround)

@nightkr
Copy link

nightkr commented Nov 29, 2024

I'm seeing something similar on Linux after upgrading to Rust 1.83.0, both in CI (GitHub Actions) and locally (Arch). Rust 1.82.0 seems to work fine.

@xd009642
Copy link
Owner

oh weird/interesting that's very helpful thanks 👍

@nightkr
Copy link

nightkr commented Nov 29, 2024

Output from --dump-traces: tarpaulin_20241129173337.json

@nightkr
Copy link

nightkr commented Nov 29, 2024

Of course, feel free to split this into a separate issue if it seems unrelated.

@jonasbb
Copy link

jonasbb commented Dec 2, 2024

Locally (Rust 1.83, Fedora Linux, amd64) I see these messages right before the test failure. serde_with_macros is a proc-macro crate.

2024-12-02T21:57:21.820615Z  INFO cargo_tarpaulin::process_handling::linux: Launching test
2024-12-02T21:57:21.820661Z  INFO cargo_tarpaulin::process_handling: running /home/jbushart/projects/serde_with/target/debug/deps/serde_with_macros-ae28cd5b53cb79aa
/home/jbushart/projects/serde_with/target/debug/deps/serde_with_macros-ae28cd5b53cb79aa: error while loading shared libraries: libstd-02dc84f49135b6b8.so: cannot open shared object file: No such file or directory
2024-12-02T21:57:23.109267Z ERROR cargo_tarpaulin: Test failed during run
Error: "Test failed during run"

I do not see the link message on GitHub Actions (Source).

test result: ok. 79 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.25s

Error: "Test failed during run"
Error: Process completed with exit code 1.

Since this is a linking issue, this change sounds relevant: "The sysroot no longer contains the std dynamic library in its top-level lib/ dir." rust-lang/rust#131188

The issue does not appear with Rust 1.82. The version of tarpaulin (0.31.2 or 0.31.3) does not make a difference.

@xd009642
Copy link
Owner

xd009642 commented Dec 4, 2024

Oh one thing that another person with the issue has confirmed is that --exclude <PROC_MACRO_CRATE> also works to solve the issue as a stop gap

jonasbb added a commit to jonasbb/serde_with that referenced this issue Dec 6, 2024
There is a problem of testing proc-macro crates with Rust 1.83:
xd009642/tarpaulin#1642 (comment)
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

No branches or pull requests

4 participants