jenkins-debian-glue icon indicating copy to clipboard operation
jenkins-debian-glue copied to clipboard

Preperation of orig.tar.gz with --git-overlay enabled

Open andrewharle opened this issue 4 years ago • 5 comments

Hi, I receive an error gbp:error: Overlay must be used with --git-export-dir.

I have a repository with debian/gbp.conf as follows:

[DEFAULT]
upstream-tag = v%(version)s

[buildpackage]
overlay = True
export-dir = ../build-area

In the generate-git-snapshot script, --git-export-dir is unset. I was able to continue successfully with the build by overriding GBP_OPTS and explicitly setting --git-export-dir=../. I'm concerned however that this might break something else?

https://github.com/mika/jenkins-debian-glue/blob/ab257812d542d3c779abcb3a235fd82bc9e05f4a/scripts/generate-git-snapshot#L63

For an example of this behaviour, try to build the https://packages.debian.org/source/buster/skalibs package.

Thanks,

andrewharle avatar Mar 29 '20 13:03 andrewharle

The export-dir = ../build-area configuration would cause the files ending up in an unexpected directory (from jenkins-debian-glue's point of view), that's why we have an explicit --git-export-dir= call in our default $GBP_OPTS.

@andrewharle: AFAIK I don't use overlay = True anywhere though, are you managing only the debian/ directory within git, or what's the rational for this? Your change regarding --git-export-dir=../ makes sense to me, maybe we should even use and set this as a default in jenkins-debian-glue then?

@agx might I ask you - with your gbp hat on :) - about your opinion on that matter? Is there any reason coming to your mind, why we shouldn't explicitly set and force --git-export-dir to an explicit directory? (BTW: for me the gbp:error: Overlay must be used with --git-export-dir was confusing at first, as we set the option but to an empty value. Is the error message something we should maybe clarify in the wording?)

mika avatar Mar 31 '20 16:03 mika

@agx might I ask you - with your gbp hat on :) - about your opinion on that matter? Is there any reason coming to your mind, why we shouldn't explicitly set and force --git-export-dir to an explicit directory?

it could say gbp:error: Overlay must be used with non-empty --git-export-dir (since from gbp's view "" is the same as unset).

Regarding overlay builds. To support these export-dir needs to be set so gbp knows where to overlay to so a possible solution might be to check gbp config buildpackage.overlay and only set build-area in that case to non-empty value.

agx avatar Mar 31 '20 17:03 agx

Thank you @agx for your valuable feedback! I implemented what you suggested at https://github.com/mika/jenkins-debian-glue/pull/231 - as noted in its commit message, it seems to make a different whether the option is set to --git-export-dir=/.. or if its unset (--git-export-dir=). Does this make sense for you?

@andrewharle can you confirm that with https://github.com/mika/jenkins-debian-glue/pull/231 it works for you as expected?

mika avatar Apr 14 '20 16:04 mika

@mika you mean --export-dir=../ ? That should make a difference since unset means don't export anything while expoting to ../ would export to a random dir in .. and then rename (which will likely fail since the dir already exists)

agx avatar Apr 17 '20 09:04 agx

@mika Thanks for the comments. I've tested the pull request #231 and posted my observations.

andrewharle avatar Apr 27 '20 20:04 andrewharle