Skip to content

Conversation

@MarcelGraf0710
Copy link

@MarcelGraf0710 MarcelGraf0710 commented Dec 7, 2025

GitLab username

grafml

Completed tasks

I completed all mandatory and all optional tasks.

  • The runtime Debian package (see remark below) does indeed contain libyaml-cpp as a dependency in the unpacked .deb file under <unpacked_debian>/DEBIAN/control.

  • There is a significant difference in memory consumption between stripped and unstripped files, see table below.

  • The development Debian package is fully lintian compliant, that is, neither errors nor warnings occur.

  • I use an entry point shell file such that the Docker container automatically creates the packages once started.

Debian file Unstripped size in Bytes Stripped size in Bytes
libcpackexample1_0.1.0_amd64.deb 2,627,478 193,134
libcpackexample-libcpackexample1_0.1.0_amd64.deb 706 706
libcpackexample-dev_0.1.0_amd64.deb 2,310 2,308

I was only able to satisfy everything lintian demanded by embracing a split into a development package (libcpackexample-dev_0.1.0_amd64.deb) and a runtime package (libcpackexample1_0.1.0_amd64.deb).

Reproducing the results

Since the Docker container contains the entry point shell script, the following instructions suffice to reproduce the results. Inside the root folder of my fork, please execute:

sudo docker build -t cpack-exercise .
sudo docker run --rm -it --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpack-exercise

If you want to install the packages and run cpackexample in the subsequent bash session, please enter

cd out
apt install ./libcpackexample-dev_0.1.0_amd64.deb ./libcpackexample1_0.1.0_amd64.deb
cpackexample

Use of AI

Especially for figuring out how to achieve lintian compliance, I used ChatGPT. This included

  • The idea to split into a development and a runtime package, which was a structure I already knew from other packages
  • A template Debian changelog file, which I had to adapt, however, such that lintian is fine with it
  • A template manpage file

…at lintian is happy; adaptions to CPackConfig.cmake; adapted Dockerfile such that packages are automatically setup when entering container
@uekerman
Copy link
Member

Looks perfect in principle, only problem is that I don't see the out folder on my system. Where should this end up?

@MarcelGraf0710
Copy link
Author

After taking a look at this again, I found out that something was not working as intended with the version you tested.

What the problem was:
In the description above, I was talking about a "subsequent bash session", and the plan was indeed that after everything has been set up, a bash session is entered. Since I mentioned this bash session, it must have worked on my machine at that time. However, after cloning it again and re-building everything, it did not.

What I did now:
Right now, I added one line to the docker_entry.sh, namely exec "$@". This passes the control back to the shell after the docker_entry.sh has been executed. Like this, a bash session is entered after everything is set up, as it was intended originally.

What was supposed to happen:
The out folder is indeed only accessible from within the interactive session after everything is set up. So that second-to-last part just above the "Use of AI" section was supposed to be executed in there, which was not possible. Sorry about that.

Attached, you find a screenshot of how it looks on my machine with this one change applied.

Screenshot_20260126_214948

@uekerman
Copy link
Member

Thanks for the quick reaction. I can reproduce your screenshot. But this doesn't bring the packages to the host system, no? Moving out to the mounted folder and not running interactively should do the job though.

@MarcelGraf0710
Copy link
Author

You are right, and I see what is going on now. It seems like I missed the part about the packages having to be available on the host machine. This is why I kept the subsequent shell session in the first place - I thought it would be fine to check all of that from within that session. I added cp -r out /mnt/cpack-exercise/ to the docker-entry.sh such that it now copies the out directory the host system. Thank you for your patience!

When I run lintian again now to check the dev package, it now shows me one warning (see below), which it did not do when I first tested it.

one-warning

@uekerman
Copy link
Member

I can confirm that it works now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants