vs-sourcetrail icon indicating copy to clipboard operation
vs-sourcetrail copied to clipboard

freeze during generation

Open KingDuckZ opened this issue 4 years ago • 13 comments

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 avatar Jun 11 '20 08:06 KingDuckZ

Hello, can I get some support on this please?

KingDuckZ avatar Aug 10 '20 08:08 KingDuckZ

I have this as well.

pturley0 avatar Aug 21 '20 22:08 pturley0

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.

mlangkabel avatar Aug 25 '20 12:08 mlangkabel

@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 avatar Aug 25 '20 14:08 pturley0

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

pturley0 avatar Aug 30 '20 20:08 pturley0

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.

mlangkabel avatar Sep 01 '20 13:09 mlangkabel

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.

GlenHandke avatar Oct 20 '20 12:10 GlenHandke

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.

pturley0 avatar Oct 20 '20 14:10 pturley0

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

mlangkabel avatar Oct 20 '20 17:10 mlangkabel

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

KingDuckZ avatar Nov 02 '20 21:11 KingDuckZ

@KingDuckZ Thanks! That works for me!

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

evakili avatar Feb 12 '21 07:02 evakili

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.

pturley0 avatar Feb 12 '21 17:02 pturley0

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

morl0048 avatar Mar 15 '21 22:03 morl0048