Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paru fails at dependency / conflict resolution of split packages depending on different package bases #1173

Open
TheOneWithTheBraid opened this issue Apr 2, 2024 · 8 comments

Comments

@TheOneWithTheBraid
Copy link

Affected Version

paru v2.0.3 - libalpm v14.0.0

Description

I'm trying to get paru installing a pretty huge split package consisting of two AUR pkgbase repos with several split packages.

PKGBASE 1 : aur/flutter
PKGBASE 2 : aur/flutter-artifacts-google-bin

The package is constructed in the following way :

  • the aur/flutter base contains all components built from source
  • the aur/flutter-artifacts-google-bin base contains a PKGBUILD fetching required artifacts for Flutter from Google CI - this package provides all artifacts required by split sub packages of the flutter base as split packages. E.g. : flutter-engine-android required by flutter-traget-android. Whereas the engine is provided by another pkg base than the target package.
  • all flutter group packages depend on their corresponding dependencies in the exact version. E.g. flutter-target-android=3.19.5 depends on flutter-engine-android=3.19.5. I guess it's obvious that makes sense.
  • in order to avoid dependency resolution issues with AUR helpers (encountered issues in both yay and paru), I added a conflicts section enforcing to first unsinstall all previous versions before trying to upgrade to the next version.
  • Paru, instead of building and packaging all split packages from the group (provided in the two pkg bases) tries, to first install flutter-common in the new version - which conflicts with all other installed packages of the group.
  • Instead of now asking to remove the previous version, the command fails - pacman is not run interactively here in order to allow that.
  • Most useful would be simply building all packages and then installing them at once - this would best imitate the behavior of pacman, as pacman also first downloads all explicit packages and dependencies and then installs all of them at once.

I understand that this is a pretty complex case of dependency resolution. But the AUR upstream definitely provides all required dependency and conflict declarations mandatory in order to perform an upgrade of the package. Still paru doesn't reach at upgrading it.

The easiest way to fix this dependency resolution would be simply allowing the user to confirm the removal proposed by pacman.

The more clean way of fixing this behavior would be making paru first build and package all split packages and then installing all of them at once.

Output

paru build / install output
paru -S --confirm flutter
:: Resolving dependencies...
:: There are 6 providers available for flutter:
:: Repository AUR:
    1) flutter  2) flutter-beta  3) flutter-dev  4) flutter-dummy  5) flutter-git  6) flutterup
Enter a number (default=1):
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (7) flutter-3.19.5-7 (flutter-common flutter-tool flutter-devel)
        flutter-artifacts-google-bin-3.19.5-4 (flutter-sky-engine-google-bin flutter-material-fonts-google-bin flutter-engine-common-google-bin flutter-engine-linux-google-bin)
        flutter-3.19.5-7 (flutter-target-linux)  flutter-artifacts-google-bin-3.19.5-4 (flutter-engine-android-google-bin)  flutter-3.19.5-7 (flutter-gradle flutter-target-android)
        flutter-artifacts-google-bin-3.19.5-4 (flutter-engine-web-google-bin)  flutter-3.19.5-7 (flutter-target-web flutter-intellij-patch flutter)

:: Proceed to review? [Y/n]:

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
 nothing new to review
fetching devel info...
==> Making package: flutter 3.19.5-7 (Tue 02 Apr 2024 05:04:55 PM CEST)
==> Retrieving sources...
  -> Found flutter-3.19.5.tar.xz
  -> Found system-dart.patch
  -> Found gradle-user-home.patch
  -> Found flutter.sh
  -> Found version.patch
  -> Found no-lock.patch
  -> Found no-runtime-download.patch
  -> Found doctor.patch
  -> Found opt-in-analytics.patch
==> Validating source files with sha256sums...
    flutter-3.19.5.tar.xz ... Passed
    system-dart.patch ... Passed
    gradle-user-home.patch ... Passed
    flutter.sh ... Passed
    version.patch ... Passed
    no-lock.patch ... Passed
    no-runtime-download.patch ... Passed
    doctor.patch ... Passed
    opt-in-analytics.patch ... Passed
==> Making package: flutter 3.19.5-7 (Tue 02 Apr 2024 05:05:16 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found flutter-3.19.5.tar.xz
  -> Found system-dart.patch
  -> Found gradle-user-home.patch
  -> Found flutter.sh
  -> Found version.patch
  -> Found no-lock.patch
  -> Found no-runtime-download.patch
  -> Found doctor.patch
  -> Found opt-in-analytics.patch
==> Validating source files with sha256sums...
    flutter-3.19.5.tar.xz ... Passed
    system-dart.patch ... Passed
    gradle-user-home.patch ... Passed
    flutter.sh ... Passed
    version.patch ... Passed
    no-lock.patch ... Passed
    no-runtime-download.patch ... Passed
    doctor.patch ... Passed
    opt-in-analytics.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting flutter-3.19.5.tar.xz with bsdtar
==> Starting prepare()...
patching file packages/flutter_tools/bin/tool_backend.dart
patching file packages/flutter_tools/bin/tool_backend.sh
patching file packages/flutter_tools/gradle/src/main/groovy/flutter.groovy
patching file packages/flutter_tools/lib/src/artifacts.dart
patching file packages/flutter_tools/lib/src/cache.dart
patching file packages/flutter_tools/lib/src/commands/create_base.dart
patching file packages/flutter_tools/lib/src/dart/pub.dart
patching file packages/flutter_tools/lib/src/dart/language_version.dart
patching file packages/flutter_tools/gradle/build.gradle.kts
patching file packages/flutter_tools/lib/src/android/gradle.dart
patching file packages/flutter_tools/lib/src/version.dart
Hunk #5 succeeded at 295 (offset 2 lines).
Hunk #6 succeeded at 379 (offset 2 lines).
Hunk #7 succeeded at 472 (offset 63 lines).
Hunk #8 succeeded at 539 (offset 63 lines).
Hunk #9 succeeded at 547 (offset 63 lines).
Hunk #10 succeeded at 576 (offset 20 lines).
Hunk #11 succeeded at 749 (offset 21 lines).
Hunk #12 succeeded at 773 (offset 21 lines).
Hunk #13 succeeded at 834 (offset 21 lines).
patching file packages/flutter_tools/lib/src/cache.dart
Hunk #1 succeeded at 284 with fuzz 1 (offset 4 lines).
Hunk #2 succeeded at 673 (offset 39 lines).
patching file packages/flutter_tools/lib/src/cache.dart
Hunk #1 succeeded at 964 (offset 38 lines).
Hunk #2 succeeded at 1067 (offset 51 lines).
patching file packages/flutter_tools/lib/src/doctor.dart
Hunk #1 succeeded at 670 (offset 49 lines).
patching file packages/flutter_tools/lib/src/reporting/usage.dart
patching file packages/flutter_tools/lib/src/reporting/first_run.dart
Hunk #1 succeeded at 39 with fuzz 2 (offset 2 lines).
~/.cache/paru/clone/flutter/src/gradlew ~/.cache/paru/clone/flutter/src

> Task :init
To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.7/samples

BUILD SUCCESSFUL in 408ms
1 actionable task: 1 executed

BUILD SUCCESSFUL in 484ms
1 actionable task: 1 executed
~/.cache/paru/clone/flutter/src
==> Sources are ready.
flutter-3.19.5-7 (flutter-common flutter-tool flutter-devel): parsing pkg list...
:: flutter-3.19.5-7 is up to date -- skipping build
[sudo] password for void:
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
loading packages...
resolving dependencies...
looking for conflicting packages...
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common). Remove flutter-engine-common-google-bin? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: flutter-common-3.19.5-7 and flutter-engine-common-google-bin-3.19.4-5 are in conflict (flutter-engine-common<3.19.5)
error: packages failed to build: flutter-artifacts-google-bin-3.19.5-4 (flutter-sky-engine-google-bin flutter-material-fonts-google-bin flutter-engine-common-google-bin flutter-engine-linux-google-bin)  flutter-3.19.5-7 (flutter-target-linux)  flutter-artifacts-google-bin-3.19.5-4 (flutter-engine-android-google-bin)  flutter-3.19.5-7 (flutter-gradle flutter-target-android)  flutter-artifacts-google-bin-3.19.5-4 (flutter-engine-web-google-bin)  flutter-3.19.5-7 (flutter-target-web flutter-intellij-patch flutter)

@urbenlegend
Copy link

A similar thing also happens with zfs-dkms and zfs-utils. Paru attempts to upgrade each of them one at a time instead of rebuilding both and installing them at the same time. Because they depend on specific versions of each other, the install fails. I have to use -Syud and force ignore the version number in order for it to go through.

@TheOneWithTheBraid
Copy link
Author

The -d flag and -Syud respectively won't help. It still fails at the question whether it should remove the previous version since it's running non-interactively.

@Morganamilo
Copy link
Owner

I just tried to build it and it worked. I'm not sure what has changed since this issue was opened, if the pkgbuilds are laid out differently now or something. Or was installing it always fine but upgrading is where the issues are?

Paru has had some bug fixes to the dep resolver so that could be it too. Though normally with stuff like this you can just build in a chroot and sidestep the whole thing.

@drrlvn
Copy link

drrlvn commented Dec 14, 2024

Installing is fine but upgrading fails. Using paru v2.0.4 - libalpm v15.0.0:

error: failed to prepare transaction (could not satisfy dependencies)
:: installing zfs-utils (2.2.7-1) breaks dependency 'zfs-utils=2.2.6' required by zfs-dkms

@romanstingler
Copy link

@drrlvn do you have cachyOS or other sources or do you build from AUR ??

@drrlvn
Copy link

drrlvn commented Dec 15, 2024

I don’t have cachyOS, I only build zfs-dkms and zfs-utils with paru.

@romanstingler
Copy link

@drrlvn did it work now ?? Maybe just the version in the AUR repo was not up-to-date

@Morganamilo
Copy link
Owner

I've tested this. This does not work because paru will install aur packages one at a time. --batchinstall doesn't fix it because it uses a naive check and flushes the install queue as soon as it detects a package it can't install. Instead of looking ahead and realising both could be installed together.

This is something that will probably we fixed an overall of the dep solving so there's no immediate fix.

However if you're using local repos and chroots it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants