pikaur icon indicating copy to clipboard operation
pikaur copied to clipboard

Isolated build inside chroot

Open steven-omaha opened this issue 7 years ago • 19 comments

~ $ pikaur -S zfs-dkms
Reading local package database... 
Resolving AUR dependencies...
Reading repository package databases...

:: AUR package will be installed:
 zfs-dkms                                                  -> 0.7.9-1

:: New dependencies will be installed from AUR:
 spl-dkms                                                  -> 0.7.9-1
 spl-utils                                                 -> 0.7.9-1
 zfs-utils                                                 -> 0.7.9-1

:: Proceed with installation? [Y/n] 
:: [v]iew package detail   [m]anually select packages
>> 
looking for conflicting packages...
Do you want to edit PKGBUILD for spl-dkms, spl-utils package? [y/N] n
Do you want to edit PKGBUILD for zfs-utils, zfs-dkms package? [Y/n] n
:: error: Dependency cycle detected between {'spl-dkms': 5, 'spl-utils': 4, 'zfs-utils': 4, 'zfs-dkms': 4}

I just tried the same install with aurman, it seem to work there.

steven-omaha avatar Jun 01 '18 07:06 steven-omaha

oh, i saw such situation sometimes when was doing pacman -Syu and pacman was saying "dependency cycle detected between packageFoo and packageBar, packageFoo will be installed before it's dependency" but didn't knew how to reproduce such situation in AUR pkgs to implement that case

thanks for reporting! gonna fix it soon

actionless avatar Jun 01 '18 10:06 actionless

oh, after more investigation it appeared to be another problem, now it should be fine

actionless avatar Jun 01 '18 11:06 actionless

Now I have another bug, maybe related to this one. I have seen this type of error before, but never investigated. But this should never happen.

~ $ rm -rf ~/.cache/pikaur/aur_repos/zfs-dkms
~ $ pikaur -S zfs-dkms                       
Reading local package database...
Resolving AUR dependencies...
Reading repository package databases...

:: AUR package will be installed:
 zfs-dkms                                                  -> 0.7.9-1

:: New dependencies will be installed from AUR:
 spl-dkms                                                  -> 0.7.9-1
 spl-utils                                                 -> 0.7.9-1
 zfs-utils                                                 -> 0.7.9-1

:: Proceed with installation? [Y/n] 
:: [v]iew package detail   [m]anually select packages
>> 
Can't clone 'zfs-dkms, zfs-utils' in '/home/timeshifter/.cache/pikaur/aur_repos/zfs-dkms' from AUR:
None
fatal: destination path '/home/timeshifter/.cache/pikaur/aur_repos/zfs-dkms' already exists and is not an empty directory.

:: Try recovering?
[c] git checkout -- '*'
[r] remove dir and clone again
[s] skip this package
[a] abort
> 

Canceled by user (SIGINT)

steven-omaha avatar Jun 01 '18 22:06 steven-omaha

that could happen if you did Ctrl+C while it checking out the repo or smth like that, just hit 'C' or 'R' to fix it

actionless avatar Jun 02 '18 12:06 actionless

No, I'm able to reproduce this bug. I don't hit anything at all (except enter when it asks me to), and I get the same error message every time.

EDIT: For clarity, I remove the problematic directory by rm -rf, then run pikaur -S zfs-dkms, and it happens every single time.

steven-omaha avatar Jun 02 '18 12:06 steven-omaha

and could you do git status inside that problematic directory while the error message occurs?

actionless avatar Jun 03 '18 09:06 actionless

Here you go. EDIT: I rm -rf ~/.cache/pikaur/aur_repos/{spl,zfs}* beforehand.

~ $ pikaur -S zfs-dkms
Reading local package database...
Resolving AUR dependencies...
Reading repository package databases...

:: AUR package will be installed:
 zfs-dkms                                                  -> 0.7.9-1

:: New dependencies will be installed from AUR:
 spl-dkms                                                  -> 0.7.9-1
 spl-utils                                                 -> 0.7.9-1
 zfs-utils                                                 -> 0.7.9-1

:: Proceed with installation? [Y/n] 
:: [v]iew package detail   [m]anually select packages
>> 
Can't clone 'spl-dkms, spl-utils' in '~/.cache/pikaur/aur_repos/spl-dkms' from AUR:
None
fatal: destination path '~/.cache/pikaur/aur_repos/spl-dkms' already exists and is not an empty directory.

:: Try recovering?
[c] git checkout -- '*'
[r] remove dir and clone again
[s] skip this package
[a] abort
> 

Canceled by user (SIGINT)

~ [125]$ cd ~/.cache/pikaur/aur_repos/spl-dkms 
aur_repos/spl-dkms $ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

steven-omaha avatar Jun 04 '18 18:06 steven-omaha

@steven-omaha fixed the clone problem

actionless avatar Jun 13 '18 00:06 actionless

Upgrades still don't work with pikaur 0.14.4:

$ pikaur -S --noconfirm zfs-dkms
Reading repository package databases...
Reading local package database...
Resolving AUR dependencies...
looking for conflicting AUR packages...
:: Skipping review of PKGBUILD for spl-utils, spl-dkms package (--noconfirm)
:: Skipping review of PKGBUILD for zfs-dkms, zfs-utils package (--noconfirm)

:: Starting the build:
==> Making package: spl-dkms 0.7.9-1 (Sun 24 Jun 2018 02:22:37 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning spl git repo...

[...]
==> Finished making: spl-dkms 0.7.9-1 (Sun 24 Jun 2018 02:25:46 PM CEST)

:: Installing already built dependencies for zfs-dkms, zfs-utils:
loading packages...
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing spl-dkms (0.7.9-1) breaks dependency 'spl-dkms=0.7.8' required by zfs-dkms
Command 'sudo pacman --color=never --noconfirm --upgrade --asdeps /home/me/.cache/pikaur/pkg/spl-dkms-0.7.9-1-x86_64.pkg.tar.xz /home/me/.cache/pikaur/pkg/spl-utils-0.7.9-1-x86_64.pkg.tar.xz' failed to execute.
Do you want to retry? [N]o (--noconfirm)

Can't build 'zfs-utils'.

Failed to build following packages:
zfs-dkms
zfs-utils

jody-frankowski avatar Jun 24 '18 12:06 jody-frankowski

@jody-frankowski oh, that's a new error :-)

actionless avatar Jun 24 '18 14:06 actionless

@jody-frankowski what you can do now is to do pacman -R zfs-dkms zfs-utils spl-utils spl-dkms in another terminal and hit Y to retry in pikaur's prompt

actionless avatar Jun 24 '18 15:06 actionless

so far i think it could be solved only by building inside chroot using makechrootpkg or setting chroot env using systemd. both will require extra space for installing again all the deps chain for building the packages so i think to make such behavior optional

and also first it will require implementing this (https://github.com/actionless/pikaur/issues/136) to avoid building again aur deps of the package

actionless avatar Jun 24 '18 15:06 actionless

also i think to avoid reinstalling all the deps inside chroot each time mb to keep packcages installed in chroot between the builds but just if build fails to show such a prompt, related to https://github.com/actionless/pikaur/issues/44#issuecomment-398243517:

[r]etry [p]gp check skip [c]hecksums skip [f]lush chroot (show only if building inside chroot) [s]kip building this package [a]bort building all the packages

actionless avatar Jun 24 '18 15:06 actionless

hm, or to avoid that dirty hack with caching/flushing chroot: in pikaur config file to set to build in chroot only specific packages (unless * is specified to build all of them) and to have cli flag --use-chroot or so

actionless avatar Jul 20 '18 10:07 actionless

Today I updated zfs-dkms and zfs-utils from 0.8.5-2 to 2.0.0-1 without problems, but it doesnt need spl anymore so maybe that's why.

micwoj92 avatar Dec 09 '20 17:12 micwoj92

@micwoj92 thanks for update, i'll rename the ticket to be more general

actionless avatar Dec 09 '20 17:12 actionless

i thinking about using https://man.archlinux.org/man/pkgctl-build.1 for chrooted build and next https://man.archlinux.org/man/repo-add.8 for adding the results into the local repository

actionless avatar May 22 '23 11:05 actionless

i thinking about using man.archlinux.org/man/pkgctl-build.1 for chrooted build

What is the comparison between pkgctl-build and makechrootpkg? Why should one be used over the other? Fwiw, paru uses makechrootpkg for building packages in a chroot.

MithicSpirit avatar Sep 02 '23 16:09 MithicSpirit

@MithicSpirit i didn't did any further research since then, just noticed that it seems to be a new official tool for that purpose

actionless avatar Sep 02 '23 17:09 actionless