question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows: failed to delete output files before executing action (.dll)

See original GitHub issue

Description of the problem / feature request:

When compiling on Windows, sometimes .dll cannot be deleted. The typical error message is: " xx.dll: failed to delete output files before executing action"

I am using remote_cache with remote_download_minimal, and it seems those items that actually are left in the local cache, sometimes cannot be deleted.

Manually you can delete the .dlls just fine, so a workaround for now is to search the local cache for .dlls and delete them before server side compilation.

I have previously seen problems when defender or anti-virus is temporarily locking files. However this failure is permanent: Bazel cannot delete the files, the user can.

Feature requests: what underlying problem are you trying to solve with this feature?

  1. Get a better error message when this error occurs (permission, read error etc).
  2. Create a more stable way to delete files on windows (retry?, unlocking?)

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

It is sporadic, but probably connected to remote_cache

What operating system are you running Bazel on?

Windows 10

What’s the output of bazel info release?

1.2.0

Have you found anything relevant by searching the web?

Nothing

Any other information, logs, or outputs that you want to share?

No.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hfekycommented, Jun 9, 2021

Is there any update on this issue? I’m still facing the same issue on Bazel 4.1.0 on Windows 10.

0reactions
fmeumcommented, Jan 24, 2022

I just encountered this bug on a Windows machine in GitHub Actions while building a jar file that does not contain any native code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

neovim - Choco Can not delete output file : Access is denied
If you have 'Access Denied' for .dll or .exe files be sure that you're not running the application that uses these files.
Read more >
Deleting .dll Files?? - Microsoft Community
To do this, right-click > go to Properties > Security > select Administrators > see if Full control is checked. If it is,...
Read more >
How to Delete DLL Files: 14 Steps (with Pictures) - wikiHow
1. Boot your Windows PC into Safe Mode. This ensures that if you have an unwanted app, such as spyware, that relies on...
Read more >
The Action Cannot Be Completed Because the File is Open: Fix
Read on to see how to delete a file when you get the action cannot be completed because the file is open in...
Read more >
Command-Line Reference | Bazel
Bazel will still be unable to parse the file 'external/BUILD', ... default: "": Add or remove keys from an action's execution info based...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found