builds failing ~50% of the time, with no changes to project or source code

I've been living with this for a while now, but it's getting annoying very quickly. I have a project in VS Code that uses the nRF Connect extension to build for nRF52832 and rNF52840 micros. Roughly half the time the build will fail with the error:

arm-zephyr-eabi-ar.exe: could not create temporary file whilst writing archive: no more archived files

If I just rebuild again (no changes whatsoever) it usually succeeds.

How do I tweak the extension/toolchain/??? so that it will succeed the first time, every time?

  • Hi,

    I have not seen other reports of this issue, but it  looks like an issue with writing to file on Windows, perhaps locked files or permission problems.

    • Where do you keep the build folder? Do you also see this issue if you make sure to not have the build folder in an OneDrive, Dropbox or similar? I suggest avoiding that.
    • If this does not seem to matter it could be worth checking if you see this with your antivirus temporarily disabled.
  • Definitely not a user/permission problem. I have the project directory on an SSD local to my (pretty beefy) PC. Nothing from my end should be touching the network, though I've learned not to make assumptions about VS Code or extensions with regards to that, but they _SHOULDN'T_ be reaching out anywhere...

    Antivirus is controlled by IT and I don't have the ability to change settings on it, but it has never caused issues with anything else so I'm skeptical that it would cause this.

    If the error really is running out of temporary files in parallel, what settings exist in the VS Code/extension that would reduce the parallelization of the build so it's not consuming as many resources at the same time?

  • Hi,

    I doubt this issue is directly VS Code related, as the VS code extension is just a frontend for doing the building via west and tools in the toolchain. To verify perhaps you can see if you see this issue if you build from the command line? See Building an application and select the "Command line" tab for instructions on that.

    I understand you scepticism about my anti virus suggestion, but at the same time, I am not able to find other reports of the issue you are seeing, so it is likely that there is something on your setup/system that is at least different from most users. Anti virus is one potential issue, so I would recommend looking a bit into that (if temporarily disabling is not an option, perhaps it is possible to whitelist the build folder just as an experiment).

Related