yay icon indicating copy to clipboard operation
yay copied to clipboard

makedepends should be installed before fetching the sources for packages that have VCS sources

Open irminsul opened this issue 1 year ago • 1 comments

Affected Version

yay v12.1.0 - libalpm v13.0.2

Describe the bug

Packages that require their own makedepends to fetch their sources may fail to install because yay attempts to fetch the sources before syncing the make deps.

Reproduction Steps

  1. Have a clean Arch installation with a minimal set of packages present.
  2. Try to install a package such as tff-mac-fonts with yay.
    • This package requires subversion (which is properly declared in makedepends)
  3. Yay fails to fetch the sources due to the svn command being unavailable.
  4. Yay installs the makedepends (better later than never I guess).
  5. Package installation fails because $srcdir is empty.

Expected behaviour

Yay should detect when a package uses any of the supported version control systems and install the makedepends first in such cases.

This of course relies on proper makedepends declarations in the PKGBUILDs. Given the limited number (5) of supported VCSs, yay could even detect the required VCSs itself and automatically pull in the respective packages as make dependencies.

Output

$ yay -S --noconfirm ttf-mac-fonts                                                                                                                                                                          master [2974080] modified untracked
AUR Explicit (1): ttf-mac-fonts-20100901.134-1
Sync Make Dependency (1): subversion-1.14.2-8
:: (1/1) Downloaded PKGBUILD: ttf-mac-fonts
  1 ttf-mac-fonts                    (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
  1 ttf-mac-fonts                    (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
==> Making package: ttf-mac-fonts 20100901.134-1 (Mo 03 Jul 2023 19:16:08 CEST)
==> Retrieving sources...
  -> Cloning ttf-mac-fonts svn repo...
/usr/share/makepkg/source/svn.sh: line 71: svn: command not found
==> ERROR: Failure while downloading ttf-mac-fonts svn repo
    Aborting...
 -> error downloading sources: /tmp/aurbuilder/.cache/yay/ttf-mac-fonts
         context: exit status 1


:: (1/1) Parsing SRCINFO: ttf-mac-fonts
resolving dependencies...
looking for conflicting packages...

Packages (1) subversion-1.14.2-8

Total Installed Size:  36,62 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                                                   [########################################################################################] 100%
(1/1) checking package integrity                                                                                                                 [########################################################################################] 100%
(1/1) loading package files                                                                                                                      [########################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                [########################################################################################] 100%
(1/1) checking available disk space                                                                                                              [########################################################################################] 100%
:: Running pre-transaction hooks...
(1/1) etckeeper: pre-transaction commit
:: Processing package changes...
(1/1) installing subversion                                                                                                                      [########################################################################################] 100%
Optional dependencies for subversion
    libsecret: for GNOME Keyring for auth credentials [installed]
    kwallet: for KWallet for auth credentials
    bash-completion: for svn bash completion
    python: for some hook scripts [installed]
    java-environment: for Java support [installed]
    ruby: for some hook scripts [installed]
:: Running post-transaction hooks...
(1/5) Reloading system manager configuration...
(2/5) Creating temporary files...
(3/5) Arming ConditionNeedsUpdate...
(4/5) Warn about old perl modules
(5/5) etckeeper: post-transaction commit
[master 3ba6522] committing changes in /etc made by "sudo pacman -S --noconfirm --config /etc/pacman.conf -- extra/subversion"
 Author: aurbuilder <aurbuilder@Laptop-mz>
 3 files changed, 18 insertions(+)
 create mode 100644 conf.d/svnserve
 create mode 100644 xinetd.d/svn
==> Making package: ttf-mac-fonts 20100901.134-1 (Mo 03 Jul 2023 19:16:10 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating ttf-mac-fonts svn repo...
Skipped '.'
svn: E155007: None of the targets are working copies
==> WARNING: Failure while updating ttf-mac-fonts svn repo
  -> Downloading SafariWindows.pdf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 71987  100 71987    0     0   265k      0 --:--:-- --:--:-- --:--:--  265k
==> Validating source files with sha256sums...
    ttf-mac-fonts ... Skipped
    SafariWindows.pdf ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of  svn repo...
==> Starting pkgver()...
svn: E155007: '/tmp/aurbuilder/.cache/yay/ttf-mac-fonts/src/ttf-mac-fonts' is not a working copy
==> Updated version: ttf-mac-fonts .-1
==> Sources are ready.
==> Making package: ttf-mac-fonts .-1 (Mo 03 Jul 2023 19:16:13 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
svn: E155007: '/tmp/aurbuilder/.cache/yay/ttf-mac-fonts/src/ttf-mac-fonts' is not a working copy
==> Entering fakeroot environment...
==> Starting package()...
install: cannot stat 'gbk/*.ttf': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...
 -> error making: ttf-mac-fonts-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
ttf-mac-fonts - exit status 4

irminsul avatar Jul 03 '23 17:07 irminsul

This one is not so easy to solve as yay sometimes needs the sources to be able to compute things such as signing keys and updated version

Jguer avatar Jul 13 '23 07:07 Jguer