juju / charm-tools

Tools for charm authors and maintainers
Other
42 stars 64 forks source link

Failed to get version when building charm with version 3.0.7 #673

Open dosaboy opened 4 months ago

dosaboy commented 4 months ago

Using charm-tools 3.0.7 (+git-0-b7128ec)

Getting the following error building the ovn-central charm:

:: charmtools.build.tactics: Copying Interface prometheus_scrape: /root/parts/charm/build/ovn-central/hooks/relations/prometheus_scrape
:: charmtools.build.tactics: Trying to determine version with: git
:: utils: b'fatal: not a git repository (or any of the parent directories): .git\n'
:: utils: process: git describe --dirty --always (128)
:: charmtools.build.tactics: Failed to get version
:: charmtools.build.tactics: Trying to determine version with: bzr
:: charmtools.build.tactics: [Errno 2] No such file or directory: 'bzr'
:: charmtools.build.tactics: Trying to determine version with: hg
:: charmtools.build.tactics: [Errno 2] No such file or directory: 'hg'
:: build:
:: build: ---------------------------------------
:: build: Build Report
:: build: ---------------------------------------
:: build: New build; all files were modified.
:: build: Cleaning up /root/.cache/charm/977
:: proof: I: display-name not provided, add for custom naming in the UI
:: proof: I: DEPRECATED: series parameter is ignored by charmcraft,use bases in charmcraft.yaml

dosaboy commented 4 months ago

The above was from charmcraft, if i run it manually it fails at the same point:

$ charm build
build: Build dir not specified via command-line or environment; defaulting to /tmp/charm-builds
build: The lockfile /home/ubuntu/git/ovn-central/src/build.lock was not found; building using latest versions.
build: Destination charm directory: /tmp/charm-builds/ovn-central
build: Processing layer: layer:options
build: Processing layer: layer:basic
build: Processing layer: layer:openstack
build: Processing layer: layer:leadership
build: Processing layer: layer:coordinator
build: Processing layer: layer:snap
build: Processing layer: ovn-central (from .)
build: Processing interface: tls-certificates
build: Processing interface: nrpe-external-master
build: Processing interface: ovsdb
build: Processing interface: ovsdb-cluster
build: Processing interface: ovsdb-cluster
build: Processing interface: ovsdb-cms
build: Processing interface: prometheus_scrape
^\/snap/charm/745/bin/wrappers/charm: line 84: 51356 Quit                    (core dumped) charm-$@
dosaboy commented 4 months ago

hmm a second attempt of the build did succeed. The version that charmcraft is using is one commit behind HEAD:

$ git cherry -v b7128ec

But that does not seem related to the issue.

dosaboy commented 4 months ago

The latest version of the charm snap in 3.x/stable does not contain the above patch and I think that is the reason why charmcraft buildis failing in CI but not when run the build locally. When I run it locally I get setuptools 59.6.0-1.2ubuntu0.22.04.1 but in the CI it needs that upgrade step to get the same version hence why it is failing. So we need to get a new build of this snap that include that patch so that charmcraft can consume it.

dosaboy commented 4 months ago

tested with the latest version that includes that patch and it still fails