go .exe not being deleted from output folder at end of run or debug session started from run configuration

已回答

IntelliJ IDEA 2020.3 (Ultimate Edition)
Build #IU-203.5981.155, built on November 30, 2020
Runtime version: 11.0.9+11-b1145.21 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: debugger.watches.in.variables=false, go.run.processes.with.pty=false
Non-Bundled Plugins: name.kropp.intellij.makefile, org.tinygroup.studio.service, Pythonid, org.jetbrains.plugins.go

If I don't specify an output location in my run configuration for the executable resulting from a go build, the .exe goes to my AppData\Local\Temp dir. The .exe is not cleaned up at the end of my run or debug session (according to this post it is supposed to be: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000273659-GO-BUILD-where-is-the-executable-). This results in the following failure upon the next attempt to start the run config:

go build command-line-arguments: build output path-and-name-to-exe already exists and is not an object file

I tried deleting the file manually and even still got the same error. The only thing that worked was restarting the IDE.

A workaround I found (so that I don't have to restart the IDE in between each and every run / debug session) is to specify an output location in the run configuration, though it's not clear why this works because that .exe file does not get cleaned up either!

Thank you.

 

0

Hello,

It's already fixed (GO-10254) and should be available in the next update.

Workaround:

1. Open Help | Find Action...
2. Type Registry and hit Enter.
3. Find go.build.output.path.cache.enabled and disable it.

I hope it helps.

0

请先登录再写评论。