Skip to content

Soften yay go-mod caches and warn on AUR update failure - #13474

Open
AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:fix/aur-gomod-cache-warning
Open

AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:fix/aur-gomod-cache-warning

Conversation

@AnPod

@AnPod AnPod commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Go makes module-cache trees read-only (dr-xr-xr-x). PKGBUILDs that configure GOMODCACHE under $srcdir then fail on the next rebuild when makepkg attempts to delete the previous build directory.

In addition, one failing user-installed AUR package caused omarchy update to report that the entire update failed, even when all system packages and migrations had completed successfully.

This:

  1. Softens read-only go-mod cache directories under yay's cache before invoking yay (chmod -R u+w).
  2. Warns when yay fails instead of aborting the whole update with an error.

Fixes #13334

Testing

  • Added test/shell.d/update-aur-pkgs-test.sh verifying cache permission fixes and failure reporting.
  • Ran bash test/shell.d/update-aur-pkgs-test.sh (4/4 passed).

Go leaves module-cache trees read-only under yay's srcdir, so the next
rebuild fails. Soften those trees before yay and warn instead of failing
the whole update (omacom#13334).

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the fix/aur-gomod-cache-warning branch from cca0ba2 to f7cca17 Compare September 29, 2026 21:03
@omarchybot omarchybot added the enhancement New feature or request label Oct 1, 2026
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks! Two notes:

  1. */src/go-mod only matches one cache layout. It catches hyprmoncfg's GOMODCACHE="$srcdir/go-mod". Packages that follow the Arch Go guidelines (GOPATH="$srcdir", so $srcdir/pkg/mod) or use $srcdir/gopath/pkg/mod still leave read-only trees. Go has a flag that avoids the read-only bits in the first place. Exporting it for the yay run covers every PKGBUILD that doesn't override GOFLAGS itself, and the chmod pass can stay as a fallback:
    GOFLAGS="${GOFLAGS:+$GOFLAGS }-modcacherw" yay "${sudo_options[@]}" -Sua --noconfirm --cleanafter --ignore gcc14,gcc14-libs
    with the find widened to \( -path '*/src/go-mod' -o -path '*/pkg/mod' \).
  2. Swallowing the yay failure is a product call. I agree that one broken user AUR package shouldn't turn the whole update red. But with || exit 1 gone, the only signal is a yellow line in a long log. Could it end with a notification, or a non-fatal summary at the end of omarchy update, so the failure is still noticed?

Also, #13646 has the same diff as this PR, so one of the two can be closed.

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Changes how the system handles AUR package updates.

The PR appears safe to merge, with one non-blocking improvement to the cache cleanup test.

Findings

  1. P2 Cleanup timing is not tested ▶

Summary

Makes selected Go module caches writable before yay runs and adds -modcacherw to its GOFLAGS. AUR failures now print a warning and send a notification without failing the completed system update.

  • Adds tests for cache permissions, Go flags, warnings, and skipped updates.
  • One non-blocking test improvement: check cache permissions when the fake yay starts.
  • AnPod explicitly described nonfatal AUR failures as intentional because system packages and migrations have already completed.

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'upstream/q..." · Reviewed by Greptile

Comment on lines +26 to +27
printf '%s\n%s\n' "$GOFLAGS" "$*" >>"$FAKE_CALLS"
exit "${TEST_YAY_STATUS:-1}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Cleanup timing is not tested

The fake yay never checks whether the caches are writable when it starts. The permission checks run afterward, so this test would still pass if cleanup moved after yay, even though the next rebuild would fail. Check the cache permissions inside the fake yay before it returns.

@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Thanks, 113310e covers both points. -modcacherw is appended to any existing GOFLAGS, the cleanup also matches */pkg/mod, there's a test for all three layouts, and a failed AUR update now raises a notification instead of being only a yellow log line. LGTM from my side. (#13646 still has the earlier version of this diff, so one of the two can be closed.)

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy update reports failure when a user-installed AUR package (hyprmoncfg) can't rebuild: read-only Go module cache left in yay build dir

4 participants