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

No way to download packages only in case of a conflict #50

Open
2 of 7 tasks
przemoc opened this issue May 10, 2024 · 12 comments
Open
2 of 7 tasks

No way to download packages only in case of a conflict #50

przemoc opened this issue May 10, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@przemoc
Copy link

przemoc commented May 10, 2024

Description / Steps to reproduce the issue

pacman -Suw fails, but I think it should ask series of questions similarly like pacman -Su does.

Expected behavior

Successful download of upgraded packages.

Actual behavior

przemoc@NUC11PHKi7C002 MSYS ~
$ pacman -Suw
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing mingw-w64-i686-gcc (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc=13.2.0-6' required by mingw-w64-i686-gcc-ada
:: installing mingw-w64-i686-gcc-libs (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc-libs=13.2.0-6' required by mingw-w64-i686-gcc-ada
:: installing mingw-w64-i686-gcc (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc=13.2.0-6' required by mingw-w64-i686-gcc-objc
:: installing mingw-w64-i686-gcc-libs (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc-libs=13.2.0-6' required by mingw-w64-i686-gcc-objc
:: installing mingw-w64-i686-gcc (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc=13.2.0-6' required by mingw-w64-i686-libgccjit
:: installing mingw-w64-i686-gcc-libs (14.1.0-2) breaks dependency 'mingw-w64-i686-gcc-libs=13.2.0-6' required by mingw-w64-i686-libgccjit

Verification

Windows Version

MSYS_NT-10.0-22631

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

No

@przemoc przemoc added the bug Something isn't working label May 10, 2024
@lazka
Copy link
Member

lazka commented May 10, 2024

It looks like it is that way on purpose: https://gitlab.archlinux.org/pacman/pacman/-/blob/master/src/pacman/pacman.c#L772 since https://gitlab.archlinux.org/pacman/pacman/-/commit/1bd8f57a183db0b9be503eeff3027c4b8d65627d

We could ask upstream about it, if there is a good usecase/reason.

@przemoc
Copy link
Author

przemoc commented May 10, 2024

Thank you for providing origin of this behavior. I suspect it's to ensure non-interactiveness of --downloadonly, but it feels like such feature should be configured separately and not enforced.

My usecase, not sure whether it's a good one, is that I always download first (one pacman invocation) before installing (another pacman invocation). And this behavior makes it impossible to do, unless I'm missing something.

@lazka
Copy link
Member

lazka commented May 10, 2024

Thank you for providing origin of this behavior. I suspect it's to ensure non-interactiveness of --downloadonly, but it feels like such feature should be configured separately and not enforced.

Good point. We patch pacman to make "--noconfirm" default to resolving the conflict bb871d9 With upstream pacman there is no good way to have it non-interactive with conflicts.

@lazka lazka transferred this issue from msys2/MINGW-packages May 10, 2024
@lazka lazka changed the title Unable to download mingw-w64-i686-gcc packages - failed to prepare transaction (could not satisfy dependencies) No way to download packages only in case of a conflict May 10, 2024
@lazka
Copy link
Member

lazka commented May 10, 2024

I've moved this issue to our pacman fork, but I'm currently unsure on how to proceed.

@przemoc
Copy link
Author

przemoc commented May 11, 2024

Just a follow up to my own comment:

I suspect it's to ensure non-interactiveness of --downloadonly

Isn't pacman -Suw interactive anyway, as you have to confirm that you want to proceed with download?
(That is unless someone uses --noconfirm if I'm not mistaken.)

So I'm thinking if it wouldn't be better to add ALPM_TRANS_FLAG_NOCONFLICTS flag only when noconfirm is set, or something like that.

@przemoc
Copy link
Author

przemoc commented May 11, 2024

I've moved this issue to our pacman fork,

Thanks. I should have created it here from the get go.

but I'm currently unsure on how to proceed.

My idea expressed in previous comment may be sufficient way to deal with it, or so I hope, but I am not familiar with pacman source code, so there may be some corner cases which make it harder than it seems on the surface.

I will try to report the issue upstream. I don't have Arch Linux account yet, but requested one.
I'll link here upstream ticket after creating it.

@przemoc
Copy link
Author

przemoc commented May 12, 2024

I just created upstream issue:
https://gitlab.archlinux.org/pacman/pacman/-/issues/138

@allanmcrae
Copy link
Contributor

This error has nothing to do with conflicts. Hence you are not being asked any questions.

It is due to a failure in dependency resolution (gcc is updated but gcc-{ada,objc,libgccjit} are not?). Using -d would work around this issue. Using -y would probably fix it!

@allanmcrae
Copy link
Contributor

In fact... with conflicts, the ALPM_TRANS_FLAG_NOCONFLICTS flag means this would just plow on through and download the packages.

@przemoc
Copy link
Author

przemoc commented May 13, 2024

This error has nothing to do with conflicts. Hence you are not being asked any questions.

When pacman -Su (i.e. without --downloadonly) is run it looks like this:

$ pacman -Su
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
:: mingw-w64-i686-gcc and mingw-w64-i686-gcc-objc are in conflict. Remove mingw-w64-i686-gcc-objc? [Y/n] y
:: mingw-w64-i686-gcc and mingw-w64-i686-gcc-ada are in conflict. Remove mingw-w64-i686-gcc-ada? [Y/n] y
:: mingw-w64-i686-gcc and mingw-w64-i686-libgccjit are in conflict. Remove mingw-w64-i686-libgccjit? [Y/n] y

Packages (21) mingw-w64-clang-x86_64-cmake-3.29.3-2
              mingw-w64-clang-x86_64-ninja-1.12.1-1
              mingw-w64-i686-gcc-14.1.0-2
              mingw-w64-i686-gcc-ada-13.2.0-6 [removal]
              mingw-w64-i686-gcc-fortran-14.1.0-2
              mingw-w64-i686-gcc-libgfortran-14.1.0-2
              mingw-w64-i686-gcc-libs-14.1.0-2
              mingw-w64-i686-gcc-objc-13.2.0-6 [removal]
              mingw-w64-i686-libgccjit-13.2.0-6 [removal]
              mingw-w64-ucrt-x86_64-cmake-3.29.3-2
              mingw-w64-ucrt-x86_64-cmake-docs-3.29.3-2
              mingw-w64-ucrt-x86_64-gcc-14.1.0-2
              mingw-w64-ucrt-x86_64-gcc-ada-14.1.0-2
              mingw-w64-ucrt-x86_64-gcc-fortran-14.1.0-2
              mingw-w64-ucrt-x86_64-gcc-libgfortran-14.1.0-2
              mingw-w64-ucrt-x86_64-gcc-libs-14.1.0-2
              mingw-w64-ucrt-x86_64-gcc-objc-14.1.0-2
              mingw-w64-ucrt-x86_64-github-cli-2.49.1-1
              mingw-w64-ucrt-x86_64-libgccjit-14.1.0-2
              mingw-w64-ucrt-x86_64-ninja-1.12.1-1
              mingw-w64-ucrt-x86_64-nss-3.100-1

Total Download Size:    206.80 MiB
Total Installed Size:   949.50 MiB
Net Upgrade Size:      -166.88 MiB

:: Proceed with installation? [Y/n]

So it has been linked to conflicts due to messages like mingw-w64-i686-gcc and mingw-w64-i686-gcc-objc are in conflict. Are those messages incorrect?

It is due to a failure in dependency resolution (gcc is updated but gcc-{ada,objc,libgccjit} are not?). Using -d would work around this issue.

Using pacman -Suwd does seem to work. There are no errors now. Thank you.
You call it workaround, so is there a better/proper solution to this situation?

Using -y would probably fix it!

Initially I did -Syuw, but using -y aka --refresh doesn't change anything in this situation, therefore I didn't mention -y in the command when creating ticket.

@lazka
Copy link
Member

lazka commented May 13, 2024

gcc is updated but gcc-{ada,objc,libgccjit} are not?)

gcc-ada had a versioned dependency on gcc previously. In the new update gcc-ada was completely dropped from the repo. To allow users that had gcc-ada installed to upgrade smoothly we added a conflict to the main gcc package on gcc-ada, so that if gcc is upgraded gcc-ada is removed first. (using ada as an example, the same is true for objc,libgccjit)

@allanmcrae
Copy link
Contributor

Ah - a complicated update... -Suw ignored the conflicts and tried to progress but hit dependency version errors.

Interesting question whether we should ignore dependency errors on -Suw. We still want dependency resolving to happen, so at most I would consider ignoring version only dependency issues. But I am not at all convinced that is a good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants