Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces of symlinks does not appear to work #1543

Open
xnox opened this issue Feb 26, 2025 · 1 comment
Open

Replaces of symlinks does not appear to work #1543

xnox opened this issue Feb 26, 2025 · 1 comment
Labels
bug Something isn't working eng:containers p2 This issue we intend to address but we have can live without it (fixed in months/quarters) papercut Identified as a small, easily fixable issue

Comments

@xnox
Copy link
Contributor

xnox commented Feb 26, 2025

with the modified wolfi-base as shown in https://github.com/wolfi-dev/os/pull/43832/files , which has two subpackages, that both ship the same symlink, to different destinations and with replaces declared of one another, one can install them with apk tools, but not with apko:

$ make package/wolfi-base
$ make local-wolfi

# apk add package-with-symlink
(1/1) Installing package-with-symlink (1-r8)
OK: 14 MiB in 16 packages
# readlink /etc/some.conf 
../run/target1.conf

# apk add package-with-symlink-replaces
(1/1) Installing package-with-symlink-replaces (1-r8)
OK: 14 MiB in 17 packages
# readlink /etc/some.conf 
../run/target2.conf
# exit



$ make test/wolfi-base
Testing package wolfi-base with version wolfi-base-1-r8 from file wolfi-base.yaml
/home/xnox/go/bin/melange test wolfi-base.yaml --repository-append /home/xnox/wolfi-dev/os/packages --keyring-append local-melange.rsa.pub --arch x86_64 --pipeline-dirs ./pipelines/ --repository-append https://packages.wolfi.dev/os --keyring-append https://packages.wolfi.dev/os/wolfi-signing.rsa.pub --test-package-append wolfi-base --debug  --source-dir ./wolfi-base/
2025/02/26 11:31:22 INFO building test workspace in: '/tmp/melange-guest-815115064-main' with apko
2025/02/26 11:31:22 [DEBUG] GET https://packages.wolfi.dev/os/apk-configuration
2025/02/26 11:31:22 INFO setting apk repositories: [/home/xnox/wolfi-dev/os/packages https://packages.wolfi.dev/os]
2025/02/26 11:31:22 INFO image configuration:
2025/02/26 11:31:22 INFO   contents:
2025/02/26 11:31:22 INFO     build repositories: []
2025/02/26 11:31:22 INFO     runtime repositories: []
2025/02/26 11:31:22 INFO     keyring:      []
2025/02/26 11:31:22 INFO     packages:     [package-with-symlink-replaces wolfi-base]
2025/02/26 11:31:22 INFO installing package-with-symlink (1-r8)
2025/02/26 11:31:22 INFO installing package-with-symlink-replaces (1-r8)
2025/02/26 11:31:22 INFO ERROR: failed to test package. the test environment has been preserved:
2025/02/26 11:31:22 INFO   workspace dir: /tmp/melange-workspace-2334097068
2025/02/26 11:31:22 INFO   guest dir: /tmp/melange-guest-815115064
2025/02/26 11:31:22 ERRO failed to test package: unable to build guest: unable to generate image: installing apk packages: installing packages: installing package-with-symlink-replaces (ver:1-r8 arch:x86_64): unable to install files for pkg package-with-symlink-replaces: unable to install symlink from etc/some.conf -> ../run/target2.conf: symlink ../run/target2.conf /tmp/melange-guest-815115064-main/etc/some.conf: file exists
make: *** [Makefile:115: test/wolfi-base] Error 1

Why is replaces not being honored by apko for symlinks, when apk-tools does?
Note that replaces is honored by apko for regular files.

@xnox xnox added bug Something isn't working p2 This issue we intend to address but we have can live without it (fixed in months/quarters) eng:containers papercut Identified as a small, easily fixable issue labels Feb 26, 2025
@xnox
Copy link
Contributor Author

xnox commented Feb 27, 2025

we should figure out what the replaces semantics should actually be

I guess we should check what happens with:

  • directories
  • regular files
  • device nodes files
  • symlinks
  • hardlinks
  • broken symlinks
  • symlinks to directories
  • directory to symlink replaces
  • symlink to directory replaces
  • etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working eng:containers p2 This issue we intend to address but we have can live without it (fixed in months/quarters) papercut Identified as a small, easily fixable issue
Projects
None yet
Development

No branches or pull requests

1 participant