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

yay tries to build each split package, ignoring previous failures in the same pkgbase #2560

Open
yurikoles opened this issue Jan 1, 2025 · 4 comments · May be fixed by #2561
Open

yay tries to build each split package, ignoring previous failures in the same pkgbase #2560

yurikoles opened this issue Jan 1, 2025 · 4 comments · May be fixed by #2561

Comments

@yurikoles
Copy link

yurikoles commented Jan 1, 2025

Affected Version

yay v12.4.2 - libalpm v15.0.0

Describe the bug

yay tries to build each split package in the same run, even if attempt to build the same pkgbase was failed.

Reproduction Steps

I discovered this bug during upgrade with --devel, but it's also reproducible with new installation.

These packages are currently failing, but I'm unsure how long it will take upstream for to fix them.

yay -S linux-drm-tip-git linux-drm-tip-headers-git linux-drm-tip-docs-git

Or

yay -S linux-drm-intel-next-git linux-drm-intel-next-headers-git linux-drm-intel-next-docs-git

yay makes 3 build attempts during install or upgrade.

Expected behaviour

yay should make exactly one build attempt per pkgbase.

Output

I uploaded debug.log to gist due to extreme size.

$ yay -Pg

{
	"aururl": "https://aur.archlinux.org",
	"aurrpcurl": "https://aur.archlinux.org/rpc?",
	"buildDir": "/home/yurikoles/.cache/yay",
	"editor": "",
	"editorflags": "",
	"makepkgbin": "makepkg",
	"makepkgconf": "",
	"pacmanbin": "pacman",
	"pacmanconf": "/etc/pacman.conf",
	"redownload": "no",
	"answerclean": "no",
	"answerdiff": "no",
	"answeredit": "no",
	"answerupgrade": "yes",
	"gitbin": "git",
	"gpgbin": "gpg",
	"gpgflags": "",
	"mflags": "",
	"sortby": "votes",
	"searchby": "name-desc",
	"gitflags": "",
	"removemake": "yes",
	"sudobin": "sudo",
	"sudoflags": "",
	"version": "11.3.2",
	"requestsplitn": 150,
	"completionrefreshtime": 1,
	"maxconcurrentdownloads": 0,
	"bottomup": true,
	"sudoloop": false,
	"timeupdate": false,
	"devel": false,
	"cleanAfter": false,
	"keepSrc": false,
	"provides": false,
	"pgpfetch": true,
	"cleanmenu": false,
	"diffmenu": false,
	"editmenu": false,
	"combinedupgrade": true,
	"useask": false,
	"batchinstall": false,
	"singlelineresults": false,
	"separatesources": true,
	"debug": false,
	"rpc": true,
	"doubleconfirm": true,
	"rebuild": "no"
}
@Jguer
Copy link
Owner

Jguer commented Jan 3, 2025

Hey @yurikoles can you try yay-git. I believe this has already been fixed but unreleased

@Ferdi265
Copy link
Contributor

Ferdi265 commented Jan 5, 2025

Yes, this should be fixed since #2534 was merged.

EDIT: this specific case might not be fixed. The fix PR only adds a package to builtPkgDests when its build succeeds, so this might still be broken. I'll need to verify this.

EDIT2: this is still broken, a failed package is still built multiple times if multiple of its subpackages are in the list of to-build packages. A fix could be the following small patch:

diff --git a/pkg/sync/build/installer.go b/pkg/sync/build/installer.go
index a01815d..2b53e23 100644
--- a/pkg/sync/build/installer.go
+++ b/pkg/sync/build/installer.go
@@ -238,6 +238,8 @@ func (installer *Installer) installAURPackages(ctx context.Context,
                } else {
                        var errMake error
                        installer.log.Debugln("building pkgbase", base, "package", name)
+                       builtPkgDests[base] = pkgdests
+
                        pkgdests, errMake = installer.buildPkg(ctx, dir, base,
                                installIncompatible, cmdArgs.ExistsArg("needed"), aurOrigTargetBases.Contains(base))
                        if errMake != nil {
@@ -249,8 +251,6 @@ func (installer *Installer) installAURPackages(ctx context.Context,
                                installer.log.Errorln(gotext.Get("error making: %s", base), "-", errMake)
                                continue
                        }
-
-                       builtPkgDests[base] = pkgdests
                }
 
                if len(pkgdests) == 0 {

Ferdi265 added a commit to Ferdi265/yay that referenced this issue Jan 5, 2025
The previous fix commit ec837c8 failed to address the case where the
build fails, as packages are only added to builtPkgDests on a successful
build. This commit addresses this by adding the package to the map earlier.

Fixes Jguer#2560.
Ferdi265 added a commit to Ferdi265/yay that referenced this issue Jan 5, 2025
…error

The previous fix commit ec837c8 failed to address the case where the
build fails, as packages are only added to builtPkgDests on a successful
build. This commit addresses this by adding the package to the map earlier.

Fixes Jguer#2560.
@yurikoles
Copy link
Author

I can still reproduce this issue on yay v12.4.2.r28.g9322197d - libalpm v15.0.0 for both and install and upgrade with --devel.

@Ferdi265
Copy link
Contributor

Ferdi265 commented Jan 9, 2025

I can still reproduce this issue on yay v12.4.2.r28.g9322197d - libalpm v15.0.0 for both and install and upgrade with --devel.

That's what I expected and is consistent with my testing.

The linked fix PR is not 100% ready yet, some some tests are still failing, but I've been using it the last few days and it appears to work in regular usage, you can try it out if you need a fix urgently, but YMMV.

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

Successfully merging a pull request may close this issue.

3 participants