Makefile project keeps importing/reloading

Answered

Hello,

I have a fairly big Makefile project I'm working on that reloads and imports literally all the time unless I manually stop the process just as it starts. Sometimes if I clean the project before reloading ("Clean and Reload Makefile Project") it works and stops looping. It always gets to the "Configuring project" step, says something about restoring from cache and reloads before I even have time to read the results.

What can I do to stop this? If I don't let CLion import the project I don't get any code insight.

Thank you.

3 comments
Comment actions Permalink
Official comment

Hello,

Our apologies for the inconvenience.

If CLion keeps reloading the project and closing/reopening it doesn't help, you can simply comment out your pre-configure commands (using the # character on UNIX/Cygwin/WSL and the rem command on MinGW).

Alternatively, you can make sure the Makefile is only generated when necessary:

#!/bin/bash

if [ ! -f Makefile ]
then
# Your
# pre-configuration
# commands
# here
fi

 

Comment actions Permalink

Hello!

This is most probably https://youtrack.jetbrains.com/issue/CPP-25621. Feel free to comment or upvote the issue in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

This sometimes happens for Makefile projects with the pre-configuration step enabled:

  1. the commands in this step usually generate a new Makefile;
  2. CLion observes that a file has been externally modified;
  3. since Makefile is a project file, the complete project reload cycle is triggered;
  4. the pre-configuration step is re-run;
  5. ...

So far, there is no workaround except for hitting the red Stop button in the Build tool window while the project is being reloaded (i. e. while the button is enabled) or, alternatively, re-loading the project.

0
Comment actions Permalink

Hello!

Thank you for the answer. It does seem like that issue fits what I'm observing. Is there no way to make CLion simply ignore the newly generated Makefile? Or to generate it outside of the project folder? Should I just remove the pre-configuration steps?

Stopping the reload at the wrong time also causes it to loop back into the reload. It also usually disables code insights for me depending on when the project is stopped.

0

Please sign in to leave a comment.