Hi Sean,

Sean Whitton <spwhit...@spwhitton.name> writes:

> Hello,
>
> On Sun 08 Dec 2024 at 11:27pm -08, Xiyue Deng wrote:
>
>> Sean Whitton <spwhit...@spwhitton.name> writes:
>>
>>> Hello,
>>>
>>> On Sun 08 Dec 2024 at 05:02pm -08, Xiyue Deng wrote:
>>>
>>>> Package: dh-elpa
>>>> Version: 2.1.5
>>>> Severity: normal
>>>>
>>>> dh-elpa detects the `Package-Version' cookie from Elisp source files and
>>>> generates Debian version numbers to be used in the substitute variable
>>>> ${elpa:Depends}.  However there is a small issue that it does not work
>>>> well with snapshot version numbers.
>>>
>>> Here, do you mean ELPA snapshot version numbers or Debian snapshot
>>> version numbers?
>>>
>>
>> Here I mean the Debian snapshot version numbers, especially one with
>> "~", like `1.0.0~git20241207.dedbeaf'.
>>
>>> In the past when these sorts of issues have arisen, we have concluded
>>> that rather than trying to make dh_elpa too clever, we should just add a
>>> patch in debian/patches to fix the Package-Version header.
>>>
>>
>> I don't think that will help, because the Package-Version (e.g. 1.0.0)
>> will be considered higher than our snapshot version (1.0.0~git%cd.%h)
>> due to Debian's special handling of "~".  Bumping the version
>> Package-Version doesn't help as the snapshot version using "~" will
>> always be considered lower.  Unless we change the version to
>> `1.0.0git%cd.%h' or `1.0.0+git%cd.%h', that is.
>>
>> Or maybe I missed something?
>
> Oh, in this case we've basically just ignored the package version :)
>
> What is the user impact of the current behaviour?
>

I think if we don't append the "~" to the generated version numbers, our
package cannot use "~" based versions like `1.0.0~git%cd.%h', or it may
not meet the requirement.

[ I forgot to mention: I encountered this issue while working on
  emacs-lsp-docker and dap-mode.  dap-mode 0.8 requires `((lsp-docker
  "1.0.0"))', while emacs-lsp-docker does not have any tag.  I uploaded
  lsp-docker with version `1.0.0~git20240806.ce291d0-1', but dap-mode
  piuparts fails as `emacs-lsp-docker (>= 1.0.0)' cannot be met due to
  this restriction.  I have made another upload with version
  `1.0.0git20240806.ce291d0-1' to workaround this, as in case upstream
  tags `1.0.0' I can still use `1.0.0+git%cd.%h' to increase the version
  number. ]

As currently this is not causing any issue for existing packages yet, a
mass rebuild is not necessarily required.  Though I'm afraid that if we
patch dh-elpa with the proposed fix it may make existing packages fail
reproducible build tests as the d/control contents will change.

Another way is to just let apt automatically add "~" to version
handling, which has the benefit of making all version numbers also
backport friendly by default.  But that may be a longer shot :P

> -- 
> Sean Whitton

-- 
Regards,
Xiyue Deng

Attachment: signature.asc
Description: PGP signature

Reply via email to