Yay: [Request] Detect incompatible PKGBUILD arch and offer to patch it automatically

Created on 28 Feb 2018  Â·  12Comments  Â·  Source: Jguer/yay

There is a huge issue with tons of PKGBUILDs from AUR: their maintainer only tested them on x86 platforms and hardcoded arch=(i686 x86_64) (kudos for not doing that in yay ­— yay 😂), though they build and run just fine on ARM.

This can be a pain when you end up building a lot of stuff from AUR and need to edit every PKGBUILD manually. While this is an issue that should be solved by the maintainers (of course!), it would be very useful if yay detected this condition and offered to do it automatically (maybe as a [y/N] question as it's for "advanced" users only — people shouldn't blame yay for breaking stuff when it's their fault and responsibility).

What do you think?

Enhancement

All 12 comments

We're in code freeze right now, trying to focus on the existing issues and bugs so I've been trying not to add new features for the time being. I do have a bunch of things I want to add though. One being a way to pass flags to makepkg. Probably --mflags or something.

With that you could do yay -S package --mflags --ignorearch. How would that work as a solution?

I din't know of that flag, but that would work.
I still think the arch incompatibility should be detected and the user warned/asked if they want to pass --ignorearch.

This is super-low priority anyway :)

I could see this being relatively easy to implement and useful. I'll see about adding it when we get back to new features.

Go's good support of multiple architectures was one of the reasons why I chose it. Still I would like to start offering yay-bin for ARM as well since the go compiler does that some space even if it's only a makedep.

More on topic, this seems relatively easy to implement and I think it can be added after the feature freeze and project documentation update is over.

Currently make release puts everything into one tarball. Maybe have them all as separate files that way the pkgbuild can source everything separately.

Then we can have something like:

source=(bash zsh fish manpage)
source_x86_64=(yay_x86_64)
source_arm=(yay_arm)

Obviously it would source from the GitHub release page. Also while we're on the topic of pkgbuilds I think we should change our pkgbuild to call make from the build() function.

yes, I updated the makefile so we can use it in the PKGBUILD

@Depaulicious mflags were just added to the git version. Detecting incompatible archs is still a planned feature but for now the aforementioned yay -S package --mflags --ignorearch Should work. Feel free to test it out.

Awesome! Is there a way to set default mflags?

Add --save or edit the config file manually. See the manpage or --help

@Depau just merged a PR that should do this. Gives a y/n like you'd expect when it detects incompatible pkgbuilds. It wont patch the pkgbuild for you though, instead it will pass --ignorearch to makepkg during the install.

Patching the PKGBUILD seems a bit out of scope either way, --ignorearch should be enough

Great! I'll try it as soon as I buy another single-board ARM computer (I fried my old one)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

captn3m0 picture captn3m0  Â·  4Comments

bazeeel picture bazeeel  Â·  4Comments

ricochet1k picture ricochet1k  Â·  4Comments

x70b1 picture x70b1  Â·  4Comments

torvic9 picture torvic9  Â·  4Comments