openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 183 forks source link

build-recipe-dsc should only copy out one debian .dsc source package #928

Closed nickbroon closed 4 months ago

nickbroon commented 1 year ago

When OBS-DCH-RELEASE: 1 is present in a .dsc file, (be that directly from the source, or injected into the .dsc by something like the gbp_scm source service) then dsc_build() in build-recipe-dsc will generate a new .dsc with the modified version, and since the merge of d995de1 dsc_move_build_result() will copy out both original and new one generated .dsc that is list listed in the .changes files. Only one of these should be copied out.

As originally described in https://github.com/openSUSE/obs-build/pull/717#issue-980338650 only one should be copied out as it cause issues for the source service and schedular (and also potentially for other external debian apt tools that consume the projects apt repository).

See https://github.com/openSUSE/obs-build/pull/717#issuecomment-1511734621 for further discussion around this, and what behaviour should be.

I think there are two options, though I'm unsure which would be correct desire behaviour build-recipe-dsc should follow when the OBS-DCH-RELEASE option is present, either copy our the original .dsc or copy out the generated .dsc. But it should not copy out both. (Prior to https://github.com/openSUSE/obs-build/commit/d995de1d71e332c28a3390aac9c0242f17790a87 it would only ever copy out the original .dsc, but since then it now parses the .changes it also copies the generated .dsc).

To only copy out the original .dsc, then having build-recipe-dsc not even generate a new one with the modified version can be done with changes like those proposed by @gollub in: https://github.com/openSUSE/obs-build/pull/717/files which passes -b to dpkg-buildpackage (@smcv expands on this suggesting --build=any,all here :https://github.com/openSUSE/obs-build/pull/717#issuecomment-1512754612). Or to only copy out the new generated .dsc with the modified version then changes like those proposed here: https://github.com/openSUSE/obs-build/pull/717#issuecomment-1511734621 would achieve that.

I'm unsure which is appropriate approach to use to fix this issue.

smcv commented 1 year ago

smcv expands on this suggesting --build=any,all here

No, I think -b would be the right option to use if going in that direction: it's functionally equivalent to --build=any,all but more compatible with older dpkg versions. I only quoted the newer --build=x,y versions because they're easier to understand!

adrianschroeter commented 4 months ago

merge your patch, thanks!