As the Technical Author of the team, building rocks is not part of my day-to-day role. After working on the rocks documentation for over a year, I decided to give it a try and, in a way, test out the docs. My goal was to build a chiseled git rock, containing only what was strictly necessary. For this, I used Rockcraft, a tool for building rocks, and Chisel, a tool that allows you to extract well-defined portions of Debian packages, called slices.
I started with the rockcraft.yaml, the rock’s project file. At the top, I included the following:
name: git
base: bare
build-base: ubuntu@26.04
version: '2.53'
summary: A lightweight Git package for version control and CI/CD.
description: |
This project provides a lightweight Git package for version control
and CI/CD. It includes essential Git binaries and HTTP support.
The name, summary, and description keys are pretty intuitive. The version key was selected to match that in the Ubuntu packages website.
I wanted a chiseled rock, so the base had to be bare, as per the how-to guide. Since the base is bare, the build-base parameter is mandatory. I wanted to use Ubuntu Resolute only for the build environment, so I added that there.
Then, came the platforms key, that determines which architectures the project builds and runs on. I selected the following:
platforms:
amd64:
arm64:
ppc64el:
s390x:
Up until here, everything was pretty simple. Then came the parts, each representing a self-contained piece of software needed to create the final artifact. Following the how-to guide, I used the nil plugin and appended the desired package slice names to the list of stage-packages. A few months ago, I built the memcached rock. Slicing was the most time-intensive part of that process. However, we now have the chisel-slicer skill to help out with this task, so I was excited to check it out and see how much it could speed up the process.
Last time, I manually followed the guide on slicing a package step by step. If your package has a lot of dependencies, and the slices do not yet exist, this can take a lot of time. I wanted to check what an agent could do. I asked Copilot to follow the steps in the guide and apply them to the git package. I didn’t have to install anything myself; the moment I asked that, the agent recognized this was slice-authoring work and, per the repo’s AGENTS.md, pulled in the chisel-slicer skill on its own. I did not have to do anything else. The chisel-slicer skill identified the dependencies, checked if they were all sliced, and flagged those that were not: liberror-perl and git-man. Using the skill’s _deb-list.py tool, it pulled the real .deb contents straight from the Ubuntu mirror and worked through all the content. I got back a result that told me the binary content for git was already represented in the different git slices, and the two missing dependencies were only used for some man pages and Perl modules for git-svn/git-send-email. The whole point of this was building a rock that had only what was necessary for the rock to work, so this extra content was not needed. The chisel-slicer skill reached that conclusion and thoroughly reported it. I only had to decide which of the git slices I wanted to add to my rockcraft.yaml.
I decided on the following:
- git_daemon
- git_http-support
Regarding the support slices, I decided on the most-used ones. As a rule of thumb, it’s better to add things later when they are needed than to remove them, as this avoids regressions.
As this was a bare rock, other essential slices had to be added to achieve basic functionality. I found these by looking at other rocks built by the team:
- base-files_base # the ubuntu fs, e.g., bins, libs
- base-files_chisel # gives you chisel manifest, used to detect vulnerabilities
- base-files_release-info # information on the OS the rock is based on (26.04)
Then, I decided to look at similar rocks to check if I had missed any important slices. For that, I used the curl rock. I realized I was missing a slice that provided SSL certificates for secure connections, so I added the ca-certificates_data slice.
With that, I had my rock. I packed it with rockcraft pack and tested it to ensure it worked and that I had added all the required slices.
You don’t have to do this completely on your own. I asked a few questions along the way, and received help finding that last missing slice and a relevant example—special thanks to @alesancor! If you have any questions, feel free to reach out to the team on Matrix.
As you can see, you don’t need to be a software engineer to build a rock. You just need the documentation, some useful examples, and a supportive community to back you up. So go ahead, pick a package, and build your own rock!