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

Prepend target if no explicit target directory is set #350

Closed
wants to merge 1 commit into from

Conversation

weiznich
Copy link
Contributor

This commit prepend target to the profile target directory path, if no explicit target is set. This is necessary to allow using a custom --profile flag via cargo llvm-cov report. Without this change I get the following error message:

$ cargo llvm-cov report --profile test-jenkins
warning: not found object files (searched directories: /builds/test-project/target/llvm-cov-target/test-jenkins); this may occur if show-env subcommand is used incorrectly (see docs or other warnings), or unsupported commands are used
No filenames specified!

This can be worked around at the calling site by using target/test-jenkins as profile name. That means calling cargo llvm-cov --profile target/test-jenkins seems to work fine.

This commit prepend `target` to the profile target directory path, if no
explicit target is set. This is necessary to allow using a custom
`--profile` flag via `cargo llvm-cov report`. Without this change I get
the following error message:

```
$ cargo llvm-cov report --profile test-jenkins
warning: not found object files (searched directories: /builds/test-project/target/llvm-cov-target/test-jenkins); this may occur if show-env subcommand is used incorrectly (see docs or other warnings), or unsupported commands are used
No filenames specified!
```

This can be worked around at the calling site by using
`target/test-jenkins` as profile name. That means calling `cargo
llvm-cov --profile target/test-jenkins` seems to work fine.
@weiznich
Copy link
Contributor Author

As the CI tests indicate that breaks something else. I would appreciate some pointers how to approach that differently.

@taiki-e
Copy link
Owner

taiki-e commented Feb 26, 2024

cx.args.target is about the target triple (e.g., x86_64-apple-darwin, aarch64-unknown-linux-gnu) to be built, and IIUC what you need is support in the cargo llvm-cov report for the cargo-llvm-cov nextest --archive-file-specific target directory structure. (The code before the #349 is probably easier to understand.)

The correct approach here is probably to add a new CLI flag for cargo llvm-cov report to enter this branch.

if matches!(cx.args.subcommand, Subcommand::Nextest { archive_file: true }) {

@taiki-e
Copy link
Owner

taiki-e commented Mar 10, 2024

The correct approach here is probably to add a new CLI flag for cargo llvm-cov report to enter this branch.

Opened #355 with this approach.

@taiki-e taiki-e closed this in #355 Mar 10, 2024
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