View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009721CMakeCPackpublic2009-10-15 18:242013-10-07 10:03
ReporterMarcelo Canga 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0009721: Cpack in Macos segfaults when trying to build a NSIS (crosscompiled) package
DescriptionI am having trouble building a NSIS package running cpack from my mac
for windows xp

This is what I have on my cross-compile setup in my mac:

   I have a cross-compile setup working in Macos, mingw-gcc
   I have cpack - zip running on my mac for windows xp

This is what I have in windows xp:
  I have cpack - nsis for windows xp running from windows xp

This is what is not working,
   I can't run cpack nsis from my mac for windows xp.

When I try to run cpack from my mac, the process die with the
following message,

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid

The traceback is in "Additional Information". I uploaded the file CPackConfig.cmake FYI.

Additional InformationI compiled the cmake distribution, versions 2.6.4 and current CVS version 2.9.0
with similar results,
This is my conversation with Alex about 2.6.4 run,

Thanks.
Can you please put this in the cmake bugtracker at
http://public.kitware.com/Bug/ [^] ?
Can you also check whether this also happens with cmake cvs HEAD / 2.8.0 RC3 ?

Thanks
Alex

r --config ./CPackConfig.cmake

#0 0x967afe42 in __kill ()
#1 0x967afe34 in kill$UNIX2003 ()
0000002 0x9682223a in raise ()
0000003 0x9682e679 in abort ()
0000004 0x92c29005 in __gnu_cxx::__verbose_terminate_handler ()
0000005 0x92c2710c in __gxx_personality_v0 ()
0000006 0x92c2714b in std::terminate ()
0000007 0x92c27261 in __cxa_throw ()
0000008 0x92be7a6a in std::__throw_logic_error ()
#9 0x92c0f366 in std::string::_S_construct<char const*> ()
0000010 0x92c0f4ac in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string ()
#11 0x000204a0 in cmCPackNSISGenerator::InitializeInternal
(this=0x82a8e0) at /download/cmake-2.6.4/Source/CPack/
cmCPackNSISGenerator.cxx:383
0000012 0x0000d98e in cmCPackGenerator::Initialize (this=0x82a8e0,
name=0x824b9c "NSIS", mf=0xbfffea38) at /download/cmake-2.6.4/Source/
CPack/cmCPackGenerator.cxx:925
0000013 0x00005e7a in main (argc=3, argv=0xbffff3d8) at /download/
cmake-2.6.4/Source/CPack/cpack.cxx:385

This is the 383 line,
383 std::string tmpFile = this-

GetOption("CPACK_TOPLEVEL_DIRECTORY");

This is the 925 line,
925 int result = this->InitializeInternal();

this is the 385 line,
385 if ( parsed && !cpackGenerator->Initialize(gen, mf) )
TagsNo tags attached.
Attached Files? file icon CPackConfig.cmake [^] (5,028 bytes) 2009-10-15 18:24
patch file icon cmCPackNSISGenerator.patch [^] (2,138 bytes) 2010-04-14 16:24 [Show Content]
? file icon cmCPackNSISGenerator.cxx_patch [^] (3,114 bytes) 2012-11-04 16:41

 Relationships

  Notes
(0018079)
Bill Hoffman (manager)
2009-10-16 12:59

That should be set here:
int cmCPackGenerator::PrepareNames()
...
  this->SetOptionIfNotSet("CPACK_TOPLEVEL_DIRECTORY", topDirectory.c_str());

How do you setup nsis to work on the Mac? I have never tried that platform combination.
(0018082)
Marcelo Canga (reporter)
2009-10-16 13:37

The easiest is to use makensis from the Macport distribution.

I also tried to compile it. This is a bigger effort since it requires additional libraries that are hard to compile.
(0020186)
Gerald Hofmann (reporter)
2010-04-14 16:24

NSIS from Macports does not return a release version string.

makensis -VERSION
< v25-Feb-2010.cvs

Version checking in cmCPackNSISGenerator.cxx fails indefinitely because the expected regex is not matched.

I have uploaded a patch. Now only a release version string is checked for the minimum required version. If NSIS returns a cvs build version string (like it does when built by Macports), there is no version checking done at all. I think in this case a check is dispensable.

I do not fully understand why the CPACK_TOPLEVEL_DIRECTORY access fails when no matching NSIS version is found though. Maybe someone feels to fix the error handling if actually no valid NSIS version string was returned.
(0031418)
Graham Menhennitt (reporter)
2012-11-04 16:46

I've uploaded a slight improvement to the patch file from Gerald. This version is a patch against CMake 2.8.10 and it also correctly handles the case where the version check fails and the CPACK_TOPLEVEL_DIRECTORY option is not set (mentioned by Gerald above).

Could we please get this rather trivial fix applied in time for the next release. Otherwise cross-building NSIS on Linux and/or Mac doesn't work.

Thanks,
  Graham
(0032539)
Brad King (manager)
2013-03-08 08:22

Patch applied:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79478904 [^]
(0033984)
Robert Maynard (manager)
2013-10-07 10:03

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2009-10-15 18:24 Marcelo Canga New Issue
2009-10-15 18:24 Marcelo Canga File Added: CPackConfig.cmake
2009-10-16 12:59 Bill Hoffman Note Added: 0018079
2009-10-16 13:26 Bill Hoffman Status new => assigned
2009-10-16 13:26 Bill Hoffman Assigned To => Bill Hoffman
2009-10-16 13:37 Marcelo Canga Note Added: 0018082
2010-04-14 16:24 Gerald Hofmann Note Added: 0020186
2010-04-14 16:24 Gerald Hofmann File Added: cmCPackNSISGenerator.patch
2012-11-04 16:41 Graham Menhennitt File Added: cmCPackNSISGenerator.cxx_patch
2012-11-04 16:46 Graham Menhennitt Note Added: 0031418
2013-03-08 08:22 Brad King Note Added: 0032539
2013-03-08 08:22 Brad King Assigned To Bill Hoffman => Brad King
2013-03-08 08:22 Brad King Status assigned => resolved
2013-03-08 08:22 Brad King Resolution open => fixed
2013-03-08 08:22 Brad King Fixed in Version => CMake 2.8.11
2013-03-08 08:22 Brad King Target Version => CMake 2.8.11
2013-10-07 10:03 Robert Maynard Note Added: 0033984
2013-10-07 10:03 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team