[cmake-developers] New command 'file(LOCK_DIRECTORY ...)'

Brad King brad.king at kitware.com
Tue Nov 25 13:29:22 EST 2014


On 11/17/2014 06:45 PM, Ruslan Baratov wrote:
> Done

Thanks.  Here are some more comments:

* Please rebase on current 'master' to resolve conflicts.

* The background.(bat|sh) files need to have quoting to work with
  spaces in the path.  Please try running tests with a source/build
  tree with spaces.

* The error messages currently use "SetError(...); return false;".
  That is why you need the ": " to get the prompt.  Instead you can
  use IssueMessage as shown in the hunk below for one example.
  Indented lines in the message will be printed as preformatted
  blocks so you do not have to worry about variations in the line
  wrapping of expected test output.

* Please use shorter timeouts in the test if possible to make it run
  faster.  If they become spurious/problematic then we can lengthen
  them later.

* Instead of background scripts, can you have a parent process take
  a lock, run a child with a timed out lock, and then release the
  lock?  Then the timeout can be just 0.1s in the child and there
  is no race.

Thanks,
-Brad


diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 8e63892..fb64b5a 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3679,10 +3679,10 @@ bool cmFileCommand::HandleLockCommand(
   if (resultVariable.empty() && !fileLockResult.IsOk())
     {
     cmOStringStream e;
-    e << ": error locking file \"" << path << "\" (" << result << ").";
-    this->SetError(e.str());
+    e << "error locking file\n " << path << "\n(" << result << ").";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     cmSystemTools::SetFatalErrorOccured();
-    return false;
+    return true;
     }

   if (!resultVariable.empty())



More information about the cmake-developers mailing list