FILE(LOCK ... GUARD FILE) fails with cmake -P

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FILE(LOCK ... GUARD FILE) fails with cmake -P

Sergey Zakharchenko
Hello,

CMake crashes on an assertion when I use FILE(LOCK ... GUARD FILE)
inside of a file called (directly or indirectly) from cmake -P.

$ cat x.cmake
FILE(LOCK . DIRECTORY GUARD FILE)

$ cat y.cmake
INCLUDE(x.cmake)

$ cmake -P  x.cmake
Assertion failed: (!this->FileScopes.empty()), function LockFileScope,
file /wrkdirs/usr/ports/devel/cmake/work/cmake-3.5.0/Source/cmFileLockPool.cxx,
line 76.
Abort trap (core dumped)

$ cmake -P y.cmake
Assertion failed: (!this->FileScopes.empty()), function LockFileScope,
file /wrkdirs/usr/ports/devel/cmake/work/cmake-3.5.0/Source/cmFileLockPool.cxx,
line 76.
Abort trap (core dumped)

I've tested this with different base systems and CMake versions from
3.4.1 to 3.7.2 with similar results (doesn't matter if I lock a file
instead either). It's easy to work around (wrap code with function)
but a bit inelegant. I understand there may be some limitation but
there could at least be some sensible error message like with 'GUARD
FUNCTION' when it's not used in a function definition...

Best regards,

--
DoubleF
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FILE(LOCK ... GUARD FILE) fails with cmake -P

Robert Maynard
Hi,

I have opened an issue reporting this problem:
https://gitlab.kitware.com/cmake/cmake/issues/17009

On Fri, Jun 23, 2017 at 2:23 AM, Sergey Zakharchenko
<[hidden email]> wrote:

> Hello,
>
> CMake crashes on an assertion when I use FILE(LOCK ... GUARD FILE)
> inside of a file called (directly or indirectly) from cmake -P.
>
> $ cat x.cmake
> FILE(LOCK . DIRECTORY GUARD FILE)
>
> $ cat y.cmake
> INCLUDE(x.cmake)
>
> $ cmake -P  x.cmake
> Assertion failed: (!this->FileScopes.empty()), function LockFileScope,
> file /wrkdirs/usr/ports/devel/cmake/work/cmake-3.5.0/Source/cmFileLockPool.cxx,
> line 76.
> Abort trap (core dumped)
>
> $ cmake -P y.cmake
> Assertion failed: (!this->FileScopes.empty()), function LockFileScope,
> file /wrkdirs/usr/ports/devel/cmake/work/cmake-3.5.0/Source/cmFileLockPool.cxx,
> line 76.
> Abort trap (core dumped)
>
> I've tested this with different base systems and CMake versions from
> 3.4.1 to 3.7.2 with similar results (doesn't matter if I lock a file
> instead either). It's easy to work around (wrap code with function)
> but a bit inelegant. I understand there may be some limitation but
> there could at least be some sensible error message like with 'GUARD
> FUNCTION' when it's not used in a function definition...
>
> Best regards,
>
> --
> DoubleF
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...