vn971 / rua

Build tool for Arch Linux providing control, review and jailed build options
GNU General Public License v3.0
425 stars 42 forks source link

asdeps and explicit are not handled properly #65

Open Morganamilo opened 5 years ago

Morganamilo commented 5 years ago

Currently rua uses a pretty naive solution to figure out is a package should be installed explicitly.

There's currently two problems with it:

  1. It assumes an entire pkgbase is either asdeps or explicit. This it not the case, for example if I install libc++ then libc++abi will get pulled in as a dependency. Currently rua will suggest them both be explicit.

  2. Install reason should not change when upgrading a package. Say I already have foo=1 installed explicitly, then I want to install bar and bar depends on foo=2. Then rua would pull that in as a dependency and suggest I install it with --asdeps, changing the install reason.

Do note due to rua not handling versioned deps I think point 2 is unreachable because rua would consider the dep foo=2 satisfied even though it should not be.

vn971 commented 5 years ago
  1. this is a regression because of the (very unfortunate) https://github.com/vn971/rua/issues/48 It is reverted by now, and this part is fixed

  2. I tested it right now. If I understand it correctly, the following is true about pacman:

That makes reason 2. irrelevant as well, right? Can you confirm?

Morganamilo commented 5 years ago

That makes reason 2. irrelevant as well, right? Can you confirm?

Not quite because rua still makes use of the --asdeps flag. So it could toggle something installed explicitly to as a dep.

However I did say:

Do note due to rua not handling versioned deps I think point 2 is unreachable because rua would consider the dep foo=2 satisfied even though it should not be.

I do believe this would reproduce it if rua did versioned depends:

morganamilo@Octavia ~ % pacman -Qi moarvm| grep Reason
Install Reason  : Explicitly installed
morganamilo@Octavia ~ % MAKEPKG_DUMY_BUILD=1 rua install nqp
Reviewing "/home/morganamilo/.config/rua/pkg/nqp". 
[D]=view upstream changes since your last review, [M]=accept/merge upstream changes, [S]=(shellcheck not available until you merge), [T]=run shell to edit/inspect, [O]=(cannot use the package until you merge) m
Reviewing "/home/morganamilo/.config/rua/pkg/nqp". 
[S]=run shellcheck on PKGBUILD, [D]=(identical to upstream, empty diff), [T]=run shell to edit/inspect, [O]=ok, use package o
==> Making package: nqp 2019.03-1 (Thu 12 Sep 2019 14:57:49 BST)
==> Checking runtime dependencies...
==> Missing dependencies:
  -> moarvm>=2019.03
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.
Build failed with exit code 8 in /home/morganamilo/.cache/rua/build/nqp
morganamilo@Octavia ~ % 
vn971 commented 5 years ago

So to summarize, the only danger for pacman -U in relation to asdeps/asexplicit, is re-installing an explicit package as deps. RUA never re-installs anything unless the package itself is built (but then it's not a dependency).

Should we close the issue then? The issue-s title seems to not be correct..

vn971 commented 5 years ago

Since both potential problems are apparently not touching the tool, closing.

Morganamilo commented 5 years ago

Both problems? 1 is still valid

morganamilo@Octavia ~ % MAKEPKG_DUMMY_BUILD=1 rua install libc++
Package libc++ depends on libc++abi. Resolving...

In order to install all targets, the following pacman packages will need to be installed:

And the following AUR packages will need to be built and installed:
  libc++abi
  libc++

Proceed? [O]=ok, Ctrl-C=abort. o
WARNING: your AUR repo is up-to-date.
If you continue, the build directory will be removed and the build will be re-run.
If you don't want that, consider resolving the situation manually,
for example:    rua builddir "/home/morganamilo/.cache/rua/build/libc++"

Reviewing "/home/morganamilo/.config/rua/pkg/libc++". 
[S]=run shellcheck on PKGBUILD, [D]=(identical to upstream, empty diff), [T]=run shell to edit/inspect, [O]=ok, use package t
Exit the shell with `logout` or Ctrl-D...
morganamilo@Octavia master ...rua/pkg/libc++ % vim PKGBUILD 
morganamilo@Octavia master ...rua/pkg/libc++ % 
Reviewing "/home/morganamilo/.config/rua/pkg/libc++". 
[S]=run shellcheck on PKGBUILD, [D]=view your changes, [T]=run shell to edit/inspect, [O]=ok, use package o
==> Making package: libc++ 8.0.1-1 (Mon 16 Sep 2019 21:55:04 BST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Entering fakeroot environment...
==> 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 "libc++"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> 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 "libc++abi"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> 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 "libc++experimental"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: libc++ 8.0.1-1 (Mon 16 Sep 2019 21:55:08 BST)
Package libc++-8.0.1-1-x86_64.pkg.tar.xz has no SUID files.
[E]=list executable files, [L]=list all files, [T]=run shell to inspect, [O]=ok, proceed. o

Package libc++abi-8.0.1-1-x86_64.pkg.tar.xz has no SUID files.
[E]=list executable files, [L]=list all files, [T]=run shell to inspect, [O]=ok, proceed. o

Packages need to be installed:

    pacman -U --asdeps --needed '/home/morganamilo/.cache/rua/checked_tars/libc++/libc++-8.0.1-1-x86_64.pkg.tar.xz' '/home/morganamilo/.cache/rua/checked_tars/libc++/libc++abi-8.0.1-1-x86_64.pkg.tar.xz'

Enter S to `sudo` install it, or install manually and press M when done. 
vn971 commented 5 years ago

Opening until I re-test it.

vn971 commented 5 years ago

Confirming that it's a bug.

almindor commented 1 year ago

Any updates on this? I have to constantly keep doing pacman -D --asexplicit <anything from rua> all the time due to this bug.