setup: fetch mesa from the release tarball and apply patches idempotently #391
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!391
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-391"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@cerealfordinner on GitHub · 2026-12-03 23:50 UTC · original
cerealfordinner:upstream/mesa-setup→main· +54 −4 · 1 files · 3 commits · openThe gitlab.freedesktop.org shallow clone fails with early EOF and an unexpected disconnect often enough to make setup unreliable. Use the release tarball from archive.mesa3d.org instead, then apply the same mesa.patch (and mesa.*.patch siblings) in a git repository made from the extracted source.
The tarball and patches are stamped: when either changes, setup resets to the extracted source and applies the patches again. The old path applied them only while extracting, so a re-run over an already-extracted tree could silently build unpatched mesa.
github-bot referenced this pull request2026-12-04 01:44:04 +00:00
@Luxuride on GitHub · 2026-12-04 11:28 UTC · original
Two things stop this merging, both quick:
setup.sh:163isif [ ! -d "$src_dir/meson.build" ].meson.buildis a file, so-dis always false and the block always runs:deps/mesais removed, re-extracted and re-git init-ed on every./setup.sh, and since the build directory lives inside that tree (setup.sh:154) mesa is rebuilt from scratch every time.-f— and that is the opposite of what the title promises.setup.sh:175/:178rungit -C "$src_dir" commit. On a fresh machine there is nouser.name/user.email, so it exits 128 "Author identity unknown" andset -euo pipefailaborts setup before mesa is built. Passgit -c user.name=… -c user.email=… commit(or theGIT_AUTHOR_*/GIT_COMMITTER_*env) for that call. The old clone path never needed a commit, so this is a new failure mode for exactly the audience setup.sh has.Then, before it is idempotent in the sense the title means:
MESA[1]/MESA[2]leaves the old tree in place, re-applies patches, and the stamp (setup.sh:161) matches while the source is stale. Store the tarball sum (.tarball-sum) and re-extract when it differs.deps/mesahad edits the patch does not (upstream/main:setup.sh:58-65, "keep them with tools/patch.sh") is gone;step_mesanow does a baregit reset --hard, so in-progress work is silently discarded.tools/patch.sh mesastill works, which makes the silent reset worse.Also check
setup.sh:176's recovery branch: after a kill betweengit initandgit commitit is reachable, andgit add -Athere will sweep indeps/mesa/buildunless the tree's.gitignoreexcludes it.@cerealfordinner on GitHub · 2026-12-04 22:42 UTC · original
Fixed the review items (
-d→-f, git identity on commit, tarball-sum stamp) and rebased onto current main.ad4541b466to9a49ab35ce@cerealfordinner on GitHub · 2026-12-04 23:15 UTC · original
Pushed the two remaining review items:
step_mesanow runsgit diff --quietbefore thereset --hardand stops withdeps/mesa has changes the patch does not: keep them with tools/patch.sh mesaif there are unstaged edits, so in-progress work isn't dropped without a word..gitignoreexcluding/build/is written before the init/commit, so the recoverygit add -A(kill between init and commit) can't pulldeps/mesa/buildinto the history.Verified the guard/gitignore logic in a throwaway tree (clean tree passes, unstaged edit trips the guard, staged patches fall through to re-apply) and
bash -n setup.shis clean.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.