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

allow multiple slices with the same content paths to co-exist within the same Chisel release #50

Open
cjdcordeiro opened this issue Feb 7, 2023 · 7 comments

Comments

@cjdcordeiro
Copy link
Collaborator

Diffs between dotnet-host-7.0 and dotnet-host SDFs

package: dotnet-host-7.0                                      | package: dotnet-host
slices:                                                         slices:
  bins:                                                           bins:
    essential:                                                      essential:
      - libc6_libs                                                    - libc6_libs
      - libgcc-s1_libs                                                - libgcc-s1_libs
      - libstdc++6_libs                                               - libstdc++6_libs
    contents:                                                       contents:
      /usr/lib/dotnet/dotnet:                                         /usr/lib/dotnet/dotnet:

Problem

By design, Chisel is currently looking at the entire Chisel release to catch any conflicts [1]. The reason why it was designed this way was to cope with people doing /usr/lib/* in their slices, thus avoiding the produced outputs from growing unbounded as fat packages change.

In practice, this means that even if we’re just installing .NET7, Chisel will still complain about conflicts with .NET6, even though it is not targeted. And that’s because dotnet-host-7.0 and dotnet-host both have the same content path.

Reproduce

Copy the two SDFs from above, into an existing chisel-release (tested with kinetic), as slices/dotnet-host-7.0.yaml and slices/dotnet-host.yaml, respectively.

Then run

$ chisel cut --release ./ --root rootfs base-files_base

And you’ll get

2023/02/03 12:36:33 Processing ./ release...
error: slices dotnet-host_bins and dotnet-host-7.0_bins conflict on /usr/lib/dotnet/dotnet

Chisel version: https://github.com/canonical/chisel/tree/bd27f8700cd7d2a6b4e0df6b10c3761c83a70485

Refs

[1] https://github.com/canonical/chisel/blob/main/internal/setup/setup.go#L154

@kholia
Copy link

kholia commented Jul 13, 2023

I was running into a similar problem when generating slices for python3 stuff.

I came up with the following dirty hack to workaround this issue:

diff --git a/internal/setup/setup.go b/internal/setup/setup.go
index c47c050..a1a00ff 100644
--- a/internal/setup/setup.go
+++ b/internal/setup/setup.go
@@ -179,7 +179,8 @@ func (r *Release) validate() error {
                                if old.Package > new.Package || old.Package == new.Package && old.Name > new.Name {
                                        old, oldPath, new, newPath = new, newPath, old, oldPath
                                }
-                               return fmt.Errorf("slices %s and %s conflict on %s and %s", old, new, oldPath, newPath)
+                               // return fmt.Errorf("slices %s and %s conflict on %s and %s", old, new, oldPath, newPath)
+                               return nil
                        }
                }
                paths[newPath] = new

@cjdcordeiro
Copy link
Collaborator Author

what were the conflicting paths in your case @kholia ?

@kholia
Copy link

kholia commented Jul 13, 2023

@kholia
Copy link

kholia commented Jul 13, 2023

My Python slices are quite hacky at the moment - I just wanted to do a quick PoC in the shortest amount of time.

With these hacky slices, and the patched chisel tool, I was able to get a python3 slice going just fine.

@cjdcordeiro
Copy link
Collaborator Author

Cool. Glad you were able to work around it @kholia .

Btw, we'll probably have, in a couple of days, python3.8 for Focal -> canonical/chisel-releases#44

@endersonmaia
Copy link

Just for the record, I just hit this issue with busybox and busybox-static.

@cjdcordeiro
Copy link
Collaborator Author

Noted @endersonmaia . Thanks for the heads up. This is in our roadmap and we'll definitely tackle it soon.

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

3 participants