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

cras: Declare "language: rust" #11125

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Conversation

afq984
Copy link
Contributor

@afq984 afq984 commented Oct 15, 2023

The coverage builder complains that rust stdlib sources is missing.

Step #5: �[0;31merror: /workspace/out/libfuzzer-coverage-x86_64/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs: No such file or directory
Step #5: �[0m�[0;31mwarning: The file '/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs' isn't covered.
Step #5: �[0m[2023-10-04 06:50:42,764 DEBUG] Finished generating per-file code coverage summary.
Step #5: [2023-10-04 06:50:42,764 DEBUG] Generating file view html index file as: "/workspace/out/libfuzzer-coverage-x86_64/report/linux/file_view_index.html".
Step #5: Traceback (most recent call last):
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 829, in <module>
Step #5:     sys.exit(Main())
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 823, in Main
Step #5:     return _CmdPostProcess(args)
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 780, in _CmdPostProcess
Step #5:     processor.PrepareHtmlReport()
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 577, in PrepareHtmlReport
Step #5:     self.GenerateFileViewHtmlIndexFile(per_file_coverage_summary,
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 450, in GenerateFileViewHtmlIndexFile
Step #5:     self.GetCoverageHtmlReportPathForFile(file_path),
Step #5:   File "/opt/code_coverage/coverage_utils.py", line 422, in GetCoverageHtmlReportPathForFile
Step #5:     assert os.path.isfile(
Step #5: AssertionError: "/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs" is not a file.

I think the sources would be copied in base-builder if we declare cras as a rust project:

if [ "$FUZZING_LANGUAGE" = "rust" ]; then
# Copy rust std lib to its path with a hash.
export rustch=`rustc --version --verbose | grep commit-hash | cut -d' ' -f2`
mkdir -p /rustc/$rustch/
cp -r /rust/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/ /rustc/$rustch/
fi

Fixes: https://crbug.com/oss-fuzz/62974

The coverage builder complains that rust stdlib sources is missing.

```
Step google#5: �[0;31merror: /workspace/out/libfuzzer-coverage-x86_64/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs: No such file or directory
Step google#5: �[0m�[0;31mwarning: The file '/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs' isn't covered.
Step google#5: �[0m[2023-10-04 06:50:42,764 DEBUG] Finished generating per-file code coverage summary.
Step google#5: [2023-10-04 06:50:42,764 DEBUG] Generating file view html index file as: "/workspace/out/libfuzzer-coverage-x86_64/report/linux/file_view_index.html".
Step google#5: Traceback (most recent call last):
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 829, in <module>
Step google#5:     sys.exit(Main())
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 823, in Main
Step google#5:     return _CmdPostProcess(args)
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 780, in _CmdPostProcess
Step google#5:     processor.PrepareHtmlReport()
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 577, in PrepareHtmlReport
Step google#5:     self.GenerateFileViewHtmlIndexFile(per_file_coverage_summary,
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 450, in GenerateFileViewHtmlIndexFile
Step google#5:     self.GetCoverageHtmlReportPathForFile(file_path),
Step google#5:   File "/opt/code_coverage/coverage_utils.py", line 422, in GetCoverageHtmlReportPathForFile
Step google#5:     assert os.path.isfile(
Step google#5: AssertionError: "/rustc/187b8131d4f760f856b214fce34534903276f2ef/library/core/src/panic.rs" is not a file.
```

I think the sources would be copied in base-builder if we declare cras as a rust project:

https://github.com/google/oss-fuzz/blob/d514fac92686c656633aa8549fd6f239c964b2bc/infra/base-images/base-builder/compile#L226-L231

Fixes: https://crbug.com/oss-fuzz/62974
@github-actions
Copy link

afq984 is either the primary contact or is in the CCs list of projects/cras.
afq984 has previously contributed to projects/cras. The previous PR was #10786

@DavidKorczynski DavidKorczynski merged commit 63c5a23 into google:master Oct 15, 2023
16 checks passed
copybara-service bot pushed a commit to chromeos/adhd that referenced this pull request Oct 16, 2023
This reverts commit ceafa21.

Reason for revert: google/oss-fuzz#11125

Original change's description:
> audio-qv/cros-cop: Disable oss-fuzz check-step
>
> It's failing on TOT:
> https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/4903456/comments/51651b22_69436f20
>
> BUG=b:303194232
> TEST=devtools/copgen.sh
>
> Change-Id: I14d0c48f3d0e0bb1014f13c3ff30dd4b163affc0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/4907683
> Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
> Commit-Queue: Li-Yu Yu <aaronyu@google.com>

BUG=b:303194232

Change-Id: Id3e4c7b6038b40e7308496dbc8c37379585ad949
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/4937041
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Commit-Queue: Li-Yu Yu <aaronyu@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants