godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.75k stars 20.85k forks source link

`Access is denied` when trying to compile Godot #93493

Open brno32 opened 3 months ago

brno32 commented 3 months ago

Tested versions

System information

Godot v4.3.beta (e7859e9a4) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA; 31.0.15.4630) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)

Issue description

Sometimes when trying to compile godot, I get the following error:

scons: Building targets ...
[ 79%] Linking Program bin\godot.windows.editor.dev.x86_64.exe ...
[ 81%] LINK : fatal error LNK1104: cannot open file 'bin\godot.windows.editor.dev.x86_64.exe'
[ 81%] scons: *** [bin\godot.windows.editor.dev.x86_64.exe] Error 1104
scons: building terminated because of errors.
Exception ignored in atexit callback: <function purge_flaky_files at 0x0000028659AE7600>
Traceback (most recent call last):
  File "C:\Users\brno32\Repos\open-source\godot\SConstruct", line 1084, in purge_flaky_files
    os.remove(path)
PermissionError: [WinError 5] Access is denied: 'bin\\godot.windows.editor.dev.x86_64.exe'

Steps to reproduce

I cannot get it to happen reliably. The exact command I ran was:

venv/Scripts/scons dev_build=yes

Once I got the error, I was stuck and every compilation gave the same result. I unblocked myself by deleting bin\godot.windows.editor.dev.x86_64.exe

Minimal reproduction project (MRP)

N/A

huwpascoe commented 3 months ago

Make sure Godot exe isn't running before building.

brno32 commented 3 months ago

In my case, it wasn't running.

huwpascoe commented 3 months ago

In my case, it wasn't running.

Then yep, this is a bug. And it may not be easy to fix either.

Things to control for:

AThousandShips commented 3 months ago

I'm not sure this is something that's on our end with the buildsystem, or something we can fix, unless there's something wrong in the way files are handled (which I don't see) this is some bug or quirk in the OS or similar, or in the compiler

This is either a false positive somewhere in the compiler, or an actual case of the file being used, in neither case can we solve it really, unless the compiler is incorrectly configured, if it's not a false positive then we shouldn't change anything, we shouldn't somehow fix compiling to a file that's in use if it actually is in use

I'd say the only way it could reasonably be an error in Godot would be if the process didn't shut down properly, but that might just have been a slow process and it was resolved after some time, but that would be hard to say exactly and might just be specifically because of a particular project etc.