fix(build): fix snap release#37602
Conversation
There was a problem hiding this comment.
It can't be a right fix.
- Why snap build can't read 1.26 branch?
- If you do so, the build will break again if main branch changes in the future
Update: for the os.Getuid problem, not in this PR's scope: fix: "run as root" check #37622 , so I marked other comments as "resolved" to make the discussion more focused here.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Suggestion to address the "will break again on main" concern without waiting for an infra fix: detect the checked-out source's needs in override-build: |
set -x
npm install -g pnpm
# 1.26.x sources need explicit sqlite tags; 1.27+ defaults to modernc
if [ -f models/db/driver_sqlite_modernc.go ]; then
TAGS="bindata pam cert"
else
TAGS="bindata sqlite sqlite_unlock_notify pam cert"
fi
TAGS="\$TAGS" make build
install -D gitea "\${SNAPCRAFT_PART_INSTALL}/gitea"
cp -r options "\${SNAPCRAFT_PART_INSTALL}/"Auto-adapts per tag, no follow-up needed when 1.26 is EOL'd. The structurally correct fix is at the snap infra level — have the Store build read Comment written by Claude Opus 4.7 |
AI slop. It would only add one more dirty hack to the already buggy snap build steps. There are far more problems in the snap build than it looks, if you would spend some time to investigate. I have proposed some fixes, but I am just curious whether there are people able to maintain such legacy code correctly. |
|
For @techknowlogick / @lunny: The structural fix lives on Canonical's side. The Snap Store "Builds" tab only ever builds from the GitHub default branch — no per-branch or per-tag trigger (open feature requests for branch and tag since 2017) — so the snapcraft.io integration alone can't be configured to read The supported workaround is Launchpad snap recipes (one recipe per long-lived ref, each reads its own
Lighter alternative — Either of these makes #37593-class breakages structurally impossible; the in-tree workaround in this PR (or my earlier file-marker suggestion) is only needed until one of them is set up. Comment written by Claude Opus 4.7 |
Yes, it's a workaround, the proper fix options are described in comment above. |
Even if nobody would like to touch snapcraft.io and keep adding new branches to launchpad, the "almost" complete fix can be like this: wxiaoguang@aeaf3ab |
I had Claude look at that and it likes it. One remark:
|
Yes, that's my proposal. 1.26 fix, then main |
|
So how do we continue here? Branch https://github.com/wxiaoguang/gitea/tree/fix-snap does not have a PR up yet? |
@wxiaoguang ping |
|
Let the owner decide what they would like to do. Fix the snapcraft.io, or fix the build script ( #37602 (comment) ) |
I prefer your commits. |
|
There's a third option too with |
|
Fix #37593
The stable version release of snap will read the main branch's snap file. So that we cannot remove the sqlite tags at the moment.