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

Bug: ProcessCcArgs mis-processes arguments containing -fdebug-prefix-map #3065

Open
jmcclellan-figma opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jmcclellan-figma
Copy link

Description

In ProcessCcArgs, when a -fdebug-prefix-map argument is detected, it is skipped, and the next argument is incorrectly also skipped. -fdebug-prefix-map does not take an additional argument, correct usage is something like -fdebug-prefix-map=a=b to map a to b. clang will not accept something like -fdebug-prefix-map a=b, so we should never skip the argument after -fdebug-prefix-map.

This will cause the arguments to get corrupted, in my case, an -iquote was getting skipped, causing the directory I included to be sent to the compiler as a compiler input file. This meant xcode got invalid command lines, making the "Indexing" step not succeed.

Code link.

Reproduction steps

In a cc_library, add

    copts = [
        "-fdebug-prefix-map=a=b",
        "-iquote",
        ".",
    ],

Then, bazel run //:xcodeproj, and open a source file in the modified library. The file will fail in the "Indexing" step since . will be passed as a compiler input (i.e., the iquote argument will not be provided to xcode)

Expected behavior

We expect -fdebug-prefix-m=a=b to be removed from the argument list, but no further arguments should be removed.

rules_xcodeproj version

8ba39d7

Xcode version

15.4

Bazel version

7.2.1

rules_apple version

No response

rules_swift version

No response

Additional information

No response

@jmcclellan-figma jmcclellan-figma added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant