Yay: ignore errors and continue to build more packages

Created on 29 Dec 2018  路  6Comments  路  Source: Jguer/yay

Priority

super low

Affected Version

yay v9.0.1 - libalpm v11.0.1

Issue

when i want to install many packages, but do not need all packages,
i want yay to ignore build errors, and continue to build the next package.

sample:

yay -S $(
  LANG=C \
  yay -Ss gtk-theme- \
  | grep -v '^    ' | grep -v '(Installed)$' \
  | cut -d' ' -f1 | cut -d/ -f2 | sort -u | grep -v -- '-git$'
) 

some packages fail to build, cos i must manually download source files,
so now i have to either ...

... exclude failing packages with

  | grep -v -e gtk-theme-+1 -e gtk-theme-absolute

... or, call yay in a loop

# install all the themes

for p in $(
  LANG=C \
  yay -Ss gtk-theme- \
  | grep -v '^    ' | grep -v '(Installed)$' \
  | cut -d' ' -f1 | cut -d/ -f2 | sort -u | grep -v -- '-git$'
) 
do
  yay --answerdiff None --answerclean All -S $p \
  || echo failed to build $p | tee -a yay.log
done

though no one will need this, 'install by glob pattern' would be nice

# proposition

yay --glob -S 'gtk-theme-*'

... but maybe there is someone with too much time : D

Approved Enhancement help wanted

Most helpful comment

How about a naive implementation for now, which simply restarts the entire process and ignores any program which failed in the previous iteration. This is basically what we do manually, but I don't want to have to do it manually. I could maybe do this in a script, but if the optimal solution (pruning the dependency tree/graph on failure) is hard, then why don't we start with the most naive solution and iteratively improve the runtime performance?

I think many people would be happy with that compromise. In the meantime, I'm going to write a script to do the same, but I won't like it.

EDIT:
Well it turns out it was easier than I expected: https://gist.github.com/norcalli/6b564e93e36ad37240067a479c7356eb

All 6 comments

On the ignore errors there's been similar requests and I'm tempted to change it, I would still like it to identify if it was a dependency of a certain package and cancel that whole tree but that may be too ambitious.

About the globing, I'll see if there's a straightforward way of implementing it, behind an option is a good idea to avoid it being used casually, I think it's a use at your own risk option

Off topic but -Ssq and --needed would greatly simplify whatever you're trying to do here.

Today there was 5 packages to update: brave-bin, chromedriver, postman-bin, webstorm and webstorm-jre. I did:
$ yay -Suy and then yay canceled the whole building process because of this error:

==> ERROR: One or more files did not pass the validity check!
Error downloading sources: webstorm (webstorm webstorm-jre)

I had to update the first 3 packages separately. It doesn't make sense to me that the building process is canceled because some packages (without dependencies) are failing.

I'd say the probably on this should be medium. Anyone with a lot of AUR packages installed will find it pretty impractical to do a bulk update with yay -Syu --aur, with the way it's set up right now.

How about a naive implementation for now, which simply restarts the entire process and ignores any program which failed in the previous iteration. This is basically what we do manually, but I don't want to have to do it manually. I could maybe do this in a script, but if the optimal solution (pruning the dependency tree/graph on failure) is hard, then why don't we start with the most naive solution and iteratively improve the runtime performance?

I think many people would be happy with that compromise. In the meantime, I'm going to write a script to do the same, but I won't like it.

EDIT:
Well it turns out it was easier than I expected: https://gist.github.com/norcalli/6b564e93e36ad37240067a479c7356eb

Related:

  • Install as many packages as possible #1247
  • Suggestion: have a way to continue interrupted AUR installs/builds. #1199
Was this page helpful?
0 / 5 - 0 ratings