Yay: Install error if package provides something different than name

Created on 7 Apr 2020  路  7Comments  路  Source: Jguer/yay

Affected Version




yay v9.4.6 - libalpm v12.0.1

Issue

Yay search packages using name section only, provides section is ignored.

Steps to reproduce

  1. Install pagure-postgresql and pagure

  2. 3.

Output

$ yay -S pagure-postgresql pagure
==> Error: Could not find all required packages:
    pagure-database=5.8.1 (Wanted by: pagure)
    pagure-database=5.8.1 (Wanted by: pagure-postgresql -> pagure)
$ yay -Si pagure-postgresql
:: Querying AUR...
Repository      : aur
Name            : pagure-postgresql
Keywords        : None
Version         : 5.8.1-0.20
Description     : A git-centered forge based on python using pygit2 (PostgreSQL database configuration)
URL             : https://pagure.io/pagure
AUR URL         : https://aur.archlinux.org/packages/pagure-postgresql
Groups          : None
Licenses        : GPL2
Provides        : pagure-database
Depends On      : pagure=5.8.1  postgresql  python-psycopg2
Make Deps       : python-setuptools
Check Deps      : python-tox
Optional Deps   : clamav
Conflicts With  : pagure-mariadb  pagure-sqlite
Maintainer      : caleb
Votes           : 0
Popularity      : 0.000000
First Submitted : Fri 28 Feb 2020 07:03:21 AM CET
Last Modified   : Fri 28 Feb 2020 01:38:44 PM CET
Out-of-date     : No

```sh
$ yay -Si paugre
:: Querying AUR...
Repository : aur
Name : pagure
Keywords : None
Version : 5.8.1-0.20
Description : A git-centered forge based on python using pygit2
URL : https://pagure.io/pagure
AUR URL : https://aur.archlinux.org/packages/pagure
Groups : None
Licenses : GPL2
Provides : None
Depends On : pagure-database=5.8.1
Make Deps : python-setuptools
Check Deps : python-tox
Optional Deps : pagure-apache
Conflicts With : None
Maintainer : caleb
Votes : 0
Popularity : 0.000000
First Submitted : Fri 28 Feb 2020 07:03:21 AM CET
Last Modified : Fri 28 Feb 2020 01:38:44 PM CET
Out-of-date : No


<!-- Include the FULL output -->
<!-- Include any relevant commands/configs -->
<!-- The current yay config can be printed with `yay -Pg` -->
<!-- Use code blocks -->
<!-- Paste services are only needed for excessive output (>500 lines) -->
#### Configuration
```sh
$ yay -Pg
{
    "aururl": "https://aur.archlinux.org",
    "buildDir": "/home/eirnym/.cache/yay",
    "absdir": "/home/eirnym/.cache/yay/abs",
    "editor": "",
    "editorflags": "",
    "makepkgbin": "makepkg",
    "makepkgconf": "",
    "pacmanbin": "pacman",
    "pacmanconf": "/etc/pacman.conf",
    "redownload": "no",
    "rebuild": "no",
    "batchinstall": false,
    "answerclean": "All",
    "answerdiff": "None",
    "answeredit": "",
    "answerupgrade": "",
    "gitbin": "git",
    "gpgbin": "gpg",
    "gpgflags": "",
    "mflags": "",
    "sortby": "votes",
    "searchby": "name-desc",
    "gitflags": "",
    "removemake": "yes",
    "sudobin": "sudo",
    "sudoflags": "",
    "requestsplitn": 150,
    "sortmode": 0,
    "completionrefreshtime": 7,
    "sudoloop": false,
    "timeupdate": false,
    "devel": true,
    "cleanAfter": true,
    "provides": true,
    "pgpfetch": true,
    "upgrademenu": true,
    "cleanmenu": false,
    "diffmenu": false,
    "editmenu": false,
    "combinedupgrade": true,
    "useask": false
}
Confirmed Bug

Most helpful comment

@bartoszek yay does not use Info instead of SearchBy for {make,}depends

https://github.com/Jguer/yay/blob/7979279c3f3c92ca1858ea5a5871c9386f70957e/pkg/dep/depPool.go#L171

The dep pool does uses Search to create the candidates and Info is used later on them to get provide information. You can see this in action if you try to install any of the ispc packages in your example.

Thank for pinging this issue though as I have fixed this specific issue here 7979279c3f3c92ca1858ea5a5871c9386f70957e .

For more information what really caused this:

  • Pagure provides are set to pagure-database but the dep string was set to pagure-database=5.1.0.
  • In previous versions we would refuse to check a versioned dep against an unversioned provide
  • This has been changed to append the version of the provide package to the provide if checking against a versioned rep

@eirnym sorry it has taken me a while to get to this issue

All 7 comments

This is due to yay using rpc.Info instead rpc.SearchBy to resolve {make,}depends:
https://github.com/Jguer/yay/blob/678d10e04e39b6718030db07239773bdac340e72/pkg/query/aur_info.go#L19-L28
rpc.Info utilize aur/rcp?type=info&pkg[]=$pkg_name which is fine when $pkg_name match exactly but wont work if we have e.g pkg_name=ispc but actual package name is ispc-bin.
https://github.com/mikkeloscar/aur/blob/1cb4e2949656c16a33d58abb0294fbde5caf388b/aur.go#L152-L159
Yay should use rpc.SearchBy to resolve everything same as aurutils is currently doing.
There shouldn't be too much of a hassle resolving dependencies like ispc>=1.14 with call to rpc?type=search
```sh
curl -s 'https://aur.archlinux.org/rpc/?v=5&type=search&arg=ispc'|jq -r '.results[]|.Name'|sed 's/^/\&arg[]=/g'|tr -d '\n'|(curl -s "https://aur.archlinux.org/rpc/?v=5&type=info$(cat)")|jq -r '.results[]|{name: .Provides[], version: .Version, providedBy: .Name}'
{
"name": "ispc",
"version": "1.14.1-1",
"providedBy": "ispc-bin"
}
{
"name": "ispc",
"version": "1.14.1.r15.gc4529a3c-1",
"providedBy": "ispc-git"
}
{
"name": "ispc_texcomp",
"version": "r17.d38d5ac-1",
"providedBy": "ispc_texcomp-git"
}

@bartoszek yay does not use Info instead of SearchBy for {make,}depends

https://github.com/Jguer/yay/blob/7979279c3f3c92ca1858ea5a5871c9386f70957e/pkg/dep/depPool.go#L171

The dep pool does uses Search to create the candidates and Info is used later on them to get provide information. You can see this in action if you try to install any of the ispc packages in your example.

Thank for pinging this issue though as I have fixed this specific issue here 7979279c3f3c92ca1858ea5a5871c9386f70957e .

For more information what really caused this:

  • Pagure provides are set to pagure-database but the dep string was set to pagure-database=5.1.0.
  • In previous versions we would refuse to check a versioned dep against an unversioned provide
  • This has been changed to append the version of the provide package to the provide if checking against a versioned rep

@eirnym sorry it has taken me a while to get to this issue

Thank you, also to @bartoszek for helping me.

Current yay from yay-git (branch: next) still doesn't work at least with these candidates:

LANG=C yay -Qi ispc

Name            : ispc-git
Version         : 1.14.1.r15.gc4529a3c-1
yay -S openimagedenoise-git
 -> Could not find all required packages:
        ispc>=1.14 (Wanted by: openimagedenoise-git)

Does yay rely on makepkg or pacman? Because makepkg also fails in this task:

as@station2:/home/as/.cache/yay/openimagedenoise-git$ LANG=C makepkg -si
==> Making package: openimagedenoise-git 1.2.3.r0.ga9e9160-1 (Tue Oct  6 11:09:42 2020)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
error: target not found: ispc>=1.14
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> ispc>=1.14
==> ERROR: Could not resolve all dependencies.

I believe provides is off by default.

openimagedenoise-git

I found another issue on how yay collects candidates which should allow ispc to be discovered while installing openimagedenoise-git but this package suffers from other issues that make it uninstallable:

  • depending on provide ispc>=1.14 but ispc-bin only provides ispc.

alpm_find_dbs_satisfierseems to not check the version of the package that provides ispc (and probably rightfully so, you can provide an unversioned dep that's not tied your package version). ispc-bin should provide ispc=1.14.1 in this case for this to work.
This make it not installable via yay or makepkg. Summary: provides ispc and pkgver=1.14.1 and requires ispc>=1.14.1 do not match according to pacman

  • replacing makepkg midway. Since makepkg gets replaced midway, from a clean install where yay splits downloading and installing, makepkg-git-lfs-proto will not be available by the time yay tries to download openimagedenoise-git.

I've fixed the issues with the AUR dep finding in f6cb0bc4603cac536aa7ecf3fb8674e95239dbeb but this package will remain uninstallable while these issues stand

yay works in this case now. Thank you!

And I'm ok with yay working better than makepkg :-)

openimagedenoise-git

I found another issue on how yay collects candidates which should allow ispc to be discovered while installing openimagedenoise-git but this package suffers from other issues that make it uninstallable:

  • depending on provide ispc>=1.14 but ispc-bin only provides ispc.

alpm_find_dbs_satisfierseems to not check the version of the package that provides ispc (and probably rightfully so, you can provide an unversioned dep that's not tied your package version). ispc-bin should provide ispc=1.14.1 in this case for this to work.
This make it not installable via yay or makepkg. Summary: provides ispc and pkgver=1.14.1 and requires ispc>=1.14.1 do not match according to pacman

  • replacing makepkg midway. Since makepkg gets replaced midway, from a clean install where yay splits downloading and installing, makepkg-git-lfs-proto will not be available by the time yay tries to download openimagedenoise-git.

I've fixed the issues with the AUR dep finding in f6cb0bc but this package will remain uninstallable while these issues stand

Yep. It's one subtlety not a lot of people think about. Yay is aware of it though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tapir picture tapir  路  3Comments

parkerlreed picture parkerlreed  路  3Comments

ixevix picture ixevix  路  3Comments

muesli picture muesli  路  4Comments

pantuts picture pantuts  路  3Comments