Add AUR helper installation support#4547
Closed
pentago wants to merge 1 commit into
Closed
Conversation
Adds an "Enable AUR" entry to the global menu allowing the user to choose between paru and yay. The selected helper is built from source inside the chroot, running as the first sudo user under a temporary NOPASSWD-pacman sudoers entry that is removed in a finally block. Source builds avoid the libalpm soname mismatch that can occur with prebuilt -bin packages. The feature gracefully no-ops when no AUR helper is configured. The menu item is gated behind the presence of a regular user account; attempting --silent installs without one raises RequirementError. Signed-off-by: pentago <876756+pentago@users.noreply.github.com>
Collaborator
|
As you pointed out rightfully the consensus was to not have any AUR support. This was decided by Arch as a public stance https://github.com/archlinux/archinstall#aur and there is no revisiting the decision at this point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Acknowledgement before review
I am aware of the project's current stance, codified in the README under FAQ → AUR (added in #4468), pointing at the arch-dev-public mailing-list consensus. I have read that thread, #4447, and #4468 in full.
I am not opening this PR to relitigate the consensus. I am opening it because:
-bin;TMPDIRredirect required because chroot/tmphas no tmpfs).I am explicitly not asking for special treatment, a poll re-run, or a maintainer-vs-consensus override. Close at will; the implementation will remain on my fork either way.
What this changes
AURConfigurationmodel that serializes alongside the rest of the config toaur_config.helper_config.helper, fully round-tripping through--config/--silentinstalls.AURHandlerthat runs afterinstall_applicationsand beforeinstall_profile_config, installing the helper as the first sudo user (or first user) from source.How it works
-binvariants, so the resulting binary links against the chroot's actual libalpm rather than a soname snapshot. This avoidslibalpm.so.X: cannot open shared object fileafter first boot./etc/sudoers.d/99_aur_buildgrants the build userNOPASSWD: /usr/bin/pacmanfor the duration ofmakepkg -si. The file is removed in afinallyblock, so a failed build never leaves a passwordless-pacman entry on the installed system.$HOME/.cache/aur-build/<helper>andTMPDIRis redirected to$HOME/.cache/aur-build/tmp, becausearch-chroot -Sruns the build under a systemd-run unit and the chroot's/tmpkeeps its on-disk perms (0755, root-owned) since no boot-time tmpfs mount has happened. Without theTMPDIRredirect, build tools that default to/tmp(e.g. Go foryay) fail withpermission denied.--silentinstalls without a regular user raiseRequirementErrorrather than failing silently.Differences vs. #4447
try/finallyaround the entiremakepkg -siinvocation; sudoers file is removed on any exit patharch-chroot -u <user>andshlex-quoted in the sudoers contentmulti-user.target.wants/symlinkusers[0]gets the helper silently--advancedgatingbase-devel,go, andrustare installed via--asdeps, so they are eligible forpacman -Rs $(pacman -Qdtq)post-install. They are not explicitly removed by this PR to keep the diff minimal.Scope
This PR does not:
pacman.conf, multilib, or any third-party repository.--configJSON).Testing
Static (all green on the patched files):
ruff check+ruff format --checkmypy(strict mode, 8 files)pylint,flake8(per CONTRIBUTING.md)msgfmt -conbase.potpytest tests/— 27/27, including a newtest_aur_config_roundtripthat exercises the full JSON--configparse/serialize pathpre-commit run -acleanEnd-to-end on a QEMU VM (both helpers, separately):
/dev/vda, regular sudo user.paru --version(paru 2.1.0) andyay --version(yay 12.5.7) run.pacman -Qi paru/pacman -Qi yayconfirm installation./etc/sudoers.d/99_aur_buildis absent post-install (thefinally-block cleanup ran).Diff: 12 files (6 new, 6 modified). No pre-existing logic changed.
Tests and Checks