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

Paths from slice dependency are not preserved (symlink vs directory) #3

Open
woky opened this issue Jun 2, 2022 · 0 comments
Open

Comments

@woky
Copy link
Contributor

woky commented Jun 2, 2022

[NOTE: I'm telling chisel to create /lib symlink because base-files contains it not as a symlink but as a directory and dotnet package needs that to be a symlink because the dotnet executable links to /lib/x86_64-linux-gnu/libstdc++.so.6 but libstdc++6 package installs it in /usr/lib/x86_64-linux-gnu/libstdc++.so.6. On Ubuntu usrmerge package does the job in postinst but we don't have that so that's why I'm creating the symlink manually. (To make dotnet work.)]

When a slice lists a path entry as a symlink to directory and some other slice depends on it and installs its files into symlink, the symlink is not preserved but instead a directory is created at that path. Example:

Configuration:

$ tail release/slices/*
==> release/slices/base-files.yaml <==
package: base-files
slices:
  lib:
    contents:
      /lib: { symlink: /usr/lib }
      /usr/lib/:

==> release/slices/libc6.yaml <==
package: libc6
slices:
  libs:
    essential:
      - base-files_lib
    contents:
      /lib/x86_64-linux-gnu/libc.so.6:

In this snippet you can see that /lib is not a symlink even though libc6_libs depends on base-files_lib which should create it.

$ rm -rf output && mkdir output
$ chisel cut --release release/ --root output/ base-files_lib libc6_libs
...
2022/06/02 10:39:14 Extracting files from package "base-files"...
2022/06/02 10:39:14 Extracting files from package "libc6"...
$ tree --noreport output/
output/
├── lib
│   └── x86_64-linux-gnu
│       └── libc.so.6
└── usr
    └── lib

In this snippet you can see that /lib is created as symlink when no other slice installing files at that path is being installed. But afterwards it fails to install because of the symlink:

$ rm -rf output && mkdir output
$ chisel cut --release release/ --root output/ base-files_lib >/dev/null
...
2022/06/02 10:38:46 Extracting files from package "base-files"...
$ tree --noreport output/
output/
├── lib -> /usr/lib
└── usr
    └── lib
$ chisel cut --release release/ --root output/ libc6_libs
...
2022/06/02 10:38:58 Extracting files from package "base-files"...
2022/06/02 10:38:58 Extracting files from package "libc6"...
error: cannot extract files from package "libc6": open output/lib/x86_64-linux-gnu/libc.so.6: permission denied
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

No branches or pull requests

1 participant