View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011452CMakeCPackpublic2010-11-12 19:342012-06-14 17:46
ReporterVladislav Vaintroub 
Assigned ToEric NOULARD 
PriorityhighSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.3 
Target VersionCMake 2.8.4Fixed in VersionCMake 2.8.4 
Summary0011452: Pack component install for archives breaks MySQL packaging
DescriptionHello,
the newly introduced component installation for archives (zip and tar.gz) has an unwanted effect on MySQL packaging. The situation is following : we do use INSTALL(COMPONENT) (for our home-backed scripts for MSI packaging), but we do expect ZIP and TGZ to be monolithic.
Now, with 2.8.3, if I do "make package on Unix" or "devenv MySQL.sln /build relwtihdebinfo /project package", I get a bunch of *.tar.gz (or *.zip) files.

CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE=1 sounds like a nice workaround, and it works *almost*, I get a single package but with the wrong name , "-ALL" is appended to the package name. CPACK_MONOLITHIC_INSTALL=1 would be fine to use on Unixes, and gives me what I need on Windows with ZIP, but unfortunately it screws our MSI scripts on Windows, because there are no components anymore.
Steps To Reproducehttp://www.perkin.org.uk/blog/2010/11/how-to-build-mysql-releases/ [^]
describes how MySQL releases are currently made. Perhaps, the simplest way to reproduce is just to follow the description.
Additional InformationI'd this a solution with CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE=1 respecting CPACK_PACKAGE_FILE_NAME (no -ALL addition) would be logical.
TagsNo tags attached.
Attached Filespatch file icon 0001-CPack-backward-compatibility-fix-2.8.3-2.8.2-for-arc.patch [^] (2,833 bytes) 2010-11-15 15:27 [Show Content]

 Relationships
related to 0011458closedEric NOULARD Enable use of CPACK_MONOLITHIC_INSTALL at CPack time 
related to 0011735closedEric NOULARD Generators create empty archives using component groups 
related to 0013307closedEric NOULARD CPack Generators producing a single package only 

  Notes
(0023237)
Eric NOULARD (developer)
2010-11-13 04:27

Small comment before beginning patch proposal.
I think -ALL suffix may be a bad idea however it was there for a reason.
Specifying CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE=1 will get you some
kind of monolithical installer but not quite
in fact it will "only" contain the component specified in
"CPACK_COMPONENTS_ALL". The component not specified there
won't be included.
For example if some target do not belong to a component AND
the "Unspecified" component is not part of CPACK_COMPONENTS_ALL
then those targets won't be included.

CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE=1
will get you some kind of monolithical installer but not quite
it will "only" contain every specified component GROUP.
Any component not belonging to a group will be excluded.

the "ALL" suffix was there as a reminder.
So I may remove the name mangling for "CPACK_COMPONENTS_ALL_xxxx"
(or make it optional using some extra CPACK_COMPONENTS_xxx vars)
but this is not as if CPACK_MONOLITHIC_INSTALL=1 has been set
because this basically remove ALL component machinery
**AT CMake time**.

Moreover I think being able to specify "CPACK_COMPONENTS_ALL_xxxx"
at CPack time through the CPACK_PROJECT_CONFIG_FILE would be great.
But we lack some "CPACK_CURRENT_GENERATOR" var to do that
because "CPACK_GENERATOR" contains a list which does not make it
possible between "the wanted list of CPack generator" and
"the currently running" CPack generator.

I think I'll open another bug/feature request for that.
(0023239)
Eric NOULARD (developer)
2010-11-13 08:40

Ok it looks like I was wrong concerning the **CPack runtime**
value of CPACK_GENERATOR
 not the first time, though :-]

From CPack.cmake embedded doc one can read:

# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
# on a per-generator basis. It only need contain overrides.
#
# Here's how it works:
# - cpack runs
# - it includes CPackConfig.cmake
# - it iterates over the generators listed in that file's
# CPACK_GENERATOR list variable (unless told to use just a
# specific one via -G on the command line...)
#
# - foreach generator, it then
# - sets CPACK_GENERATOR to the one currently being iterated
# - includes the CPACK_PROJECT_CONFIG_FILE
# - produces the package for that generator
#
# This is the key: For each generator listed in CPACK_GENERATOR
# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR
# internally to *the one currently being used* and then include
# the CPACK_PROJECT_CONFIG_FILE.

And I've just checked it's true :-]
So the only remaining issue is the component name mangling issue
because doing CPack generator specific things using
project specific CPack Config file just works as expected :-]
(0023246)
Vladislav Vaintroub (reporter)
2010-11-13 18:20

Workaround for MySQL http://lists.mysql.com/commits/123792 [^]

We'll use CPACK_MONOLITHIC_INSTALL=1 by default and reset it (temporarily) just for our MSI scripting, that needs components.
(0023265)
Eric NOULARD (developer)
2010-11-15 15:31

I've just attached a patch which if applied to 2.8.3 makes it
backward compatible with 2.8.2 behavior.

All archive generators will produce a single package as with 2.8.2
unless one set CPACK_ARCHIVE_COMPONENT_INSTALL (may be set at CPack time).

I may further refine for the different archive generators
(TGZ, ZIP, STGZ, etc...) but currently this is global.

see discussion on the ML too:
http://www.cmake.org/pipermail/cmake/2010-November/040780.html [^]
(0023267)
Eric NOULARD (developer)
2010-11-15 15:43

The patch is pushed on stage branch
CPack-Bug11452-ComponentBreakage
(0023899)
Eric NOULARD (developer)
2010-12-11 17:44

This issue should now be solved in current master:

commit 42fac2580851e3297b774dc21c0b4752e8f84407
Merge: b4bd2d3 12a7125
Author: Brad King <brad.king@kitware.com>
Date: Thu Dec 2 14:24:51 2010 -0500

    Merge topic 'CPack-Bug11452-ComponentBreakage-v2'
    
    12a7125 CPack Fix KWStyle error
    d0eb89c CPack backward compatibility fix 2.8.3-2.8.2 (bug 11452)

The default behavior of Archive generator is to build a single package
unless CPACK_ARCHIVE_COMPONENT_INSTALL is set.
(0023900)
Eric NOULARD (developer)
2010-12-11 17:48

I'll try to add more fine-grained control for the
different kind of archive generators: TGZ, TBZ2 etc...

Currently CPACK_ARCHIVE_COMPONENT_INSTALL is controlling all of
them such that you cannot have ZIP generate a single file and
TGZ generate several.

So I'm not closing it now (as a reminder for me).
I'll close it soon enough before 2.8.4.
(0023971)
Eric NOULARD (developer)
2010-12-14 15:53

My previous comment was wrong.
CPACK_ARCHIVE_COMPONENT_INSTALL combined with
CPACK_PROJECT_CONFIG_FILE
enables full control.

I'll the enhancement concerning isOn usage to reach master
(only in next for now) and I'll close this bug.

commit 6d94ea3692c5dd3aafaf8183e31f6060ca2a4669
Author: Eric NOULARD <eric.noulard@gmail.com>
Date: Sun Dec 12 12:55:02 2010 +0100

    CPack use IsOn when it's better than IsSet
(0024262)
Eric NOULARD (developer)
2010-12-19 06:35

All bits needed for this are now in master:

- default behavior of ZIP generator is back to single file
  (like in cmake 2.8.2 and before)

- if CPACK_ARCHIVE_COMPONENT_INSTALL is set to ON
  the default behavior will be to generated "component files"
  The value of CPACK_ARCHIVE_COMPONENT_INSTALL may be set
  in a CPACK_PROJECT_CONFIG_FILE for having different
  and specific behavior depending on the Archive based-generator.
  (ZIP, TGZ, TBZ2, STGZ, TZ)

- CPACK_MONOLITHIC_INSTALL is now honored at CPack time too.

 Issue History
Date Modified Username Field Change
2010-11-12 19:34 Vladislav Vaintroub New Issue
2010-11-13 03:09 Eric NOULARD Assigned To => Eric NOULARD
2010-11-13 03:09 Eric NOULARD Status new => assigned
2010-11-13 04:27 Eric NOULARD Note Added: 0023237
2010-11-13 08:40 Eric NOULARD Note Added: 0023239
2010-11-13 18:20 Vladislav Vaintroub Note Added: 0023246
2010-11-14 06:14 Eric NOULARD Relationship added duplicate of 0011458
2010-11-15 15:27 Eric NOULARD File Added: 0001-CPack-backward-compatibility-fix-2.8.3-2.8.2-for-arc.patch
2010-11-15 15:31 Eric NOULARD Note Added: 0023265
2010-11-15 15:43 Eric NOULARD Note Added: 0023267
2010-11-15 16:05 Eric NOULARD Relationship deleted 0011458
2010-11-15 16:06 Eric NOULARD Relationship added related to 0011458
2010-12-11 17:44 Eric NOULARD Note Added: 0023899
2010-12-11 17:46 Eric NOULARD Target Version => CMake 2.8.4
2010-12-11 17:48 Eric NOULARD Note Added: 0023900
2010-12-14 15:53 Eric NOULARD Note Added: 0023971
2010-12-19 06:35 Eric NOULARD Note Added: 0024262
2010-12-19 06:35 Eric NOULARD Status assigned => closed
2010-12-19 06:35 Eric NOULARD Resolution open => fixed
2010-12-19 06:35 Eric NOULARD Fixed in Version => CMake 2.8.4
2011-01-20 16:35 Eric NOULARD Relationship added related to 0011735
2012-06-14 17:46 Eric NOULARD Relationship added related to 0013307


Copyright © 2000 - 2018 MantisBT Team