← Back to issue list

Priming files into /lib breaks system binaries in the final image

View original Github issue

Metadata

Project
rockcraft
Number
#137
Type
issue
State
open
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Priming files into /lib (a symlink to /usr/lib in Ubuntu 22.04) breaks the symlink in the final image, causing system binaries to fail. Multiple usrmerge-related PRs have since been merged addressing symlink handling in layers.

Suggested action: close stale

Reason: The issue was filed in Nov 2022 and has had no activity since. Multiple subsequent PRs have addressed the underlying usrmerge symlink problem: #154 (handle symlinks in base layer), #163 (opaque whiteouts), #200 (subdirs in usrmerge), #211 (symlink subdirs), #417 (prune primed files), and #498 (remove usrmerge-breaking symlinks). The current codebase has a full usrmerge implementation with documentation (docs/explanation/usrmerge.rst) and the problem described in this issue appears to have been resolved through these changes.

Impact: 80 Quick Win: 24.0 Staleness: 75 Complexity: 70 Confidence: 72 Support Request: 5

Issue body

For the following `rockcraft.yaml`, the `files/` directory contains just an empty `file.txt`: ```yaml name: broken-image summary: summary description: description version: "0.0.1" license: Apache-2.0 base: ubuntu:22.04 platforms: amd64: parts: p1: plugin: dump source: files organize: file.txt: /lib/file.txt ``` After building and loading the ROCK into docker with skopeo, the binaries inside the container are broken: ```bash $ docker run -it broken-image bash exec /usr/bin/bash: no such file or directory ``` -------------------------------- From a little testing, I think the issue is the interaction between the base image layer and the new layer created for the parts. In `ubuntu:22.04`, `/lib` is a symlink to `/usr/lib`. The layer created for the parts' files has a `/lib/file.txt` and this is breaking the symlink; the "final" filesystem used in the containers has a regular `/lib` dir that is *not* a symlink, and only contains `file.txt`. Thus the binaries that link against `/lib` are now broken because the dependencies cannot be resolved anymore. This example is simple but the bug probably affects many plugins; in particular the `python` plugin breaks because it writes the `site-packages` in `/lib`.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 80
Quick Win: 24.0
Staleness: 75
Complexity: 70
Confidence: 72
Support Request: 5
close stale Priming files into /lib (a symlink to /usr/lib in Ubuntu 22.04) breaks the symlink in the final image, causing system binaries to fail. Multiple usrmerge-related PRs have since been merged addressing symlink handling in layers.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 85
Confidence: 90
Support Request: 0
close stale Priming files into /lib replaces symlinks and breaks system binaries in container images. Maintainers discussed layering strategies and overlay workarounds. Inactive for over 3 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 80
Confidence: 80
Support Request: 5
needs triage Bug where priming files into /lib replaces a critical symlink with a directory, breaking system binaries in Ubuntu-based ROCK images. Technical discussion occurred in late 2022 but stalled, leaving the issue untriaged and unresolved for over three years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 88
Complexity: 75
Confidence: 65
Support Request: 5
needs triage Priming files into /lib replaces the base symlink to /usr/lib, breaking system binaries. Maintainers are evaluating layering strategies and whiteout files to preserve symlinks. Issue remains under discussion with no assigned fix.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/rockcraft#154 (confidence 80%)

    PR #154 'oci: handle symlinks in base layer (usrmerge)' directly addresses the symlink handling in base layers that this issue describes as broken.

  • Likely Fixed By: canonical/rockcraft#163 (confidence 75%)

    PR #163 'oci: handle opaque whiteouts in new layer (usrmerge)' addresses the whiteout file mechanism discussed in the issue comments.

  • Likely Fixed By: canonical/rockcraft#200 (confidence 70%)

    PR #200 'oci: fix handling of subdirs in usrmerge' further refines the usrmerge symlink handling.

  • Likely Fixed By: canonical/rockcraft#211 (confidence 70%)

    PR #211 'oci: fix handling of symlink subdirs' specifically fixes symlink subdirectory handling.

  • Likely Fixed By: canonical/rockcraft#417 (confidence 65%)

    PR #417 'feat: prune primed files if they exist on the base' addresses the priming of files that conflict with base filesystem structure.

  • Likely Fixed By: canonical/rockcraft#498 (confidence 60%)

    PR #498 'fix(lifecycle): remove usrmerge-breaking symlinks' directly addresses removing symlinks that break usrmerge.

Related issues

No related issues found above the similarity threshold.