aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-10-22 09:53:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-10-22 15:07:18 +0200
commit3a3660bb2b88b1f7f7820fc179942221d3a72bb4 (patch)
tree842b44be0bc89ae4696aefc9c27e0d3695369a38
parent90fb4dcbc6f819095d82a895b65cd5e52ce23e67 (diff)
Add delay between bpkg-pkg-build and bpkg-update on Windows
-rw-r--r--bbot/worker/worker.cxx16
1 files changed, 15 insertions, 1 deletions
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.h> // signal()
#else
-# include <libbutl/win32-utility.hxx>
+# include <libbutl/win32-utility.hxx> // SetErrorMode(), Sleep()
#endif
#include <map>
@@ -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)