Morganamilo / paru

Feature packed AUR helper
GNU General Public License v3.0
6.04k stars 233 forks source link

Make dependencies are installed on host even when building in chroot #831

Closed MithicSpirit closed 2 years ago

MithicSpirit commented 2 years ago

Affected Version

paru v1.11.1.r33.gc7dc09a - libalpm v13.0.1

Description

When installing a package with make dependencies, those packages are installed on the host even when building in a chroot (when they are not necessary). For example, when building yay, which has go as a make dependency, go is still installed on the host system.

Output

yay build Note how `go` is not found before the build, but is found afterwards, even though it is only a make dependency of yay and thus not required anymore (or at all since the build was in a chroot). ``` $ pacman -Qi go error: package 'go' was not found $ paru -S yay :: Resolving dependencies... :: There are 4 providers available for yay: :: Repository AUR: 1) yay 2) yay-bin 3) yay-git 4) yayim Enter a number (default=1): :: Calculating conflicts... :: Calculating inner conflicts... Repo (1) Old Version New Version Make Only community/go 2:1.19-1 Yes Aur (1) Old Version New Version Make Only aur/yay 11.3.0-1 No :: Proceed to review? [Y/n]: :: Downloading PKGBUILDs... (1/1) yay-11.3.0-1 [----------------------------------------------------------------------------------------------------------------------------------------------------------] :: Accept changes? [Y/n]: resolving dependencies... looking for conflicting packages... Package (1) New Version Net Change Download Size community/go 2:1.19-1 434.83 MiB 76.72 MiB Total Download Size: 76.72 MiB Total Installed Size: 434.83 MiB :: Proceed with installation? [Y/n] :: Retrieving packages... go-2:1.19-1-x86_64 76.7 MiB 13.4 MiB/s 00:06 [----------------------------------------------------------------------------] 100% (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% :: Processing package changes... (1/1) installing go [----------------------------------------------------------------------------] 100% :: Running post-transaction hooks... (1/1) Arming ConditionNeedsUpdate... fetching devel info... :: Synchronizing package databases... core is up to date extra is up to date community is up to date multilib is up to date aur 121.3 KiB 59.2 MiB/s 00:00 [----------------------------------------------------------------------------] 100% :: Starting full system upgrade... there is nothing to do ==> Synchronizing chroot copy [/var/lib/aurbuild/x86_64/root] -> [mithic]...done ==> Making package: yay 11.3.0-1 (Wed Aug 17 14:04:00 2022) ==> Retrieving sources... -> Downloading yay-11.3.0.tar.gz... % 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 385k 100 385k 0 0 646k 0 --:--:-- --:--:-- --:--:-- 1426k ==> Validating source files with sha256sums... yay-11.3.0.tar.gz ... Passed ==> Making package: yay 11.3.0-1 (Wed Aug 17 14:04:05 2022) ==> Checking runtime dependencies... ==> Installing missing dependencies... resolving dependencies... looking for conflicting packages... Package (4) New Version Net Change extra/perl-error 0.17029-4 0.04 MiB extra/perl-mailtools 2.21-6 0.11 MiB extra/perl-timedate 2.33-4 0.08 MiB extra/git 2.37.2-1 34.48 MiB Total Installed Size: 34.71 MiB :: Proceed with installation? [Y/n] (4/4) checking keys in keyring [----------------------------------------------------------------------------] 100% (4/4) checking package integrity [----------------------------------------------------------------------------] 100% (4/4) loading package files [----------------------------------------------------------------------------] 100% (4/4) checking for file conflicts [----------------------------------------------------------------------------] 100% (4/4) checking available disk space [----------------------------------------------------------------------------] 100% :: Processing package changes... (1/4) installing perl-error [----------------------------------------------------------------------------] 100% (2/4) installing perl-timedate [----------------------------------------------------------------------------] 100% (3/4) installing perl-mailtools [----------------------------------------------------------------------------] 100% (4/4) installing git [----------------------------------------------------------------------------] 100% Optional dependencies for git tk: gitk and git gui perl-libwww: git svn perl-term-readkey: git svn and interactive.singlekey setting perl-io-socket-ssl: git send-email TLS support perl-authen-sasl: git send-email TLS support perl-mediawiki-api: git mediawiki support perl-datetime-format-iso8601: git mediawiki support perl-lwp-protocol-https: git mediawiki https support perl-cgi: gitweb (web interface) support python: git svn & git p4 subversion: git svn org.freedesktop.secrets: keyring credential helper libsecret: libsecret credential helper [installed] :: Running post-transaction hooks... (1/1) Warn about old perl modules ==> Checking buildtime dependencies... ==> Installing missing dependencies... resolving dependencies... looking for conflicting packages... Package (1) New Version Net Change community/go 2:1.19-1 434.83 MiB Total Installed Size: 434.83 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% :: Processing package changes... (1/1) installing go [----------------------------------------------------------------------------] 100% ==> Retrieving sources... -> Found yay-11.3.0.tar.gz ==> WARNING: Skipping all source file integrity checks. ==> Extracting sources... -> Extracting yay-11.3.0.tar.gz with bsdtar ==> Sources are ready. yay-11.3.0-1: parsing pkg list... ==> Making package: yay 11.3.0-1 (Wed Aug 17 14:04:13 2022) ==> Retrieving sources... -> Found yay-11.3.0.tar.gz ==> Validating source files with sha256sums... yay-11.3.0.tar.gz ... Passed ==> Making package: yay 11.3.0-1 (Wed Aug 17 14:04:18 2022) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> WARNING: Using existing $srcdir/ tree ==> Starting build()... pacman-git go build -trimpath -mod=readonly -modcacherw -ldflags '-X "main.yayVersion=11.3.0" -X "main.localePath=/usr/share/locale/" -linkmode=external' -buildmode=pie -o yay go: downloading github.com/Jguer/aur v1.0.1 go: downloading github.com/Jguer/votar v1.0.0 go: downloading github.com/Jguer/go-alpm/v2 v2.1.2 go: downloading github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 go: downloading github.com/Morganamilo/go-srcinfo v1.0.0 go: downloading golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 go: downloading github.com/leonelquinteros/gotext v1.5.0 go: downloading golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab go: downloading github.com/adrg/strutil v0.3.0 go: downloading golang.org/x/text v0.3.7 ==> Entering fakeroot environment... ==> Starting package()... msgfmt po/de.po -o po/de.mo msgfmt po/en.po -o po/en.mo msgfmt po/es.po -o po/es.mo msgfmt po/eu.po -o po/eu.mo msgfmt po/fr_FR.po -o po/fr_FR.mo msgfmt po/id.po -o po/id.mo msgfmt po/it_IT.po -o po/it_IT.mo msgfmt po/ja.po -o po/ja.mo msgfmt po/ko.po -o po/ko.mo msgfmt po/pl_PL.po -o po/pl_PL.mo msgfmt po/pt.po -o po/pt.mo msgfmt po/pt_BR.po -o po/pt_BR.mo msgfmt po/ru_RU.po -o po/ru_RU.mo msgfmt po/sv.po -o po/sv.mo msgfmt po/tr.po -o po/tr.mo msgfmt po/uk.po -o po/uk.mo msgfmt po/zh_CN.po -o po/zh_CN.mo msgfmt po/zh_TW.po -o po/zh_TW.mo install -Dm755 yay /build/yay/pkg/yay/usr/bin/yay install -Dm644 doc/yay.8 /build/yay/pkg/yay/usr/share/man/man8/yay.8 install -Dm644 completions/bash /build/yay/pkg/yay/usr/share/bash-completion/completions/yay install -Dm644 completions/zsh /build/yay/pkg/yay/usr/share/zsh/site-functions/_yay install -Dm644 completions/fish /build/yay/pkg/yay/usr/share/fish/vendor_completions.d/yay.fish for lang in de en es eu fr_FR id it_IT ja ko pl_PL pt pt_BR ru_RU sv tr uk zh_CN zh_TW; do \ install -Dm644 po/${lang}.mo /build/yay/pkg/yay/usr/share/locale/$lang/LC_MESSAGES/yay.mo; \ done ==> Tidying install... -> Removing libtool files... -> Purging unwanted files... -> Removing static library files... -> Stripping unneeded symbols from binaries and libraries... -> Compressing man and info pages... ==> Checking for packaging issues... ==> Creating package "yay"... -> Generating .PKGINFO file... -> Generating .BUILDINFO file... -> Generating .MTREE file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: yay 11.3.0-1 (Wed Aug 17 14:04:34 2022) :: Signing packages... ==> Extracting aur.db.tar.gz to a temporary location... ==> Extracting aur.files.tar.gz to a temporary location... ==> Adding package '/var/lib/repo/aur/yay-11.3.0-1-x86_64.pkg.tar.zst' -> Adding package signature... -> Computing checksums... -> Creating 'desc' db entry... -> Creating 'files' db entry... -> Removing old package file '' ==> Creating updated database file '/var/lib/repo/aur/aur.db.tar.gz' ==> Signing database 'aur.db.tar.gz'... -> Created signature file 'aur.db.tar.gz.sig' ==> Signing database 'aur.files.tar.gz'... -> Created signature file 'aur.files.tar.gz.sig' :: syncing local databases... syncing aur.db... syncing aur.db.sig... resolving dependencies... looking for conflicting packages... Package (1) New Version Net Change Download Size aur/yay 11.3.0-1 7.28 MiB 2.92 MiB Total Download Size: 2.92 MiB Total Installed Size: 7.28 MiB :: Proceed with installation? [Y/n] :: Retrieving packages... yay-11.3.0-1-x86_64 2.9 MiB 1461 MiB/s 00:00 [----------------------------------------------------------------------------] 100% (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% :: Processing package changes... (1/1) installing yay [----------------------------------------------------------------------------] 100% Optional dependencies for yay sudo: privilege elevation [installed] doas: privilege elevation :: Running post-transaction hooks... (1/1) Arming ConditionNeedsUpdate... $ pacman -Qi go Name : go Version : 2:1.19-1 Description : Core compiler tools for the Go programming language Architecture : x86_64 URL : https://golang.org/ Licenses : BSD Groups : None Provides : go-pie Depends On : None Optional Deps : None Required By : None Optional For : None Conflicts With : None Replaces : go-pie Installed Size : 434.83 MiB Packager : Morten Linderud Build Date : Tue 02 Aug 2022 02:49:07 PM EDT Install Date : Wed 17 Aug 2022 02:03:55 PM EDT Install Reason : Installed as a dependency for another package Install Script : No Validated By : Signature $ pacman -Qi yay Name : yay Version : 11.3.0-1 Description : Yet another yogurt. Pacman wrapper and AUR helper written in go. Architecture : x86_64 URL : https://github.com/Jguer/yay Licenses : GPL3 Groups : None Provides : None Depends On : pacman>5 git Optional Deps : sudo: privilege elevation [installed] doas: privilege elevation Required By : None Optional For : None Conflicts With : None Replaces : None Installed Size : 7.28 MiB Packager : MithicSpirit Build Date : Wed 17 Aug 2022 02:04:15 PM EDT Install Date : Wed 17 Aug 2022 02:04:35 PM EDT Install Reason : Explicitly installed Install Script : No Validated By : Signature ```
Configuration files `/etc/paru.conf`: ```yaml # # $PARU_CONF # /etc/paru.conf # ~/.config/paru/paru.conf # # See the paru.conf(5) manpage for options # # GENERAL OPTIONS # [options] PgpFetch Devel Provides DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil #AurOnly #BottomUp #RemoveMake #SudoLoop #UseAsk #SaveChanges #CombinedUpgrade #CleanAfter #UpgradeMenu #NewsOnUpgrade #LocalRepo #Chroot #Sign #SignDb #KeepRepoCache # # Binary OPTIONS # #[bin] #FileManager = vifm #MFlags = --skippgpcheck #Sudo = doas ``` `~/.config/paru/paru.conf`: ```yaml # $PARU_CONF # /etc/paru.conf # ~/.config/paru/paru.conf # # See the paru.conf(5) manpage for options # # GENERAL OPTIONS # [options] PgpFetch Devel Provides DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil #AurOnly BottomUp #RemoveMake SudoLoop UseAsk SaveChanges #CombinedUpgrade CleanAfter UpgradeMenu NewsOnUpgrade NoWarn = amdfand amdgui-helper amdguid-glium amdguid-glow amdguid-wayland amdmond amdvold breeze-grub-mithic dmenu-mithic mithic-base ttf-iosevka-mithic LocalRepo Chroot Sign = FEA8F724F2800E40 SignDb = FEA8F724F2800E40 #KeepRepoCache # # Binary OPTIONS # [bin] FileManager = ranger Pager = bat MFlags = --force #Sudo = doas PreBuildCommand = ~/.config/paru/prebuild ``` `~/.config/paru/prebuild`: ```zsh #!/usr/bin/env zsh # Reset gpg timer GPG_TTY="$(tty)" gpg -o /dev/null --clearsign /dev/null issue_found=0 # Automatic issue resolution info_when_match () { if [[ "$PKGBASE" =~ "$1" ]]; then issue_found=1 echo -ne '\e[38;5;10m\e[1mINFO:\e[0m ' echo -e "$2" return 0 fi return 1 } info_when_match 'linux-xanmod*' \ "Xanmod kernel package detected for \`$PKGBASE\`; copying config file..." && ( cp ~/.config/linux-xanmod/myconfig . ) info_when_match 'vscodium' \ "VSCodium detected for \`$PKGBASE\`; deleting repos..." && ( rm -rf vscode vscodium ) # Check for issues that may require manual intervention grep_check () { local grep_printout grep_printout="$(grep --color=always "$1" PKGBUILD)" if [[ "$?" == 0 ]]; then issue_found=1 echo -ne '\e[38;5;11m\e[1mWARNING:\e[0m ' echo -e "\`$1\` found for PKGBUILD \`$PKGBASE\`\n$2" echo "$grep_printout" echo '' fi } grep_check ninja 'Please set flags to `"$NINJAFLAGS"`.' grep_check flutter \ 'Please take ownership of /opt/flutter (`sudo chown -R "$USER:$USER" /opt/flutter`).' grep_check systemd 'Please check if further action is necessary to "detect" systemd.' grep_check 'git://' \ 'Please replace the `git://` protocol on GitHub with `git+https://` protocol.' # Wait for user input if any issue was found if [[ "$issue_found" != 0 ]]; then while true; do read -rt 0 -sk 1 || break; done read -rsk 1 '?Issues found [Press any key to continue]' echo '\n' fi echo '' exit 0 ``` `/etc/pacman.conf`: ```yaml # # /etc/pacman.conf # # See the pacman.conf(5) manpage for option and repository directives # # GENERAL OPTIONS # [options] # The following paths are commented out with their default values listed. # If you wish to use different paths, uncomment and update the paths. #RootDir = / #DBPath = /var/lib/pacman/ #CacheDir = /var/cache/pacman/pkg/ #LogFile = /var/log/pacman.log #GPGDir = /etc/pacman.d/gnupg/ #HookDir = /etc/pacman.d/hooks/ HoldPkg = pacman glibc #XferCommand = /usr/bin/curl -L -C - -f -o %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u CleanMethod = KeepInstalled Architecture = auto # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup #IgnorePkg = #IgnoreGroup = #NoUpgrade = #NoExtract = # Misc options #UseSyslog Color #NoProgressBar CheckSpace VerbosePkgLists #DisableDownloadTimeout ParallelDownloads = 10 ILoveCandy # By default, pacman accepts packages signed by keys that its local keyring # trusts (see pacman-key and its man page), as well as unsigned packages. SigLevel = Required DatabaseOptional LocalFileSigLevel = Optional #RemoteFileSigLevel = Required # NOTE: You must run `pacman-key --init` before first using pacman; the local # keyring can then be populated with the keys of all official Arch Linux # packagers with `pacman-key --populate archlinux`. # # REPOSITORIES # - can be defined here or included from another file # - pacman will search repositories in the order defined here # - local/custom mirrors can be added here or in separate files # - repositories listed first will take precedence when packages # have identical names, regardless of version number # - URLs will have $repo replaced by the name of the current repo # - URLs will have $arch replaced by the name of the architecture # # Repository entries are of the format: # [repo-name] # Server = ServerName # Include = IncludePath # # The header [repo-name] is crucial - it must be present and # uncommented to enable the repo. # # The testing repositories are disabled by default. To enable, uncomment the # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. #[testing] #Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist #[community-testing] #Include = /etc/pacman.d/mirrorlist [community] Include = /etc/pacman.d/mirrorlist # If you want to run 32 bit applications on your x86_64 system, # enable the multilib repositories as required here. #[multilib-testing] #Include = /etc/pacman.d/mirrorlist [multilib] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for # tips on creating your own repositories. #[custom] #SigLevel = Optional TrustAll #Server = file:///home/custompkgs [aur] SigLevel = PackageOptional DatabaseOptional Server = file:///var/lib/repo/aur ```
Morganamilo commented 2 years ago

Seems like a regression with paru-git.

MithicSpirit commented 2 years ago

I don't remember having this issue before so that would make sense.

Morganamilo commented 2 years ago

The whole install stuff has been rewritten since the last release so there may be more issues.