ottok / debcraft

Mirror of https://salsa.debian.org/debian/debcraft
https://salsa.debian.org/debian/debcraft
2 stars 1 forks source link

debcraft release fails for native package with format quilt and non-native versioning #4

Open venthur opened 2 months ago

venthur commented 2 months ago

Trying to debcraft release on one of my projects yields this error and it is unclear what it means or what to do with it:

$ debcraft release
Running in path /home/venthur/Documents/projects/dotenv-cli that has Debian package sources for 'dotenv-cli'
Use 'podman' container image 'debcraft-dotenv-cli-debian-sid' for package 'dotenv-cli'
Building container 'debcraft-dotenv-cli-debian-sid' in '/home/venthur/Documents/projects/debcraft-container-dotenv-cli' for build ID '1720857220.3ea6dc1+master'
STEP 1/12: FROM debian:sid
STEP 2/12: ENV DEBIAN_FRONTEND=noninteractive
--> Using cache 2b4db584c0add2045e6bfe14ec7adc7b66679854b8ffa5f082c10af050304b44
--> 2b4db584c0ad
STEP 3/12: RUN apt-get update -q &&     apt-get install -q --yes --no-install-recommends     blhc     ccache     curl     devscripts     eatmydata     equivs     fakeroot     git     git-buildpackage     lintian     pristine-tar
--> Using cache c73891936c806305729cf558868a0d03408825b1928871ac644587cdc5d5abe6
--> c73891936c80
STEP 4/12: RUN apt-get install -q --yes --no-install-recommends   diffoscope-minimal   python3-debian   shellcheck   xxd
--> Using cache 63d15bdca953bbf8b4ff4864b83f49b1210616e034b460c954b527d00989aa02
--> 63d15bdca953
STEP 5/12: COPY control /
--> Using cache 85052ed526ffd3b8cb2d64924701a8cd47392cf0b1648d05745f11dac7ca2be5
--> 85052ed526ff
STEP 6/12: RUN apt-get update -q &&     DEBIAN_FRONTEND=noninteractive mk-build-deps -r -i /control     -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends'
--> Using cache 6734ed1a3ec751b724ecac8b31060fcb3c05486a778bbf156ebb7416a54d2ce5
--> 6734ed1a3ec7
STEP 7/12: RUN update-ccache-symlinks
--> Using cache 804e0a06d93351e1a2a924fb5cd9b382922987b5367662f18d7d61307aa0d100
--> 804e0a06d933
STEP 8/12: RUN ccache --show-stats  --verbose || true
--> Using cache cafb513ea9dba8cc9d56a937fb3173c24cafac1c69617fb3f67a40f13f62179c
--> cafb513ea9db
STEP 9/12: COPY enable-source-repositories.sh /enable-source-repositories
--> Using cache 15e06d2ace998c648e999c1f5df60682645dc09ff2e23f716c71d870048222c4
--> 15e06d2ace99
STEP 10/12: RUN /enable-source-repositories
--> Using cache bc2c69402c248a027b0012ab910c10cf0ad50f4e000a40a6b13a60f50c3d48eb
--> bc2c69402c24
STEP 11/12: RUN apt-get install -q --yes command-not-found &&     apt-get update -q
--> Using cache 49e77c5f55a5dfe1533427a97fed7ade49787a82dd135471d19f73634b35000b
--> 49e77c5f55a5
STEP 12/12: COPY *.sh /
--> Using cache dc42d83f71acef2440dd604f26e693b4d4044d1f6522f755db7699c66951d518
COMMIT debcraft-dotenv-cli-debian-sid
--> dc42d83f71ac
Successfully tagged localhost/debcraft-dotenv-cli-debian-sid:latest
dc42d83f71acef2440dd604f26e693b4d4044d1f6522f755db7699c66951d518
Building source package for release at /home/venthur/Documents/projects/debcraft-release-dotenv-cli-1720857220.3ea6dc1+master
gbp:error: upstream/3.3.1 is not a valid treeish
ERROR: Source build failed - see logs in file:///home/venthur/Documents/projects/debcraft-release-dotenv-cli-1720857220.3ea6dc1+master for details

The logs mentioned in the last line is just a single empty file. The package I'm trying to release is: https://github.com/venthur/dotenv-cli -- just run it on latest master equivalent to the latest tag 3.3.1. I'm not consciously using gbp or anything to maintain that package in git. However, I am upstream and DD at the same time.

ottok commented 2 months ago

Thanks for reporting this! It is indeed git-buildpackage that emits this nag:

± gbp buildpackage -S
gbp:error: upstream/3.3.1 is not a valid treeish

This is correct behavior by git-buildpackage as it thinks that the 'master' branch is the Debian packaging branch but it is in reality the upstream branch.

What is the Debian branch for this package?

ottok commented 2 months ago

Looking at https://github.com/venthur/dotenv-cli/branches there is no separation between upstream and Debian package. However the format is not native (but quilt) and versioning scheme has Debian-specific revisions.

± cat debian/source/format 
3.0 (quilt)

Looking at the tags it seems that this indeed should be a native package and not have Debian revisions at all? The git history is not linear and is written in a way that is hard to read, gitk screenshot attached.

image

venthur commented 2 months ago

Correct,

as I said. I happen to be upstream and Debian Developer at the same time, so it is convenient for me to have the debian dir directly in the "upstream" code. The package is not "native" as it is obviously not a debian-only package. E.g. the dotenv command is generally useful for developers.

Not sure why gbp is failing here, I have never used gpb for any of my packages.

Cheers!

ottok commented 2 months ago

The git-buildpackage failure is due to it not finding the upstream branch. It is correct for it to fail, as you are have no upstream branch/tag, but instead only Debian releases, yet the package is not marked as being 'native'.

venthur commented 2 months ago

It is correct for it to fail, as you are have no upstream branch/tag, but instead only Debian releases, yet the package is not marked as being 'native'.

Yes, but again, this is not a "native" package as per Debian's definition:

A native Debian package is the rare Debian binary package format. It may be used only when the package is useful and valuable only for Debian. Thus, its use is generally discouraged.

It does say further down:

A native Debian package has no separation between the upstream code and the Debian changes and consists only of the following:

But this is just a consequence of the first statement.

In my case, the package is definitely not native -- as it is not a Debian only package. It just happens to fulfill the second part as I am upstream and Debian package maintainer at the same time.

This might be an edge case, but a case that is not handled well by gbp. pdebuild + cowbuilder seem to have no issue with this setup and build the package just fine.