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

Dependency resolution doesn't take into account the 'Provides' #66

Open
inglor opened this issue May 27, 2021 · 2 comments
Open

Dependency resolution doesn't take into account the 'Provides' #66

inglor opened this issue May 27, 2021 · 2 comments
Assignees
Labels
enhancement this could improve the capabilities/design of the program

Comments

@inglor
Copy link

inglor commented May 27, 2021

Some packages provide "virtual" packages which repoctl doesn't take into account when resolving dependencies:

$ repoctl down -r linux-ck
Warning: unknown package initramfs
         Required by: linux-ck
Downloading: linux-ck
$ pacman -Qi mkinitcpio
Name            : mkinitcpio
Version         : 30-1
Description     : Modular initramfs image creation utility
Architecture    : any
URL             : https://projects.archlinux.org/mkinitcpio.git/
Licenses        : GPL
Groups          : None
Provides        : initramfs
Depends On      : awk  mkinitcpio-busybox>=1.19.4-2  kmod  util-linux>=2.23  libarchive
                  coreutils  bash  diffutils  findutils  grep  filesystem>=2011.10-1
                  zstd  systemd
Optional Deps   : gzip: Use gzip compression for the initramfs image [installed]
                  xz: Use lzma or xz compression for the initramfs image [installed]
                  bzip2: Use bzip2 compression for the initramfs image [installed]
                  lzop: Use lzo compression for the initramfs image [installed]
                  lz4: Use lz4 compression for the initramfs image [installed]
                  mkinitcpio-nfs-utils: Support for root filesystem on NFS
Required By     : linux  linux-ck  linux-gc  linux-zen
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 102.77 KiB
Packager        : Giancarlo Razzolini <[email protected]>
Build Date      : Wed 17 Feb 2021 02:49:42 GMT
Install Date    : Sun 07 Mar 2021 12:39:00 GMT
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature
@inglor inglor changed the title Support virtual packages for dependency resolution Dependency resolution doesn't take into account the 'Provides' May 27, 2021
@AladW
Copy link

AladW commented Apr 9, 2022

It seems strange that down -r looks at Provides for "required by" in the first place.

@cassava
Copy link
Owner

cassava commented Feb 27, 2023

Hi @inglor thanks for raising the issue. This is a known limitation (to me at least) that I can't seem to find the time to work around.

I don't think down -r is looking at Provides, instead it is looking for a package called initramfs, which is not a real package. Instead there are a bunch of providers for that package.
In the current implementation of repoctl it assumes that all requires are real packages.
But we know that is not the case.

So basically, when repoctl comes across a package that is required but doesn't exist, repoctl should check if there is a package that "provides" this. We can then eliminate the warning, but what should repoctl do at this point? There are going to be multiple providers, and I don't really want to make repoctl ask you interactively which one it should pick.

Here's a possible path forward:

  1. Detect if the required package is virtual, then:
  2. Do not print a warning if a package that is installed already "Provides" this.
  3. Do not print a warning if a package that is to be downloaded already "Provides" this.
  4. Otherwise, print a warning message that package does not exist or is virtual.

@cassava cassava self-assigned this Feb 27, 2023
@cassava cassava added the enhancement this could improve the capabilities/design of the program label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement this could improve the capabilities/design of the program
Projects
None yet
Development

No branches or pull requests

3 participants