Am Mittwoch, 9. Januar 2013 um 04:14:41, schrieb Scott Kostyshak 
<skost...@lyx.org>
> When doing a fresh build with cmake, every day or so I get an error.
> I've reproduced this several times with several commits (but can't
> reproduce it on demand because it has to do with the date changing). I
> see two issues:
> 
> 1. Is there a fix for this occasional error?
> 
> 2. Given that there's an error, make does not stop. The error occurs
> between line 20 and 30 of the make output, but cmake does not realize
> it needs to stop until that error produces another error, when
> building version.cpp around line 1500 (72%).
> 
> I've reproduced this on two machines, both running 64-bit Ubuntu
> 12.04, and with both Cmake 2.8.7 and 2.8.10.2.
> 
> The initial error is (on line 20-30):
> Error copying file (if different) from
> "/home/scott/lyxbuilds/master/build/build/lyx_date.tmp" to
> "/home/scott/lyxbuilds/master/build/build/lyx_date.h".

At least this one should stop the compilation. See attached.

> Then, when building version.cpp:
> /home/scott/lyxbuilds/master/build/src/version.cpp:14:23: fatal error:
> lyx_date.h: No such file or directory
> compilation terminated.
> make[2]: *** [build/src/tex2lyx/CMakeFiles/tex2lyx2.1.dir/__/version.cpp.o]
> Error 1
> make[2]: Leaving directory `/home/scott/lyxbuilds/master/build'
> make[1]: *** [build/src/tex2lyx/CMakeFiles/tex2lyx2.1.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> The part of the Cmake code responsible is in LyXGetVersion.cmake:
> 
>   COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${TOP_BINARY_DIR}/lyx_date.tmp ${TOP_BINARY_DIR}/lyx_date.h

Not exactly. The important prerequisite is LyXGetVersion.cmake:49
        configure_file(${TOP_CMAKE_PATH}/lyx_date.h.cmake 
${TOP_BINARY_DIR}/lyx_date.tmp)
which should create the lyx_date.tmp file.

> Attached in make_logs.tar.gz are four logs, two instances of the
> errors from two machines.
> 
> Any ideas?

Do you use 'make -jxxxx' ? I am unsure about the parallel compilation ...

> Thanks,
> 
> Scott

        Kornel
diff --git a/development/cmake/scripts/LyXGetVersion.cmake b/development/cmake/scripts/LyXGetVersion.cmake
index d2f5a4b..7c39b1a 100644
--- a/development/cmake/scripts/LyXGetVersion.cmake
+++ b/development/cmake/scripts/LyXGetVersion.cmake
@@ -47,8 +47,18 @@ if(LYX_GITVERSION)
 endif()
 
 configure_file(${TOP_CMAKE_PATH}/lyx_date.h.cmake ${TOP_BINARY_DIR}/lyx_date.tmp)
+message(STATUS "Created ${TOP_BINARY_DIR}/lyx_date.tmp")
+
 EXECUTE_PROCESS(
   COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TOP_BINARY_DIR}/lyx_date.tmp ${TOP_BINARY_DIR}/lyx_date.h
+  ERROR_VARIABLE copy_err
+)
+if(copy_err)
+  message(FATAL_ERROR "Not working configure_file?")
+endif()
+
+EXECUTE_PROCESS(
   COMMAND ${CMAKE_COMMAND} -E remove ${TOP_BINARY_DIR}/lyx_date.tmp
 )
 
+

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to