Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

no output produced for seemingly well-formed compile_commands.json #4

Closed
shrouxm opened this issue Aug 18, 2020 · 5 comments
Closed
Assignees
Labels
bug Something isn't working team/code-intelligence

Comments

@shrouxm
Copy link
Contributor

shrouxm commented Aug 18, 2020

technical details are private, but the gist is that the tool builds successfully, and a compile_commands is generated by the user's distributed build system. when the tool is run, no frontend compilation occurs and the output dump.lsif contains only a meta and project vertex. nothing looks suspicious in the compile_commands.json, but some details to note:

  • the same file is compiled multiple times with different options
  • the file may not have been generated on the same machine the tool is being run on
@aidaeology
Copy link

@gbrik What is the status of this issue, was this resolved with the 3.20 milestone or does it still need work? If it's resolved and longer a problem then please mark as closed and link the relevant PR. Otherwise please provide a status update here on what the remaining work is to get it resolved.

@shrouxm
Copy link
Contributor Author

shrouxm commented Sep 28, 2020

I need to reach out to the user to set up a call so we can work together on this, as I haven't been able to reproduce the issue async.

@suo
Copy link

suo commented Oct 16, 2020

I have a similar issue, maybe mine is a bit easier to repro since the code is public (PyTorch). This is my dump.lsif: dump.lsif.zip

To repro (linux):

  1. Follow the instructions to install dependencies and get the source: https://github.com/pytorch/pytorch#install-dependencies
  2. Use the following build command to build a minimal thing:
BUILD_TESTS=0 BUILD_CAFFE2_OPS=0 USE_OPENMP=0 USE_MKL=0 USE_MKLDNN=0 USE_NNPACK=0 USE_XNNPACK=0 USE_QNNPACK=0 USE_PYTORCH_QNNPACK=0 USE_FBGEMM=0 USE_DISTRIBUTED=0 USE_CUDA=0 python setup.py develop
  1. The previous command will automatically create compile_commands.json.

The output of lsif-clang seems reasonable, it looks like it's properly processing files. But the lsif.dump is effectively empty. Another thing of note is that I use clangd as an LSP and that works. Let me know if this is helpful.

@shrouxm
Copy link
Contributor Author

shrouxm commented Oct 19, 2020

Hi @suo, thanks for reporting! Yours might be a slightly different issue than the one reported above, since in the original case it looked like lsif-clang wasn't doing any processing at all.

Having said that, I was able to produce an index for pytorch using the build command you posted and then running lsif-clang compile_commands.json in the project's root. Could you post exactly how you're invoking lsif-clang? The most likely culprit I can think of is if the project-root argument isn't set correctly (lsif-clang drops all data outside of this root, if it's unset it uses the working directory).

I also just pushed a quick commit so that if you run lsif-clang --debug compile_commands.json it should show you what lsif-clang is trying to use as the project root.

@macraig macraig removed this from the 3.22 milestone Nov 20, 2020
@shrouxm shrouxm added this to the Code Intelligence Iteration 6 milestone Feb 14, 2021
@shrouxm
Copy link
Contributor Author

shrouxm commented Feb 14, 2021

It turned out this issue was due to a compile_flags.txt in a parent directory, will be closed by updating documentation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working team/code-intelligence
Projects
None yet
Development

No branches or pull requests

4 participants