dependency-based make

We've been happily using the dependency-based make feature of intellij IDEA, but lately it seems to have stopped working.  Whenever we run an existing run configuration, nothing is compiled.  If we specify that 'make' should be run before launch, then the entire project is compiled.  We seem to have lost the dependency-based compile we had before.  Is there a setting in intellij IDEA we accidentally tripped over?

14 comments
Comment actions Permalink

Hi Jayen,

What do you mean under dependency-based make? Incremental compilation?

Denis

0
Comment actions Permalink

I mean that if a run configuration depends on some classes, then only those classes will be compiled (if needed).  Right now, it's compiling the whole project or none of the project.

0
Comment actions Permalink
  1. What is your OS?
  2. What java do you use?
  3. What is your IJ version?
  4. Provide your idea.log (main menu | help | show log);
  5. Try to execute 'main menu | file | invalidate caches' and check if that helps;

Denis

0
Comment actions Permalink

Seen on three machines:
1. Linux, sun java6 for IJ, openjdk6 for development, IJ 11
2. OS X, ??? for IJ, openjdk6 for development, IJ 12
3. Windows, ??? for IJ, openjdk6 for development, IJ 12

log from the first attached.  towards the end i removed some run configurations, then right-clicked on a junit class and chose 'run $classname'.  my latest changes to the class were not compiled.  i removed the build configuration, changed the default to run make before launch, then re-right-clicked on the junit class and chose 'run $classname'.  it started compiling a module not depended on by the current module (which contains an error).



Attachment(s):
idea.log.zip
0
Comment actions Permalink

I see a log record about virtual file system corruption. That might be a problem's reason.

Have you tried to execute 'main menu | file | invalidate caches'?

Denis

0
Comment actions Permalink

Yes, I tried that and chose "invalidate and restart".  that's the shutdown you see at 2013-07-13 09:01:19,076 in the log.

0
Comment actions Permalink

Asked our compiler guy to have a look into

Denis

0
Comment actions Permalink

Hi Jayen,
I assume the log file attached is from IDEA 12. If this is true, then from the log I see that you are usung older build implementation, which is deprecated. Please enable "external build" in compiler settings and check if the problem still exists.
Eugene.

0
Comment actions Permalink

The log file is from IDEA 11 and I am using the Javac compiler.

0
Comment actions Permalink

Ok, IDEA 11 for every module starts javac compiler from the JDK that is assigned to the module.
I can only guess what is happening because I do not have any project example at hand.

1. In the attached log I see no compilations which complete successfully. In this case all files that were compiled with errors or those that depend on such files will be marked as requiring recompilation. If there were no successfull compilations, there might be a situation that lots of files are marked as "dirty" and IDEA tries to recompile them every time you attempt to run the configuration. Please try to fix all errors, compile with ctrl-F9. Then change only one file and compile again. Only this file and those that depend on it and are affected by the change should be compiled.

2. Please try to specify JDK 6 from Oracle as Project JDK, not Open JDK 6. Does it make any difference?

0
Comment actions Permalink
  1. This works fine as you say.
  2. It does not make any difference.


My issue is not with make (which compiles any changed files in the whole project).  My issue is with a run configuration.  Perhaps I have chosen a poor subject for this thread.

I can set my run configuration to "make" the whole project or compile nothing, but I can not set it to compile only files which the class depends on.

0
Comment actions Permalink

> I can set my run configuration to "make" the whole project or compile nothing, but I can not set it to compile only files which the class depends on.

The granularity here is on per module basis. This means that compilation scope will be the module specified in the run configuration and all modules that it depends on, recursively. And "make" action will try to compile only the files that were changed since last compilation within the specified scope of compilation.

0
Comment actions Permalink

Ok.  It seems to be working on the computer I'm on now, but it didn't work on another computer yesterday.  So for the benefit of other who stumble across this thread, I'm going to highlight what you said earlier:

all files that were compiled with errors or those that depend on such  files will be marked as requiring recompilation. If there were no  successfull compilations, there might be a situation that lots of files  are marked as "dirty" and IDEA tries to recompile them every time you  attempt to run the configuration.

This applies to every run configuration, even those that are independent of the modules with errors.

Eugene, I'll attach a log from my other computer when I get back into the office on Tuesday AEST, if I'm still having this problem on the other computer.

0

Please sign in to leave a comment.