From 3a3660bb2b88b1f7f7820fc179942221d3a72bb4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Oct 2021 09:53:04 +0200 Subject: Add delay between bpkg-pkg-build and bpkg-update on Windows --- bbot/worker/worker.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 8994e3f..8e4ec3a 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -4,7 +4,7 @@ #ifndef _WIN32 # include // signal() #else -# include +# include // SetErrorMode(), Sleep() #endif #include @@ -2206,6 +2206,16 @@ build (size_t argc, const char* argv[]) rm.status |= r.status; } +#ifdef _WIN32 + // Give Windows a chance to (presumably) scan any files we may have just + // unpacked. Failed that, if we try to overwrite any such file (e.g., a + // generated header) we may end up with a permission denied error. Note + // also that this is in addition to the 2 seconds retry we have in our + // fdopen() implementation, which is not always enough. + // + Sleep (5000); +#endif + // Update the main package. // { @@ -3091,6 +3101,10 @@ build (size_t argc, const char* argv[]) break; } +#ifdef _WIN32 + Sleep (5000); // See above. +#endif + // Run external runtime tests. // if (has_runtime_tests) -- cgit v1.1