Open gytis-ivaskevicius opened 2 months ago
I've run into a similar issue where I've coreutils as one layer and tzdata
as another.
This isn't an issue if I add both packages to a single layer.
> The file '/bin' already exists in the graph with mode 'Lrwxrwxrwx' from '/nix/store/8kznh5nc5lmsqmkqlfkwsvd6ianwap2a-runtimeenv/bin' while it is added again with mode 'dr-xr-xr-x' by '/nix/store/7g55zq3h09rg244d343ljxijpi6hz6xb-devenv/bin'
Looks like this is where we're running into it. https://github.com/nlewo/nix2container/blob/master/nix/graph.go#L85
Happy to help fix this issue if we can decide on what the fix should be..
One way I can think of is to compute the nar hash of the directories/files. If they're the same, pick one with higher permissions. If they're different and it is a directory,
If you'd like I could create a minimal example of this issue
Yes, that would be great!
(I don't exactly understand which situations lead to this issue and an example could help me.)
When multiple derivations create the same directory and
maxLayers=1
this error is thrown:If I set
maxLayers=128
- its all good. It would be really nice to improve layers merging logic, if permissions are in fact different (I am not sure if that is the case) - set higher perms. And if file/dir and perms are identical - just keep one of them, ignore the errorIf you'd like I could create a minimal example of this issue