actionless / pikaur

AUR helper with minimal dependencies. Review PKGBUILDs all in once, next build them all without user interaction.
GNU General Public License v3.0
842 stars 84 forks source link

Isolated build inside chroot #194

Open steven-omaha opened 6 years ago

steven-omaha commented 6 years ago
~ $ 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.

actionless commented 6 years ago

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 commented 6 years ago

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

steven-omaha commented 6 years ago

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)
actionless commented 6 years ago

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

steven-omaha commented 6 years ago

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.

actionless commented 6 years ago

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

steven-omaha commented 6 years ago

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
actionless commented 6 years ago

@steven-omaha fixed the clone problem

jody-frankowski commented 6 years ago

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
actionless commented 6 years ago

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

actionless commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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

micwoj92 commented 3 years ago

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.

actionless commented 3 years ago

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

actionless commented 1 year ago

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

MithicSpirit commented 10 months ago

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.

actionless commented 10 months ago

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