[PATCH v2 1/1] buildtools: avoid break due to failure to cleanup temporary directory

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed May 7 00:31:13 CEST 2025


On 07.05.2025 01:14, Andre Muezerie wrote:
> When compiling drivers on Windows, instances have been seen where a
> temporary directory fails to get cleaned up due to
> ERROR_SHARING_VIOLATION (32).
>
> Code inspection did not reveal problems with the DPDK code and scripts,
> and this issue was only seen on Windows. Adding a 1 second sleep before
> cleaning up the temporary directory seems to be effective, but to
> guarantee that this break does not happen anymore, flag
> "ignore_cleanup_errors" is set to "True".

This paragraph needs an update.

> --- a/buildtools/gen-pmdinfo-cfile.py
> +++ b/buildtools/gen-pmdinfo-cfile.py
> @@ -5,17 +5,15 @@
>   import os
>   import subprocess
>   import sys
> -import tempfile
>   
> -_, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
> -with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
> -    paths = []
> -    for name in subprocess.run([ar, "t", archive], stdout=subprocess.PIPE,
> -                               check=True).stdout.decode().splitlines():
> -        if os.path.exists(name):
> -            paths.append(name)
> -        else:
> -            subprocess.run([ar, "x", os.path.abspath(archive), name],
> -                           check=True, cwd=temp)
> -            paths.append(os.path.join(temp, name))
> -    subprocess.run(pmdinfogen + paths + [output], check=True)
> +_, tmp_root, ar, tmp_dir, archive, output, *pmdinfogen = sys.argv
No need for `tmp_root` anymore: it was required to put temporary files 
inside the build directory, but `@PRIVATE_DIR@` is already there.


More information about the dev mailing list