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

test/clang-tidy/clang-cl-driver.cpp fails when run from paths starting with '/U' (common on OS X) #29676

Closed
ahmedbougacha opened this issue Sep 8, 2016 · 7 comments
Labels
bugzilla Issues migrated from bugzilla clang-tidy wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@ahmedbougacha
Copy link
Member

Bugzilla Link 30328
Resolution WONTFIX
Resolved on Jun 20, 2019 11:28
Version unspecified
OS All
CC @ahmedbougacha,@rnk

Extended Description

See e.g., http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/21470/consoleFull#19036563798254eaf0-7326-4999-85b0-388101f2d404

This test was (re-)introduced in:
[clang-tools-extra] r280839 - Resubmit "Add a test for clang-tidy using the clang-cl driver."

Looks like the path is interpreted as a '/U' option in clang-cl mode:

clang-check "/Volumes/.../clang-cl-driver.cpp" -- --driver-mode=cl -###
clang-check "/Users/.../clang-cl-driver.cpp" -- --driver-mode=cl -###

The latter emits an error:

warning: argument unused during compilation: '-U sers/.../clang-cl-driver.cpp'
error: unable to handle compilation, expected exactly one compiler job in ''
Error while processing /Users/.../clang-cl-driver.cpp.

@ahmedbougacha
Copy link
Member Author

Reverted in r280975. I'll take a look later today; ideas welcome.

@ahmedbougacha
Copy link
Member Author

I haven't found a good way to avoid this problem. It exists even for the clang driver: there's no way to compile a file called, say, '-Df.c'. '--' fools the driver, but I don't think there's a way to fool -cc1.

So, Zachary, unless you have another idea, I'd suggest only enabling the test on Windows, where it's known to be safe?

@llvmbot
Copy link
Member

llvmbot commented Sep 15, 2016

Reid, do you have any ideas here?

TL;DR - Running clang in cl mode on platforms that use a / separator in paths interprets some paths as command line options.

@rnk
Copy link
Collaborator

rnk commented Sep 15, 2016

Isn't this known? We have comments in all our driver tests about it...

@rnk
Copy link
Collaborator

rnk commented Sep 15, 2016

// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.

@rnk
Copy link
Collaborator

rnk commented Dec 9, 2016

Looks like this patch never relanded.

@rnk
Copy link
Collaborator

rnk commented Jun 20, 2019

This never relanded, but I don't think there's anything to do here.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

4 participants