bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
186 stars 93 forks source link

Resolve the clang-cl 11.0.0 version detection #88

Closed wrowe closed 3 years ago

wrowe commented 4 years ago

Bazel presumed a trailing space in clang-cl -v output that is no longer present in the 11.0.0 release, resulting in an injected newline

This PR resolves such corrupted file paths for LLVM 11.0.0 and later.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

sunjayBhatia commented 4 years ago

@googlebot I signed it!

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

wrowe commented 4 years ago

@googlebot I signed it!

wrowe commented 3 years ago

For reference, here's the delta between -v output on the 10.0.0 and 11.0.0 releases, in which we observe the <space> character at 000014 in 10.0.0 disappears in 11.0.0, causing the parsing error corrected by this PR


$ /c/Program\ Files/llvm-10.0.0/bin/clang-cl -v 2>&1 | hexdump -c
0000000   c   l   a   n   g       v   e   r   s   i   o   n       1   0
0000010   .   0   .   0      \r  \n   T   a   r   g   e   t   :       x
0000020   8   6   _   6   4   -   p   c   -   w   i   n   d   o   w   s
0000030   -   m   s   v   c  \r  \n   T   h   r   e   a   d       m   o
0000040   d   e   l   :       p   o   s   i   x  \r  \n   I   n   s   t
0000050   a   l   l   e   d   D   i   r   :       C   :   \   P   r   o
0000060   g   r   a   m       F   i   l   e   s   \   l   l   v   m   -
0000070   1   0   .   0   .   0   \   b   i   n  \r  \n
000007c

$ /c/Program\ Files/llvm/bin/clang-cl -v 2>&1 | hexdump -c
0000000   c   l   a   n   g       v   e   r   s   i   o   n       1   1
0000010   .   0   .   0  \r  \n   T   a   r   g   e   t   :       x   8
0000020   6   _   6   4   -   p   c   -   w   i   n   d   o   w   s   -
0000030   m   s   v   c  \r  \n   T   h   r   e   a   d       m   o   d
0000040   e   l   :       p   o   s   i   x  \r  \n   I   n   s   t   a
0000050   l   l   e   d   D   i   r   :       C   :   \   P   r   o   g
0000060   r   a   m       F   i   l   e   s   \   l   l   v   m   \   b
0000070   i   n  \r  \n
0000074```