← Back to issue list

snap: git version included in snap is too old

View original Github issue

Metadata

Project
charmcraft
Number
#875
Type
issue
State
closed
Author
coreycb
Labels
Created
Updated
Closed

Current evaluation

Resolved in charmcraft snap v2.1. The conflict arose from a GIT_EXEC_PATH environment variable pointing to an outdated git binary. Verified fixed on latest/edge and closed.

Suggested action:

No scores available.

Issue body

This seems to be similar to: https://github.com/juju/charm-tools/issues/625 Full details for recreating the issue are at the end of this description. Essentially in order to use git from charmcraft, pip needs to be pinned. Modern pip versions use git arguments that did not exist on older versions. Digging further in the charmcraft container I see: ``` root@charmcraft-cinder-lvm-8670388-0-0-amd64:~# /snap/charmcraft/x2/git/git-core/git --no-write-fetch-head unknown option: --no-write-fetch-head usage: git [--version] [--help] [-C <path>] [-c <name>=<value>] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] ``` Full details: I'm hitting this on the following charm-cinder-lvm change. Note that it only occurs when the pin for pip<20.3 in charm-cinder-lvm/pip.sh is removed: https://review.opendev.org/c/openstack/charm-cinder-lvm/+/858566 ``` /tmp/charm-cinder-lvm$ tox -e build [21458/73924] build run-test-pre: PYTHONHASHSEED='0' build run-test: commands[0] | charmcraft clean Cleaned project 'cinder-lvm'. build run-test: commands[1] | charmcraft -v pack Starting charmcraft version 2.0.0 Logging execution to '/home/corey/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220923-161458.987807.log' Packing the charm. Skipping 'bases[1].build-on[0]': host architecture 'amd64' not in base architectures ['arm64']. No suitable 'build-on' environment found in 'bases[1]' configuration. Skipping 'bases[2].build-on[0]': host architecture 'amd64' not in base architectures ['ppc64el']. No suitable 'build-on' environment found in 'bases[2]' configuration. Skipping 'bases[3].build-on[0]': host architecture 'amd64' not in base architectures ['s390x']. No suitable 'build-on' environment found in 'bases[3]' configuration. Skipping 'bases[5].build-on[0]': host architecture 'amd64' not in base architectures ['arm64']. No suitable 'build-on' environment found in 'bases[5]' configuration. Skipping 'bases[6].build-on[0]': host architecture 'amd64' not in base architectures ['ppc64el']. No suitable 'build-on' environment found in 'bases[6]' configuration. Skipping 'bases[7].build-on[0]': host architecture 'amd64' not in base architectures ['s390x']. No suitable 'build-on' environment found in 'bases[7]' configuration. Launching environment to pack for base name='ubuntu' channel='22.04' architectures=['amd64'] (may take a while the first time but it's reusable) Packing the charm Starting charmcraft version 2.0.0 Logging execution to '/tmp/charmcraft.log' Packing the charm. Building charm in '/root' Running step PULL for part 'charm' Execute action Running step OVERLAY for part 'charm' Execute action Running step BUILD for part 'charm' Execute action :: + apt-get install ca-certificates -y :: Reading package lists... :: Building dependency tree... :: Reading state information... :: ca-certificates is already the newest version (20211016). :: The following packages were automatically installed and are no longer required: :: libexpat1-dev libffi-dev libjs-jquery libjs-sphinxdoc libjs-underscore :: libmpdec3 libpython3-dev libpython3-stdlib libpython3.10 libpython3.10-dev :: libpython3.10-minimal libpython3.10-stdlib libssl-dev media-types python3 :: python3-dev python3-distlib python3-distutils python3-filelock :: python3-importlib-metadata python3-lib2to3 python3-minimal :: python3-more-itertools python3-packaging python3-pip python3-pip-whl :: python3-pkg-resources python3-platformdirs python3-pluggy python3-py :: python3-pyparsing python3-setuptools python3-setuptools-whl python3-six :: python3-toml python3-venv python3-virtualenv python3-wheel python3-wheel-whl :: python3-zipp python3.10 python3.10-dev python3.10-minimal python3.10-venv :: tox zlib1g-dev :: Use 'apt autoremove' to remove them. :: 0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded. :: + tox -e build-reactive :: build-reactive create: /root/parts/charm/build/.tox/build-reactive :: build-reactive installdeps: -r/root/parts/charm/build/requirements.txt :: ERROR: invocation failed (exit code 1), logfile: /root/parts/charm/build/.tox/build-reactive/log/build-reactive-1.log :: ================================== log start =================================== :: Collecting git+https://github.com/juju/charm-tools.git (from -r /root/parts/charm/build/requirements.txt (line 6)) :: Cloning https://github.com/juju/charm-tools.git to /root/snap/charmcraft/common/pip-req-build-7pzqg9l5 :: Running command git clone --filter=blob:none --quiet https://github.com/juju/charm-tools.git /root/snap/charmcraft/common/pip-req-build-7pzqg9l5 :: error: unknown option `no-write-fetch-head' :: usage: git fetch [<options>] [<repository> [<refspec>...]] :: or: git fetch [<options>] <group> :: or: git fetch --multiple [<options>] [(<repository> | <group>)...] :: or: git fetch --all [<options>] :: [21394/73924] :: -v, --verbose be more verbose :: -q, --quiet be more quiet :: --all fetch from all remotes :: --set-upstream set upstream for git pull/fetch :: -a, --append append to .git/FETCH_HEAD instead of overwriting :: --upload-pack <path> path to upload pack on remote end :: -f, --force force overwrite of local reference :: -m, --multiple fetch from multiple remotes :: -t, --tags fetch all tags and associated objects :: -n do not fetch all tags (--no-tags) :: -j, --jobs <n> number of submodules fetched in parallel :: -p, --prune prune remote-tracking branches no longer on remote :: -P, --prune-tags prune local tags no longer on remote and clobber changed tags :: --recurse-submodules[=<on-demand>] :: control recursive fetching of submodules :: --dry-run dry run :: -k, --keep keep downloaded pack :: -u, --update-head-ok allow updating of HEAD ref :: --progress force progress reporting :: --depth <depth> deepen history of shallow clone :: --shallow-since <time> :: deepen history of shallow repository based on time :: --shallow-exclude <revision> :: deepen history of shallow clone, excluding rev :: --deepen <n> deepen history of shallow clone :: --unshallow convert to a complete repository :: --update-shallow accept refs that update .git/shallow :: --refmap <refmap> specify fetch refmap :: -o, --server-option <server-specific> :: option to transmit :: -4, --ipv4 use IPv4 addresses only :: -6, --ipv6 use IPv6 addresses only :: --negotiation-tip <revision> :: report that we have only objects reachable from this object :: --filter <args> object filtering :: --auto-gc run 'gc --auto' after fetching :: --show-forced-updates :: check for forced-updates on all updated branches :: --write-commit-graph write the commit-graph after fetching :: :: error: unknown option `no-write-fetch-head' ```

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 Resolved in charmcraft snap v2.1. The conflict arose from a GIT_EXEC_PATH environment variable pointing to an outdated git binary. Verified fixed on latest/edge and closed.
qwen/qwen3.6-35b-a3b Fixed in charmcraft snap v2.1. The bundled git version and conflicting GIT_EXEC_PATH variable caused command failures. Verification on the latest/edge snap confirmed the fix, and the issue was closed.
qwen3.6-35b-a3b-mtp-q6 Fixed in charmcraft snap v2.1. An outdated bundled git and conflicting GIT_EXEC_PATH variable caused pip failures. Updating to the latest/edge snap resolved the conflict. Author verified the fix and closed the issue.
qwen3.6-35b-a3b-mtp-q6 Resolved in the latest/edge snap channel by fixing GIT_EXEC_PATH conflicts with system git. The author confirmed the fix works, and the issue was closed ahead of the v2.1 candidate release.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#55 `charmcraft build` breaks when pip packages come from github charmcraft closed The charmcraft snap lacked git, causing pip to fail when installing GitHub dependencies. Maintainers added preliminary git support in snap v0.2, resolving the issue. The reporter confirmed the fix works.
71%