-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
llvm-cov report - no filenames specified (failed only on windows and works on linux) #300
Comments
Thanks for the report. The report subcommand does not work by itself. Could you provide information on all the commands you have run? Also, is it possible to provide the information needed to reproduce this, such as code, workflows, compiler version, etc.? |
Hi! Sorry for not giving enough detail before. Here's the github actions workflow file (with some irrelevant jobs omitted): on:
push:
paths:
- .github/workflows/python-package.yml
- python/**
pull_request_target:
paths:
- .github/workflows/python-package.yml
- python/**
jobs:
python-package:
if:
(github.actor != 'dependabot[bot]' && github.event_name == 'push') ||
(github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target')
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "pypy-3.9", "pypy-3.10"]
django: ["3.2.0", "4.1.0", "4.2.0"]
fail-fast: false
runs-on: buildjet-2vcpu-ubuntu-2204
defaults:
run:
working-directory: ./python
steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
with:
workspaces: python/rust
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: python/dev-requirements.txt
- run: python -m venv .venv
- run: .venv/bin/pip install -r dev-requirements.txt
- run: .venv/bin/pip install django~=${{ matrix.django }}
- run: .venv/bin/pip install maturin
- run: .venv/bin/maturin develop --profile dev --extras=test_generation
env:
RUSTFLAGS: -C instrument-coverage -C llvm-args=--instrprof-atomic-counter-update-all --cfg=coverage --cfg=trybuild_no_target
CARGO_INCREMENTAL: 0
CARGO_LLVM_COV: 1
- run: .venv/bin/pip list
- run: .venv/bin/coverage run -m pytest --ignore=tests/simplepoll
env:
PYTHONFAULTHANDLER: 1
RUST_BACKTRACE: 1
LLVM_PROFILE_FILE: ${{ github.workspace }}/python/rust/target/rust-%p-%8m.profraw
CARGO_LLVM_COV_TARGET_DIR: ${{ github.workspace }}/python/rust/target
- run: .venv/bin/coverage combine
- run: .venv/bin/coverage xml
- run: pwd
- run: head -n 100 coverage.xml
- run: cargo llvm-cov report --manifest-path=rust/Cargo.toml --codecov --output-path codecov.json
env:
LLVM_PROFILE_FILE: ${{ github.workspace }}/python/rust/target/rust-%p-%8m.profraw
CARGO_LLVM_COV_TARGET_DIR: ${{ github.workspace }}/python/rust/target
if: ${{ !contains( matrix.python, 'pypy') }}
- run: |
. .venv/bin/activate
cargo llvm-cov --manifest-path=rust/Cargo.toml --all-features --workspace --codecov --output-path codecov-unit.json
env:
LLVM_PROFILE_FILE: ${{ github.workspace }}/python/rust/target/rust-%p-%8m.profraw
CARGO_LLVM_COV_TARGET_DIR: ${{ github.workspace }}/python/rust/target
if: ${{ !contains( matrix.python, 'pypy') }}
- name: codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: linux,${{ matrix.python }},${{ matrix.django }}
verbose: true
files: codecov.yaml,python/coverage.xml,python/codecov.json,python/codecov-unit.json
windows:
if:
(github.actor != 'dependabot[bot]' && github.event_name == 'push') ||
(github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target')
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "pypy-3.9", "pypy-3.10"]
fail-fast: false
runs-on: windows-latest
defaults:
run:
working-directory: ./python
steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: python/rust
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: python/dev-requirements.txt
- run: python -m venv .venv
- run: .venv/Scripts/pip install -r dev-requirements.txt
- run: .venv/Scripts/pip install django -U
- run: .venv/Scripts/pip install maturin
- run: .venv/Scripts/maturin develop --profile dev --extras=test_generation
- run: .venv/Scripts/coverage run -m pytest --ignore=tests/simplepoll
env:
PYTHONFAULTHANDLER: 1
RUST_BACKTRACE: 1
- run: .venv/Scripts/coverage combine
- run: .venv/Scripts/coverage xml
- run: pwd
- run: head -n 100 coverage.xml
- run: mv coverage.xml ..
- name: codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: windows,${{ matrix.python }}
verbose: true The python-package version collects and reports coverage information, but the windows version leads to the error above. The code being tested is not straightforward to share, but I will try to create a smaller replication. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Thanks. You seem to be manually setting some of the environment variables that |
This comment was marked as off-topic.
This comment was marked as off-topic.
@taiki-e That seems to work for linux, but not for windows - I get a parser error:
|
@LilyFoote Could you try with |
I got that running, but we still have the original error: |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I hid comments unrelated to this issue as off-topic.
And one of the reasons this issue has received unrelated additional reports is that the error itself is unclear. This is related to the fact that the error is handled on the llvm-tools side, and reporting the error with some hint on the cargo-llvm-cov side before passing arguments to llvm-tools should improve the situation (#306). As for the issue @LilyFoote has encountered (the original topic of this issue -- I think that is cargo-llvm-cov or llvm-tools bug), I will fork your reproduction repo later and look into it. I'm guessing it is probably a windows path issue, but I'm still not sure what it really is. |
Btw, this has been supported in v0.6.0. |
I've been trying to add coverage for the Rust part of a combined Python and Rust project. I've got it working for our linux CI builds, but trying the same thing for Windows is leading to this error:
I have confirmed that the
.profraw
files are generated and are in the directory I expect them in:I'm at a loss how to further debug this.
The text was updated successfully, but these errors were encountered: