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

Irony breaks when (accidentally) including a .a file into compile args #522

Open
cody-c opened this issue Feb 12, 2019 · 2 comments
Open

Comments

@cody-c
Copy link

cody-c commented Feb 12, 2019

This is a very edge-case issue that I ran into. I'm documenting it here not because it needs to be fixed but rather in case it can help someone else in the future.

Issue:
In my makefile I linked directly against a specific version of a static library using it's full path (i.e. /usr/lib/libsome_library.a). When running bear on my makefile it treated that direct file link as an include and generated a compile_commands.json that looked like this:

[
    {
        "arguments": [
            "g++",
            "-c",
            "-std=c++11",
            "-g",
            "-I/usr/include",
            "/usr/lib/libsome_library.a"
            "-o",
            "myProgram",
            "myProgram.cpp"
        ],
        "directory": "/home/cc/myProgram",
        "file": "myProgram.cpp"
    }
]

Which in turn got parsed into an include argument and broke Irony with the following error:

Irony I/O task: error in callback: (irony-server-error complete-error "failed to perform code completion" "path/to/.cpp" line# col#)

The fix is simple, remove the .a file from the list of compile arguments.

Hope this can help someone struggling with the same issue.

@smcallis
Copy link

I had the same problem with .o files, so thanks for this tip.

@bvandonselaar
Copy link

I had the same problem with .o files, so thanks for this tip.

Yhea that was the parsing error for me, thanks. I used Bear to generate compile_commands.json btw.

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

No branches or pull requests

3 participants