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

chore: update alpine base to 3.19 #7323

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented May 8, 2024

Yay - somehow, #7111 wasn't entirely right - the git version in alpine 3.18 is too old, and git fetch --porcelain isn't supported. However, in alpine 3.19, the version is new enough, and this new flag works.

See https://github.com/dagger/dagger/actions/runs/9003172745/job/24733214096?pr=7319#step:4:71.

14:06:47 WRN failed to fetch branch err="error fetching branch from origin: exit status 129\nerror: unknown option `porcelain'\nusage: git fetch [<options>] [<repository> [<refspec>...]]\n   or: git fetch [<options>] <group>\n   or: git fetch --multiple [<options>] [(<repository> | <group>)...]\n   or: git fetch --all [<options>]\n\n    -v, --verbose         be more verbose\n    -q, --quiet           be more quiet\n    --all                 fetch from all remotes\n    --set-upstream        set upstream for git pull/fetch\n    -a, --append          append to .git/FETCH_HEAD instead of overwriting\n    --atomic              use atomic transaction to update references\n    --upload-pack <path>  path to upload pack on remote end\n    -f, --force           force overwrite of local reference\n    -m, --multiple        fetch from multiple remotes\n    -t, --tags            fetch all tags and associated objects\n    -n                    do not fetch all tags (--no-tags)\n    -j, --jobs <n>        number of submodules fetched in parallel\n    --prefetch            modify the refspec to place all refs within refs/prefetch/\n    -p, --prune           prune remote-tracking branches no longer on remote\n    -P, --prune-tags      prune local tags no longer on remote and clobber changed tags\n    --recurse-submodules[=<on-demand>]\n                          control recursive fetching of submodules\n    --dry-run             dry run\n    --write-fetch-head    write fetched references to the FETCH_HEAD file\n    -k, --keep            keep downloaded pack\n    -u, --update-head-ok  allow updating of HEAD ref\n    --progress            force progress reporting\n    --depth <depth>       deepen history of shallow clone\n    --shallow-since <time>\n                          deepen history of shallow repository based on time\n    --shallow-exclude <revision>\n                          deepen history of shallow clone, excluding rev\n    --deepen <n>          deepen history of shallow clone\n    --unshallow           convert to a complete repository\n    --update-shallow      accept refs that update .git/shallow\n    --refmap <refmap>     specify fetch refmap\n    -o, --server-option <server-specific>\n                          option to transmit\n    -4, --ipv4            use IPv4 addresses only\n    -6, --ipv6            use IPv6 addresses only\n    --negotiation-tip <revision>\n                          report that we have only objects reachable from this object\n    --negotiate-only      do not fetch a packfile; instead, print ancestors of negotiation tips\n    --filter <args>       object filtering\n    --auto-maintenance    run 'maintenance --auto' after fetching\n    --auto-gc             run 'maintenance --auto' after fetching\n    --show-forced-updates\n                          check for forced-updates on all updated branches\n    --write-commit-graph  write the commit-graph after fetching\n    --stdin               accept refspecs from stdin\n\n"

Compare with 3.18:

❯ docker run -it alpine:3.18 sh -c "apk add git && git version && git fetch -h | grep porcelain"
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/9) Installing ca-certificates (20240226-r0)
(2/9) Installing brotli-libs (1.0.9-r14)
(3/9) Installing libunistring (1.1-r1)
(4/9) Installing libidn2 (2.3.4-r1)
(5/9) Installing nghttp2-libs (1.57.0-r0)
(6/9) Installing libcurl (8.5.0-r0)
(7/9) Installing libexpat (2.6.2-r0)
(8/9) Installing pcre2 (10.42-r1)
(9/9) Installing git (2.40.1-r0)
Executing busybox-1.36.1-r5.trigger
Executing ca-certificates-20240226-r0.trigger
OK: 18 MiB in 24 packages
git version 2.40.1

And 3.19:

❯ docker run -it alpine:3.19 sh -c "apk add git && git version && git fetch -h | grep porcelain"
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
(1/10) Installing ca-certificates (20240226-r0)
(2/10) Installing brotli-libs (1.1.0-r1)
(3/10) Installing c-ares (1.27.0-r0)
(4/10) Installing libunistring (1.1-r2)
(5/10) Installing libidn2 (2.3.4-r4)
(6/10) Installing nghttp2-libs (1.58.0-r0)
(7/10) Installing libcurl (8.5.0-r0)
(8/10) Installing libexpat (2.6.2-r0)
(9/10) Installing pcre2 (10.42-r2)
(10/10) Installing git (2.43.0-r0)
Executing busybox-1.36.1-r15.trigger
Executing ca-certificates-20240226-r0.trigger
OK: 18 MiB in 25 packages
git version 2.43.0
    --[no-]porcelain      machine-readable output

Because #7111 requires the git --porcelain flag, we can upgrade to alpine 3.19 to get this.

Alternatively, if this breaks something for some reason, we could potentially find another way, and avoid using the newer option (though I'd rather not do this if possible).

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested review from sipsma and vito and removed request for sipsma May 8, 2024 16:23
@jedevc jedevc marked this pull request as draft May 9, 2024 11:07
Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants