CoatiSoftware / vs-sourcetrail

Visual Studio Extension to communicate with Sourcetrail and generate a JSON Compilation Database from a Visual Studio Solution
Apache License 2.0
117 stars 42 forks source link

freeze during generation #69

Open KingDuckZ opened 4 years ago

KingDuckZ commented 4 years ago

I'm working on a relatively large project and I want to generate a compile_commands.json for it. At some point I was able to (at least I have a compile_commands.json that starts and ends with a [ ] pair) and the generate file is about 68 MiB. It did take several attempts, but eventually I got it.

Now I'm trying to refresh that file and the plugin seems to just freeze. Sometimes I won't get any status bar advancement (I left it overnight and it didn't move, output is 2 bytes), some other times it moves up to a point but then stops there. I've been trying for several days now, leaving it running overnight and throughout the da, it's just not working. Can someone help with this please?

KingDuckZ commented 4 years ago

Hello, can I get some support on this please?

pturley0 commented 4 years ago

I have this as well.

mlangkabel commented 4 years ago

Hey, what does the plugin's log say? You can enable it by clicking Tools -> Options -> Sourcetrail and set "File Logging" to "True". With that you can choose "Sourcetrail Log" in your "Output" window.

pturley0 commented 4 years ago

@mlangkabel, a perfectly fair question.

My log never has anything in it. The plugin spins, doesn't produce anything, and never writes anything to the log.

I tried letting it run overnight, and till got nothing.

I tried applying it to a very small part of the same solution (only one project). In that case, it did produce something but, as I recall (I didn't take careful notes in this case), it was still wedged and the stuff I got wasn't usable.

Based on these observations, I think this is a problem of scale -- that is, the plugin can't handle very large solutions in a practical way.

pturley0 commented 4 years ago

Perhaps if the plug-in offered some more-detailed logging, we could send back interesting information.

mlangkabel commented 4 years ago

The log should already state, what projects are processed by the extension when generating the compilation database, or if projects are skipped. It also logs for each source file that it finds in your projects whether or not ir generated a compile command for it. I think that should be a good start. If you don't want to or cannot share any more details here, you can always checkout the repo and change/build the extension on your own. It should be quite simple to build and run in VS.

GlenHandke commented 3 years ago

This lockup appears to be caused by the presence of solution folders. Try making an alternate solution file with the same projects that does not use any solution folders.

pturley0 commented 3 years ago

Fair enough - it's good to have a clear cause.

The solution we're using at my company is large and constructed automatically. This plugin will remain unhelpful for me until it's improved to comprehend solution folders.

mlangkabel commented 3 years ago

Oh, that's interesting. Can you post the steps to create a minimal solution with those solution folders that would cause such a freeze?

KingDuckZ commented 3 years ago

If it helps I found that this works for me:

  1. start the plugin and wait for it to freeze
  2. close the progress bar window but don't quit visual - you can keep using it tho
  3. don't try to start the plugin again!
  4. keep doing ls -hl on the output compile_commands file, its size should now be growing
  5. when the compile_commands stops growing the process is likely completed successfully
  6. you can now close visual if you want
evakili commented 3 years ago

@KingDuckZ Thanks! That works for me!

P.S.: We have a dozen of projects, in some solution folders.

pturley0 commented 3 years ago

FYI https://clangpowertools.com offers a Visual Studio extension that can create a compilation database. This is the only thing I've found that is a reasonable alternative.

morl0048 commented 3 years ago

I'm on windows 10 using visual studio 2019 and have the same problem. Closing the "Creating Compilation Data Base" window did help me and seem to unfreeze the creation. When the file is fully created, the window showing that the creation is finished shows as if nothing bad happened. Thanks @KingDuckZ (: image