Re: [cmake-developers] Problem with created debian package

2017-12-29 Thread Kornel Benko
Am Freitag, 29. Dezember 2017 um 22:25:53, schrieb Domen Vrankar 

> 2017-12-29 14:20 GMT+01:00 Kornel Benko :
>
> > All of sudden, cmake(cpack) started producing wrong debian packages for
> > one project.
> >
>
> Did the project change in some way or was it the packaging environment that
> changed?
> I'd like to know a bit more details even if the solution below works to
> determine if this was a regression in CPack or something else.

Not that I were aware of.

>
> > This is the output of debian package manager:
> >
> > dpkg: warning: downgrading lyx24 from 2.4.0-50424git-g3a4b233 to
> > 2.4.0-50422git-gd6fb2ab
> > (Reading database ... 422667 files and directories currently
> > installed.)
> > Preparing to unpack lyx24-2.4.0-50422git-Linux.deb ...
> > Unpacking lyx24 (2.4.0-50422git-gd6fb2ab) over
> > (2.4.0-50424git-g3a4b233) ...
> > dpkg: error processing archive lyx24-2.4.0-50422git-Linux.deb
> > (--install):
> >  corrupted filesystem tarfile - corrupted package archive
> > dpkg-deb: error: subprocess paste was killed by signal (Broken
> > pipe)
> > Errors were encountered while processing:
> >  lyx24-2.4.0-50422git-Linux.deb
> >
> > Analysing the data.tar.gz gives no hint. What helps is a sequence of
> > commands using the system's 'tar'.
> >
> > # ar xv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz
> > # sudo tar axf data.tar.gz
> > # tar cf data.tar ./usr
> > # gzip -f data.tar
> > # ar rv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz
> >
> > Now everything is OK.
> > Other projects do not show this behaviour.
> > This is cmake 3.10.20171229-g3e1f5b11, but the same happens with earlier
> > version.
> >
>
> I'm surprised that this fixed the problem but from what you're describing
> I'd say that some paths in the data tarball are too long for the paxr
> version of tar to handle correctly (this is the default tar that is used by
> CPack and debian packages as it is the most portable one).
> If I'm right you could:
>
> 1) shorten the file paths in the archive
> 2) use gnu tar instead by setting CPACK_DEBIAN_ARCHIVE_TYPE to gnutar

Thanks, this is really nice. Meanwhile I found out what was going wrong.
The package manager seems to not understand the way some filenames containing
non-ascii chars are coded by cpack.
I prepared a minimal example showing the effect here.

1.) Create a dir and copy the attached to it
2.) mkdir build; cd bild
3.) cmake .. -DCPACK_BINARY_DEB:BOOL=ON
4.) sudo dpkg -i wrongfilename-0.1.1-Linux.deb
(Reading database ... 422665 files and directories currently installed.)
Preparing to unpack wrongfilename-0.1.1-Linux.deb ...
Unpacking wrongfilename (0.1.1) ...
dpkg: error processing archive wrongfilename-0.1.1-Linux.deb 
(--install):
 corrupted filesystem tarfile - corrupted package archive
Errors were encountered while processing:
 wrongfilename-0.1.1-Linux.deb


> See
> https://cmake.org/cmake/help/v3.10/module/CPackDeb.html#variable:CPACK_DEBIAN_ARCHIVE_TYPE
>
> Regards,
> Domen

Kornel

signature.asc
Description: This is a digitally signed message part.
cmake_minimum_required(VERSION 2.6.4)

project(wrongfilename)

set(FN "novýsúbor.txt")

install(FILES ${FN} DESTINATION "share")

set(CPACK_PACKAGE_CONTACT "Kornel.Benko")
include(CPack)

-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [cmake-developers] Build failure due to {cd bindir} failed on Windows/Ninja

2017-12-29 Thread Jom O'Fisher
>> Ninja should be using relative paths for the build tree and absolute
for anything outside of it.
That appears to be the case, so I need a better theory. I noticed another
difference between compilation phase and link phase. The link phase is
bracketed by cmd.exe /C "cd . &&  && cd .".
I'm wondering problem those "cd ." calls are solving? Their presences is
what's causing everything to be wrapped in "cmd /C"

Here's the error that encapsulates the failure

CMake Error at D:/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/
Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler
  "D:/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/
windows-x86_64/bin/clang.exe"
  is not able to compile a simple test program.
  It fails with the following output:
   Change Dir: D:/src/MyApplication/app/.externalNativeBuild/cmake/
debug/armeabi/CMakeFiles/CMakeTmp

  Run Build Command:"D:\Android\sdk\cmake\3.6.3155560\bin\ninja.exe"
  "cmTC_0dcd8"
  [1/2] Building C object CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o
  [2/2] Linking C executable cmTC_0dcd8
  FAILED: cmd.exe /C "cd .  &&
  D:\Android\sdk\ndk-bundle\toolchains\llvm\prebuilt\
windows-x86_64\bin\clang.exe
  --target=armv5te-none-linux-androideabi
  --gcc-toolchain=D:/Android/sdk/ndk-bundle/toolchains/arm-
linux-androideabi-4.9/prebuilt/windows-x86_64
  --sysroot=D:/Android/sdk/ndk-bundle/sysroot -isystem
  D:/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
  -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables
  -fstack-protector-strong -no-canonical-prefixes -march=armv5te
  -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
  -Wformat -Werror=format-security -Wl,--exclude-libs,libgcc.a --sysroot
  D:/Android/sdk/ndk-bundle/platforms/android-14/arch-arm -Wl,--build-id
  -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined
  -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now
  -Wl,--gc-sections -Wl,-z,nocopyreloc
  CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o -o cmTC_0dcd8 -lm && cd ."
  clang.exe: error: no such file or directory:
  'CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o'
  ninja: build stopped: subcommand failed.


Notes:
(1) The change dir doesn't appear to have any non-ascii characters:
   Change Dir: D:/src/MyApplication/app/.externalNativeBuild/cmake/
debug/armeabi/CMakeFiles/CMakeTmp
(2) The compile phase succeeds and produces a .o file:
  [1/2] Building C object CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o
(3) The link phase fails to consume the exact same _relative_ .o file:
  clang.exe: error: no such file or directory:
  'CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o'






On Fri, Dec 29, 2017 at 7:02 AM, Ben Boeckel 
wrote:

> On Thu, Dec 28, 2017 at 12:51:20 -0800, Jom O'Fisher wrote:
> > (1) Invoke cmake to generate ninja project. Success.
> > * Note that generated rules.ninja has .o compilation dependencies with
> > absolute paths and .so link dependencies with relative paths.
>
> Ninja should be using relative paths for the build tree and absolute for
> anything outside of it.
>
> > (3) CMake changes tries to change it's working directory here:
> > https://github.com/Kitware/CMake/blob/08ce62bee5bee6805fbb01c1821c43
> > 8028e858dc/Source/cmGlobalGenerator.cxx#L1811
>
> What would cause `ChangeDirectory` to fail? Is there some non-ASCII in
> the directory path?
>
> --Ben
>
-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [cmake-developers] Problem with created debian package

2017-12-29 Thread Domen Vrankar
2017-12-29 14:20 GMT+01:00 Kornel Benko :

> All of sudden, cmake(cpack) started producing wrong debian packages for
> one project.
>

Did the project change in some way or was it the packaging environment that
changed?
I'd like to know a bit more details even if the solution below works to
determine if this was a regression in CPack or something else.


> This is the output of debian package manager:
>
> dpkg: warning: downgrading lyx24 from 2.4.0-50424git-g3a4b233 to
> 2.4.0-50422git-gd6fb2ab
> (Reading database ... 422667 files and directories currently
> installed.)
> Preparing to unpack lyx24-2.4.0-50422git-Linux.deb ...
> Unpacking lyx24 (2.4.0-50422git-gd6fb2ab) over
> (2.4.0-50424git-g3a4b233) ...
> dpkg: error processing archive lyx24-2.4.0-50422git-Linux.deb
> (--install):
>  corrupted filesystem tarfile - corrupted package archive
> dpkg-deb: error: subprocess paste was killed by signal (Broken
> pipe)
> Errors were encountered while processing:
>  lyx24-2.4.0-50422git-Linux.deb
>
> Analysing the data.tar.gz gives no hint. What helps is a sequence of
> commands using the system's 'tar'.
>
> # ar xv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz
> # sudo tar axf data.tar.gz
> # tar cf data.tar ./usr
> # gzip -f data.tar
> # ar rv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz
>
> Now everything is OK.
> Other projects do not show this behaviour.
> This is cmake 3.10.20171229-g3e1f5b11, but the same happens with earlier
> version.
>

I'm surprised that this fixed the problem but from what you're describing
I'd say that some paths in the data tarball are too long for the paxr
version of tar to handle correctly (this is the default tar that is used by
CPack and debian packages as it is the most portable one).
If I'm right you could:

1) shorten the file paths in the archive
2) use gnu tar instead by setting CPACK_DEBIAN_ARCHIVE_TYPE to gnutar

See
https://cmake.org/cmake/help/v3.10/module/CPackDeb.html#variable:CPACK_DEBIAN_ARCHIVE_TYPE

Regards,
Domen
-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [cmake-developers] Build failure due to {cd bindir} failed on Windows/Ninja

2017-12-29 Thread Ben Boeckel
On Thu, Dec 28, 2017 at 12:51:20 -0800, Jom O'Fisher wrote:
> (1) Invoke cmake to generate ninja project. Success.
> * Note that generated rules.ninja has .o compilation dependencies with
> absolute paths and .so link dependencies with relative paths.

Ninja should be using relative paths for the build tree and absolute for
anything outside of it.

> (3) CMake changes tries to change it's working directory here:
> https://github.com/Kitware/CMake/blob/08ce62bee5bee6805fbb01c1821c43
> 8028e858dc/Source/cmGlobalGenerator.cxx#L1811

What would cause `ChangeDirectory` to fail? Is there some non-ASCII in
the directory path?

--Ben
-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers


[cmake-developers] Problem with created debian package

2017-12-29 Thread Kornel Benko
All of sudden, cmake(cpack) started producing wrong debian packages for one 
project.
This is the output of debian package manager:

dpkg: warning: downgrading lyx24 from 2.4.0-50424git-g3a4b233 to 
2.4.0-50422git-gd6fb2ab
(Reading database ... 422667 files and directories currently installed.)
Preparing to unpack lyx24-2.4.0-50422git-Linux.deb ...
Unpacking lyx24 (2.4.0-50422git-gd6fb2ab) over 
(2.4.0-50424git-g3a4b233) ...
dpkg: error processing archive lyx24-2.4.0-50422git-Linux.deb 
(--install):
 corrupted filesystem tarfile - corrupted package archive
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 lyx24-2.4.0-50422git-Linux.deb

Analysing the data.tar.gz gives no hint. What helps is a sequence of commands 
using the system's 'tar'.

# ar xv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz
# sudo tar axf data.tar.gz
# tar cf data.tar ./usr
# gzip -f data.tar
# ar rv  lyx24-2.4.0-50422git-Linux.deb  data.tar.gz

Now everything is OK.
Other projects do not show this behaviour. 
This is cmake 3.10.20171229-g3e1f5b11, but the same happens with earlier 
version.

Kornel

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

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:
https://cmake.org/mailman/listinfo/cmake-developers