Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile cancel request not honored #1414

Closed
efc-mw opened this issue Oct 31, 2022 · 1 comment
Closed

Compile cancel request not honored #1414

efc-mw opened this issue Oct 31, 2022 · 1 comment
Assignees
Milestone

Comments

@efc-mw
Copy link

efc-mw commented Oct 31, 2022

Canceling a running build seems not possible. For example when closing Eclipse during compile run, pressing the red button has no effect, the groovy compiler still compiles new classes... But it seems not correct, there are lot of exceptions like:

!ENTRY org.eclipse.jdt.groovy.core 4 0 2022-10-31 14:19:13.993
!MESSAGE Groovy compiler error
!STACK 0
BUG! exception in phase 'semantic analysis' in source unit 'E:\projects\wug\server_env_actual\efc_server\src\groovy\de\effectivecompany\app\app\serviceimpl\SvEFCReportImpl.groovy' commencingResolution failed: no declaration found for class de.effectivecompany.app.app.serviceimpl.SvEFCReportImpl
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:935)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:707)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:681)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:232)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.resolve(GroovyCompilationUnitDeclaration.java:615)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:918)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug: commencingResolution failed: no declaration found for class de.effectivecompany.app.app.serviceimpl.SvEFCReportImpl
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.commencingResolution(JDTResolver.java:227)
	at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1376)
	at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:266)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.startResolving(JDTResolver.java:197)
	at org.codehaus.groovy.control.CompilationUnit.lambda$4(CompilationUnit.java:215)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:926)
	... 7 more
@eric-milles eric-milles changed the title Compile cancle request not honored Compile cancel request not honored Oct 31, 2022
@eric-milles
Copy link
Member

eric-milles commented Oct 31, 2022

For each compilation unit (source file) the ProcessTaskManager reports progress, which includes checking for cancellation.

				this.compiler.reportProgress(Messages.bind(Messages.compilation_processing, new String(this.unitToProcess.getFileName())));
				if (this.compiler.options.verbose)
					this.compiler.out.println(
						Messages.bind(Messages.compilation_process,
						new String[] {
							String.valueOf(index + 1),
							String.valueOf(this.compiler.totalUnits),
							new String(this.unitToProcess.getFileName())
						}));
				this.compiler.process(this.unitToProcess, index); // line 145

The progress monitor is null but that is a JDT issue that needs to be investigated. You can revert to the old inline compilation by adding -Djdt.compiler.useSingleThread=true to your eclipse.ini

Update: Also the build notifier checks for cancellation after parse, classgen and completion of each unit.
https://github.com/groovy/groovy-eclipse/blob/master/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyParser.java#L277
https://github.com/groovy/groovy-eclipse/blob/master/jdt-patch/e426/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BuildNotifier.java#L135

@eric-milles eric-milles self-assigned this Oct 31, 2022
@eric-milles eric-milles added this to the v4.8.0 milestone Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants