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

nvcc: Handle compiler detection when gcc isn't on the path #1747

Merged
merged 6 commits into from
Apr 30, 2023

Conversation

robertmaynard
Copy link
Collaborator

To properly handle compiler detction sccache invokes the compiler with -E. To generate the preprocessed output nvcc invokes the host comiler, which either requires gcc to be on the path or -ccbin argument to be provided.

This PR allows sccache to be used with nvcc when gcc isn't on the path but the host compiler to be used is included via -ccbin.

This was found when building small build images which only had a compiler with a name like gcc-aarch64.

@sylvestre
Copy link
Collaborator

you have a bunch of failure in the CI :)

To properly handle compiler detction sccache invokes the compiler
with -E. To generate the preprocessed output `nvcc` invokes the host
comiler, which either requires gcc to be on the path or `-ccbin` argument
to be provided.

This PR allows `sccache` to be used with `nvcc` when `gcc` isn't
on the path but the host compiler to be used is included via `-ccbin`.

This was found when building small build images which only had
a compiler with a name like `gcc-aarch64`.
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2023

Codecov Report

Patch coverage: 42.98% and project coverage change: +0.16 🎉

Comparison is base (3b70d6b) 29.22% compared to head (04f03fb) 29.38%.

❗ Current head 04f03fb differs from pull request most recent head 8636cd6. Consider uploading reports for the commit 8636cd6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1747      +/-   ##
==========================================
+ Coverage   29.22%   29.38%   +0.16%     
==========================================
  Files          49       49              
  Lines       17488    17593     +105     
  Branches     8457     8500      +43     
==========================================
+ Hits         5110     5169      +59     
  Misses       7252     7252              
- Partials     5126     5172      +46     
Impacted Files Coverage Δ
src/cache/azure.rs 0.00% <0.00%> (ø)
src/cache/cache.rs 38.37% <0.00%> (+0.28%) ⬆️
src/cache/gcs.rs 9.80% <0.00%> (ø)
src/cache/gha.rs 0.00% <0.00%> (ø)
src/cache/memcached.rs 0.00% <0.00%> (ø)
src/cache/redis.rs 0.00% <0.00%> (ø)
src/cache/s3.rs 55.35% <0.00%> (ø)
src/cache/webdav.rs 0.00% <0.00%> (ø)
src/compiler/compiler.rs 36.46% <10.00%> (-0.10%) ⬇️
src/compiler/clang.rs 51.90% <40.00%> (-0.24%) ⬇️
... and 2 more

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@robertmaynard
Copy link
Collaborator Author

you have a bunch of failure in the CI :)

I think I fixed all the issues and learned some more rust along the way :)

}
use self::ArgData::PassThrough as Detect_PassThrough;

counted_array!(static ARGS: [ArgInfo<ArgData>; _] = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please document this a bit? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean like move the documentation from 1101 up to here?

@sylvestre
Copy link
Collaborator

sylvestre commented Apr 28, 2023 via email

Copy link
Collaborator Author

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comments on what/why of the code changes

@robertmaynard
Copy link
Collaborator Author

Or explain what this code is doing :)

I have updated the general code blocks with explanations on what we are doing, and why.

@sylvestre
Copy link
Collaborator

please run rustfmt :)

@sylvestre sylvestre merged commit 9e64618 into mozilla:main Apr 30, 2023
@robertmaynard robertmaynard deleted the bug/correct_ccbin_support branch May 1, 2023 13:35
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.

3 participants