← Back to issue list

Charmcraft doesn't allow to pull non-published operator framework

View original Github issue

Metadata

Project
charmcraft
Number
#555
Type
issue
State
closed
Author
dasm
Labels
—
Created
Updated
Closed

Current evaluation

Closed as a duplicate of canonical/charmcraft#498; Git-based Python requirements work when git is declared in the charm part's build-packages.

Resolution: closed superseded

Reason: Maintainer cmatsuoba identified canonical/charmcraft#498 as the duplicate and confirmed there that Git-based dependencies require git in build-packages. Documentation improvements were subsequently planned.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Latest operator framework release is dated on Apr 21, 2021: `1.2.0`. In the meantime there were updates similar to https://github.com/canonical/operator/issues/558 where recommended way of fetching those is to add `git+git://github.com/canonical/operator@72fd89cb92750a4f1674818bf8d10d43e9f85f5e#egg=ops` It worked on on Jun 28, but now it stopped working. When using `ops` in `requirements.txt` everything is fine, but it doesn't work with custom git commit due to missing `git` command in lxd container. ``` dasm@test:~/charm-opensearch-k8s$ charmcraft version 1.2.1 ``` ``` mm 2021-09-27 20:34:52,770 craft_parts.executor.step_handler DEBUG :: Running external command ['pip3', '--version'] mm 2021-09-27 20:34:53,322 craft_parts.executor.step_handler DEBUG :: :: pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) mm 2021-09-27 20:34:53,363 craft_parts.executor.step_handler DEBUG :: Running external command ['pip3', 'install', '--target=/root/project/build/parts/charm/install/venv', '--requirement=requirements.txt'] mm 2021-09-27 20:34:54,095 craft_parts.executor.step_handler DEBUG :: :: Collecting ops mm 2021-09-27 20:34:54,096 craft_parts.executor.step_handler DEBUG :: :: Cloning git://github.com/canonical/operator (to revision ae26301b1903719431e849d0d688fee727f9dc81) to /tmp/pip-install-jmwj66jk/ops mm 2021-09-27 20:34:54,096 craft_parts.executor.step_handler DEBUG :: :: Running command git clone -q git://github.com/canonical/operator /tmp/pip-install-jmwj66jk/ops mm 2021-09-27 20:34:54,098 craft_parts.executor.step_handler DEBUG :: :: ERROR: Error [Errno 2] No such file or directory: 'git' while executing command git clone -q git://github.com/canonical/operator /tmp/pip-install-jmwj66jk/ops mm 2021-09-27 20:34:54,099 craft_parts.executor.step_handler DEBUG :: :: ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH? mm 2021-09-27 20:34:54,151 craft_parts.executor.step_handler DEBUG :: Executing ['pip3', 'install', '--target=/root/project/build/parts/charm/install/venv', '--requirement=requirements.txt'] failed with return code 1 mm 2021-09-27 20:34:54,152 craft_parts.executor.step_handler DEBUG :: Traceback (most recent call last): mm 2021-09-27 20:34:54,152 craft_parts.executor.step_handler DEBUG :: File "/snap/charmcraft/x7/lib/charmcraft/charm_builder.py", line 334, in <module> mm 2021-09-27 20:34:54,152 craft_parts.executor.step_handler DEBUG :: main() mm 2021-09-27 20:34:54,153 craft_parts.executor.step_handler DEBUG :: File "/snap/charmcraft/x7/lib/charmcraft/charm_builder.py", line 330, in main mm 2021-09-27 20:34:54,153 craft_parts.executor.step_handler DEBUG :: builder.build_charm() mm 2021-09-27 20:34:54,153 craft_parts.executor.step_handler DEBUG :: File "/snap/charmcraft/x7/lib/charmcraft/charm_builder.py", line 90, in build_charm mm 2021-09-27 20:34:54,153 craft_parts.executor.step_handler DEBUG :: self.handle_dependencies() mm 2021-09-27 20:34:54,154 craft_parts.executor.step_handler DEBUG :: File "/snap/charmcraft/x7/lib/charmcraft/charm_builder.py", line 244, in handle_dependencies mm 2021-09-27 20:34:54,158 craft_parts.executor.step_handler DEBUG :: raise CommandError("problems installing dependencies") mm 2021-09-27 20:34:54,159 craft_parts.executor.step_handler DEBUG :: charmcraft.cmdbase.CommandError: problems installing dependencies mm 2021-09-27 20:34:54,185 charmcraft ERROR Parts processing error: Failed to run the build script for part 'charm'. (full execution logs in '/tmp/charmcraft.log') ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of canonical/charmcraft#498; Git-based Python requirements work when git is declared in the charm part's build-packages.
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of canonical/charmcraft#498; Git-based Python dependencies work when git is added to the charm part's build-packages configuration.
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of canonical/charmcraft#498: git-based Python dependencies require git in build-packages; documentation improvements were planned.
qwen3.6-35b-a3b-mtp-q6 — — Superseded as a duplicate of issue #498. The build environment lacks git, blocking git-based dependency installation. Users are directed to issue #498 and a Charmhub forum post for workarounds, with documentation updates planned to clarify the limitation.
qwen/qwen3.6-35b-a3b — — Closed as a duplicate of issue #498. Charmcraft fails to install git-based dependencies due to a missing git command in the build container. The issue was resolved by referencing an existing workaround and planned documentation updates.
qwen3.6-35b-a3b-mtp-q6 — — Superseded as a duplicate of issue #498. Resolved by referencing the linked forum post and existing issue for git dependency workarounds. Documentation updates were planned to clarify the limitation.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/charmcraft#498 (confidence 100%)

    The maintainer explicitly redirected this report to #498, which documents adding git to build-packages.

Related issues

Issue Project State Summary Similarity
#498 charmcraft 1.2.1 (candidate): cannot pull python deps with git charmcraft closed Reported that charmcraft 1.2.1 fails with "Cannot find command 'git'" when pulling Git-based Python deps. Maintainer facundobatista closed it as config: add git to build-packages (see Charm Discourse thread 4986); no code change.
74%
#696 Allow for modifications to build environment of "charmcraft build" to accomodate for extra prerequisites charmcraft closed Closed as already supported: charm-python-packages installs Python prerequisites before charm requirements. Ordering was later made explicit in Charmcraft 3.2 by PR #1727.
70%