HOWTO declare component inter-dependencies in multi-component packages

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld

I'm trying to generate (debian) packages for a project of mine using cmake. I need to generate multiple components ("runtime", "development", etc.). What is the expected way to have the "development" package depend on the "runtime" package ?

I'v been trying to play with the CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS setting, but so far wasn't able to have my packages contain the expected dependencies in their metadata.

Thanks,


Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

CMake mailing list
On Thu, 2019-10-03 at 16:15 -0400, stefan wrote:
> I'm trying to generate (debian) packages for a project of mine using
> cmake. I need to generate multiple components ("runtime",
> "development", etc.). What is the expected way to have the
> "development" package depend on the "runtime" package ?
> I'v been trying to play with the
> CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS setting, but so far wasn't able
> to have my packages contain the expected dependencies in their
> metadata.
> Thanks,

Please take a look at cpack_add_component():

https://cmake.org/cmake/help/latest/module/CPackComponent.html

Kyle
--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld

Hi Kyle,

thanks for the quick followup.

On 2019-10-03 4:23 p.m., Kyle Edwards wrote:
Please take a look at cpack_add_component():
https://cmake.org/cmake/help/latest/module/CPackComponent.html

I'm not sure what specifically I should be looking for.

In general my setup is working fine, i.e. my build generates multiple packages as expected. They even contain dependencies to external packages, as I have set as per the available variables. What I haven't been able to express is the component inter-dependency. That is, I haven't found a way to make my "development" package depend on the "runtime" package (generated from the same build process).

Sorry for being obtuse.

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

CMake mailing list
On Thu, 2019-10-03 at 16:30 -0400, stefan wrote:

> Hi Kyle,
> thanks for the quick followup.
> On 2019-10-03 4:23 p.m., Kyle Edwards wrote:
> > Please take a look at cpack_add_component():
> > https://cmake.org/cmake/help/latest/module/CPackComponent.html
> I'm not sure what specifically I should be looking for.
> In general my setup is working fine, i.e. my build generates multiple
> packages as expected. They even contain dependencies to external
> packages, as I have set as per the available variables. What I
> haven't been able to express is the component inter-dependency. That
> is, I haven't found a way to make my "development" package depend on
> the "runtime" package (generated from the same build process).
> Sorry for being obtuse.

In particular, please look at the DEPENDS argument of
cpack_add_component():

"DEPENDS lists the components on which this component depends. If this
component is selected, then each of the components listed must also be
selected. The dependency information is encoded within the installer
itself, so that users cannot install inconsistent sets of components."

Kyle
--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld


On 2019-10-03 4:37 p.m., Kyle Edwards wrote:
On Thu, 2019-10-03 at 16:30 -0400, stefan wrote:
Hi Kyle,
thanks for the quick followup.
On 2019-10-03 4:23 p.m., Kyle Edwards wrote:
Please take a look at cpack_add_component():
https://cmake.org/cmake/help/latest/module/CPackComponent.html
I'm not sure what specifically I should be looking for.
In general my setup is working fine, i.e. my build generates multiple
packages as expected. They even contain dependencies to external
packages, as I have set as per the available variables. What I
haven't been able to express is the component inter-dependency. That
is, I haven't found a way to make my "development" package depend on
the "runtime" package (generated from the same build process).
Sorry for being obtuse.
In particular, please look at the DEPENDS argument of
cpack_add_component():

"DEPENDS lists the components on which this component depends. If this
component is selected, then each of the components listed must also be
selected. The dependency information is encoded within the installer
itself, so that users cannot install inconsistent sets of components."

My project is already using this style:

  set(CPACK_COMPONENTS_ALL runtime development mstool)

i.e. all components are already defined. All that's missing is the declaration of their (inter-)dependencies.

Are you suggesting I should *not* use CPACK_COMPONENTS_ALL, but instead call `cpack_add_component()` instead ?

Thanks,


Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

CMake mailing list
On Thu, 2019-10-03 at 16:42 -0400, stefan wrote:
> My project is already using this style:
>   set(CPACK_COMPONENTS_ALL runtime development mstool)
>
> i.e. all components are already defined. All that's missing is the
> declaration of their (inter-)dependencies.
> Are you suggesting I should *not* use CPACK_COMPONENTS_ALL, but
> instead call `cpack_add_component()` instead ?
> Thanks,

That's how I prefer to do it. Alternatively, you could set
CPACK_COMPONENT_<compName>_DEPENDS directly (that's all that
cpack_add_component() is doing.)

Kyle
--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld


On 2019-10-03 4:59 p.m., Kyle Edwards wrote:
On Thu, 2019-10-03 at 16:42 -0400, stefan wrote:
My project is already using this style:
  set(CPACK_COMPONENTS_ALL runtime development mstool)

i.e. all components are already defined. All that's missing is the
declaration of their (inter-)dependencies.
Are you suggesting I should *not* use CPACK_COMPONENTS_ALL, but
instead call `cpack_add_component()` instead ?
Thanks,
That's how I prefer to do it. Alternatively, you could set
CPACK_COMPONENT_<compName>_DEPENDS directly (that's all that
cpack_add_component() is doing.)

Yes, that is exactly what I'm trying to do, but it doesn't seem to have any effect. That is, `dpkg --info ...` doesn't list the additional dependency, and correspondingly, running `apt-get install ...` on the component package file will install the package without first installing the prerequisite component.

Consider this declaration:

  set(CPACK_COMPONENTS_ALL runtime development mstool)

If I now write

  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)

I will see no effect. That is, the "development" package still does not depend on the "runtime" package.

So I try this:

  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS RUNTIME)

in case capitalization is required. Now the "runtime" component seems to get packaged twice (as per the cmake logs), but still no correct dependencies.

Is it time for a bug report ?

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

CMake mailing list
On Thu, 2019-10-03 at 17:08 -0400, stefan wrote:

> Yes, that is exactly what I'm trying to do, but it doesn't seem to
> have any effect. That is, `dpkg --info ...` doesn't list the
> additional dependency, and correspondingly, running `apt-get install
> ...` on the component package file will install the package without
> first installing the prerequisite component.
> Consider this declaration:
>   set(CPACK_COMPONENTS_ALL runtime development mstool)
> If I now write
>   set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
> I will see no effect. That is, the "development" package still does
> not depend on the "runtime" package.
> So I try this:
>   set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS RUNTIME)
> in case capitalization is required. Now the "runtime" component seems
> to get packaged twice (as per the cmake logs), but still no correct
> dependencies.
> Is it time for a bug report ?

Please send us a minimal CMakeLists.txt that reproduces the issue.

Kyle
--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld


On 2019-10-03 5:24 p.m., Kyle Edwards wrote:
On Thu, 2019-10-03 at 17:08 -0400, stefan wrote:
Yes, that is exactly what I'm trying to do, but it doesn't seem to
have any effect. That is, `dpkg --info ...` doesn't list the
additional dependency, and correspondingly, running `apt-get install
...` on the component package file will install the package without
first installing the prerequisite component.
Consider this declaration:
  set(CPACK_COMPONENTS_ALL runtime development mstool)
If I now write
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
I will see no effect. That is, the "development" package still does
not depend on the "runtime" package.
So I try this:
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS RUNTIME)
in case capitalization is required. Now the "runtime" component seems
to get packaged twice (as per the cmake logs), but still no correct
dependencies.
Is it time for a bug report ?
Please send us a minimal CMakeLists.txt that reproduces the issue.

Sure. Here it is. The relevant line part is line 5. Please let me know what I'm doing wrong.

Thanks,

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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

CMakeLists.txt (624 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld

Hi,

can you reproduce my observations ? I'm I doing something wrong or is there indeed an issue with CMake ? Should I follow up with a bug report ?

Thanks,

On 2019-10-04 2:20 p.m., stefan wrote:


On 2019-10-03 5:24 p.m., Kyle Edwards wrote:
On Thu, 2019-10-03 at 17:08 -0400, stefan wrote:
Yes, that is exactly what I'm trying to do, but it doesn't seem to
have any effect. That is, `dpkg --info ...` doesn't list the
additional dependency, and correspondingly, running `apt-get install
...` on the component package file will install the package without
first installing the prerequisite component.
Consider this declaration:
  set(CPACK_COMPONENTS_ALL runtime development mstool)
If I now write
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
I will see no effect. That is, the "development" package still does
not depend on the "runtime" package.
So I try this:
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS RUNTIME)
in case capitalization is required. Now the "runtime" component seems
to get packaged twice (as per the cmake logs), but still no correct
dependencies.
Is it time for a bug report ?
Please send us a minimal CMakeLists.txt that reproduces the issue.

Sure. Here it is. The relevant line part is line 5. Please let me know what I'm doing wrong.

Thanks,

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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
Reply | Threaded
Open this post in threaded view
|

Re: HOWTO declare component inter-dependencies in multi-component packages

Stefan Seefeld

ping ?

On 2019-10-07 12:47 p.m., stefan wrote:

Hi,

can you reproduce my observations ? I'm I doing something wrong or is there indeed an issue with CMake ? Should I follow up with a bug report ?

Thanks,

On 2019-10-04 2:20 p.m., stefan wrote:


On 2019-10-03 5:24 p.m., Kyle Edwards wrote:
On Thu, 2019-10-03 at 17:08 -0400, stefan wrote:
Yes, that is exactly what I'm trying to do, but it doesn't seem to
have any effect. That is, `dpkg --info ...` doesn't list the
additional dependency, and correspondingly, running `apt-get install
...` on the component package file will install the package without
first installing the prerequisite component.
Consider this declaration:
  set(CPACK_COMPONENTS_ALL runtime development mstool)
If I now write
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
I will see no effect. That is, the "development" package still does
not depend on the "runtime" package.
So I try this:
  set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS RUNTIME)
in case capitalization is required. Now the "runtime" component seems
to get packaged twice (as per the cmake logs), but still no correct
dependencies.
Is it time for a bug report ?
Please send us a minimal CMakeLists.txt that reproduces the issue.

Sure. Here it is. The relevant line part is line 5. Please let me know what I'm doing wrong.

Thanks,

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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