← Back to issue list

Install `git` inside core24 build environments

View original Github issue

Metadata

Project
snapcraft
Number
#4944
Type
issue
State
closed
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Git was bundled for core24 build environments by merged PR #5149 (commit c7d11ac65), making it available as craft.git on Snapcraft's build PATH.

Resolution: closed resolved

Reason: PR #5149 merged as commit c7d11ac65 and added a bundled Git binary as craft.git. The maintainer explicitly identified that PR as the fix before closing the issue.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done 1. Update [`snapcraft.services.provider.setup()`](https://github.com/canonical/snapcraft/blob/4ee3c1493aec801c9b1e6737e51c877b3e03dc79/snapcraft/services/provider.py#L28) to install `git`: ```diff diff --git a/snapcraft/services/provider.py b/snapcraft/services/provider.py index 2ed2b590..e28b730c 100644 @@ -26,6 +26,12 @@ class Provider(ProviderService): @overrides def setup(self) -> None: + """Snapcraft-specific setup.""" + # required for apt gpg and `version: git` + self.packages.extend(["gpg", "dirmngr", "git"]) + if build_info := os.getenv("SNAPCRAFT_BUILD_INFO"): self.environment["SNAPCRAFT_BUILD_INFO"] = build_info if image_info := os.getenv("SNAPCRAFT_IMAGE_INFO"): ``` 2. Update the compatibility tag in snapcraft (blocked by https://github.com/canonical/craft-application/issues/105) ### Why it needs to get done - To allow `version: git` and other `git` calls to work inside the build environment - [Parity with core22](https://github.com/canonical/snapcraft/blob/4ee3c1493aec801c9b1e6737e51c877b3e03dc79/snapcraft/providers.py#L210)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Git was bundled for core24 build environments by merged PR #5149 (commit c7d11ac65), making it available as craft.git on Snapcraft's build PATH.
stealth/space-bunny-alpha — closed resolved Resolved by merged PR canonical/snapcraft#5149 (commit c7d11ac65), which bundled Git as craft.git, enabling version: git and other Git operations in core24 build environments.
stealth/space-bunny-alpha — closed resolved Git support for core24 builds was added by merged PR canonical/snapcraft#5149, commit c7d11ac65, which bundled git as craft.git in Snapcraft.
qwen/qwen3.6-35b-a3b — — Fixed by bundling git in PR #5149, enabling version: git support and parity with core22 in core24 build environments.
qwen/qwen3.6-35b-a3b — — Resolved via PR #5149, which bundles git in the core24 build environment. This enables version: git usage and maintains parity with core22.
qwen/qwen3.6-35b-a3b — — Fixed by bundling git in PR #5149, enabling version: git and other git commands in core24 build environments.
qwen3.6-35b-a3b-mtp-q6 — — Resolved by bundling git in PR #5149, enabling git usage inside core24 build environments and achieving parity with core22.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#5149 (confidence 100%)

    Merged PR #5149 added the bundled craft.git client and corresponding spread tests.

Related issues

Issue Project State Summary Similarity
#4805 `version: git` does not work in core24 snapcraft closed version: git failed on core24 because git was missing. Fixed by merging PR #5149 (commit c7d11ac65), which bundles a git binary as craft.git in $SNAP/libexec/snapcraft, with new spread tests.
81%
#1720202 the snapcore/snapcraft image doesn't have git installed snapcraft (launchpad) closed Git was added to the Snapcraft build Dockerfile by merged PR snapcore/snapcraft#1575 (commit 8910ec250), enabling version: git.
75%
#1802899 git package missing from build VM images snapcraft (launchpad) closed Snapcraft began automatically adding git to build-packages for version: git, fixing builds on VMs without git; merged in snapcore/snapcraft#2403 as a5719521c.
74%
#1137 Build-depend on git snapcraft merged Merged in canonical/snapcraft#1137 (commit 8b3cb387d), adding git as a direct build dependency so Git source tests can invoke git.
70%