public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* Version string of package
@ 2023-01-13 11:52 Takashi Yano
  2023-01-13 13:22 ` Jon Turney
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2023-01-13 11:52 UTC (permalink / raw)
  To: cygwin-apps

Hi,

Is it allowed to include '-' in version string (e.g. '20230113-stable')?
I'm asking because mksetupini warns:

mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version

though it works as expected.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version string of package
  2023-01-13 11:52 Version string of package Takashi Yano
@ 2023-01-13 13:22 ` Jon Turney
  2023-01-13 14:21   ` Takashi Yano
  2023-01-17 23:59   ` Adam Dinwoodie
  0 siblings, 2 replies; 6+ messages in thread
From: Jon Turney @ 2023-01-13 13:22 UTC (permalink / raw)
  To: Takashi Yano, cygwin-apps

On 13/01/2023 11:52, Takashi Yano via Cygwin-apps wrote:
> Hi,
> 
> Is it allowed to include '-' in version string (e.g. '20230113-stable')?
> I'm asking because mksetupini warns:
> 
> mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version
> 
> though it works as expected.

Short answer:

It's a bug that this isn't a fatal error.  Please don't do it!

Long answer:

Package naming in Cygwin has a long and tangled history. This isn't 
explicitly precluded by the rules at [1], but probably should be.

(Fedora, which we generally follow for packaging rules, now doesn't 
allow '-' in versions, just digits, letters and '.')

We need to be able to unambiguously separate a NVR string into the 
package name, version and release.

Underscores are allowed in package names, so the simple approach of 
splitting on the rightmost two hyphens would work, if we don't allow 
exceptions like this.

(We can get it right in this case, because we have a piece of extra 
information: the directory the package is in, which happens to always be 
named N in the current scheme of things, but we might want to change that)

[1] https://cygwin.com/packaging-package-files.html


In any case, you should be suspicious of using upstream version names of 
this form.  They may expect the 'stable' string to sort against other 
strings based on meaning, rather than alphabetically (e.g. 
'20230113-testing' is considered greater, which is probably not what's 
wanted)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version string of package
  2023-01-13 13:22 ` Jon Turney
@ 2023-01-13 14:21   ` Takashi Yano
  2023-01-13 19:11     ` Brian Inglis
  2023-01-17 23:59   ` Adam Dinwoodie
  1 sibling, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2023-01-13 14:21 UTC (permalink / raw)
  To: cygwin-apps

On Fri, 13 Jan 2023 13:22:44 +0000
Jon Turney wrote:
> On 13/01/2023 11:52, Takashi Yano via Cygwin-apps wrote:
> > Hi,
> > 
> > Is it allowed to include '-' in version string (e.g. '20230113-stable')?
> > I'm asking because mksetupini warns:
> > 
> > mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version
> > 
> > though it works as expected.
> 
> Short answer:
> 
> It's a bug that this isn't a fatal error.  Please don't do it!
> 
> Long answer:
> 
> Package naming in Cygwin has a long and tangled history. This isn't 
> explicitly precluded by the rules at [1], but probably should be.
> 
> (Fedora, which we generally follow for packaging rules, now doesn't 
> allow '-' in versions, just digits, letters and '.')
> 
> We need to be able to unambiguously separate a NVR string into the 
> package name, version and release.
> 
> Underscores are allowed in package names, so the simple approach of 
> splitting on the rightmost two hyphens would work, if we don't allow 
> exceptions like this.
> 
> (We can get it right in this case, because we have a piece of extra 
> information: the directory the package is in, which happens to always be 
> named N in the current scheme of things, but we might want to change that)
> 
> [1] https://cygwin.com/packaging-package-files.html
> 
> 
> In any case, you should be suspicious of using upstream version names of 
> this form.  They may expect the 'stable' string to sort against other 
> strings based on meaning, rather than alphabetically (e.g. 
> '20230113-testing' is considered greater, which is probably not what's 
> wanted)

Thanks for the answer.

I'll use version 20230113 with release 1.g<git hash tag>
e.g. package-name-20230113-1.g123456789abc like
cygwin test package.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version string of package
  2023-01-13 14:21   ` Takashi Yano
@ 2023-01-13 19:11     ` Brian Inglis
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2023-01-13 19:11 UTC (permalink / raw)
  To: cygwin-apps

On 2023-01-13 07:21, Takashi Yano via Cygwin-apps wrote:
> On Fri, 13 Jan 2023 13:22:44 +0000
> Jon Turney wrote:
>> On 13/01/2023 11:52, Takashi Yano via Cygwin-apps wrote:
>>> Hi,
>>>
>>> Is it allowed to include '-' in version string (e.g. '20230113-stable')?
>>> I'm asking because mksetupini warns:
>>>
>>> mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version
>>>
>>> though it works as expected.
>>
>> Short answer:
>>
>> It's a bug that this isn't a fatal error.  Please don't do it!
>>
>> Long answer:
>>
>> Package naming in Cygwin has a long and tangled history. This isn't
>> explicitly precluded by the rules at [1], but probably should be.
>>
>> (Fedora, which we generally follow for packaging rules, now doesn't
>> allow '-' in versions, just digits, letters and '.')
>>
>> We need to be able to unambiguously separate a NVR string into the
>> package name, version and release.
>>
>> Underscores are allowed in package names, so the simple approach of
>> splitting on the rightmost two hyphens would work, if we don't allow
>> exceptions like this.
>>
>> (We can get it right in this case, because we have a piece of extra
>> information: the directory the package is in, which happens to always be
>> named N in the current scheme of things, but we might want to change that)
>>
>> [1] https://cygwin.com/packaging-package-files.html
>>
>>
>> In any case, you should be suspicious of using upstream version names of
>> this form.  They may expect the 'stable' string to sort against other
>> strings based on meaning, rather than alphabetically (e.g.
>> '20230113-testing' is considered greater, which is probably not what's
>> wanted)
> 
> Thanks for the answer.
> 
> I'll use version 20230113 with release 1.g<git hash tag>
> e.g. package-name-20230113-1.g123456789abc like
> cygwin test package.

We typically use *stable* commit dates of unambiguous commits or incremental 
versions rather than hashes even when packages are pulled from repos which do 
not provide releases e.g. ca-certificates, libhsts, publicsuffix-list.

We also have packages where the versions have been frozen for historical reasons 
and new versions have release numbers like 1.yyyymmdd, 2.YYYYMMDD, etc.

Status like stable is assumed of current releases, as test releases can be 
promoted to current stable release using 'untest'.

Other suffixes normally use release 0 and imply never being promoted to current 
from pre-release candidates, like Cygwin snapshots and interim test releases.

You can keep the hash info around in your build or cygport but it does not help 
users, as you are already using a date version and a release, so you might as 
well drop it from the package.

We can handle numbering issues using cygport SRC_URI, SRC_DIR, 
CYGPORT_USE_UNSTABLE_API source hooks, and src_... script overrides.

-- 
Take care. Thanks, Brian Inglis			Calgary, Alberta, Canada

La perfection est atteinte			Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter	not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer	but when there is no more to cut
			-- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version string of package
  2023-01-13 13:22 ` Jon Turney
  2023-01-13 14:21   ` Takashi Yano
@ 2023-01-17 23:59   ` Adam Dinwoodie
  2023-01-18 16:17     ` Jon Turney
  1 sibling, 1 reply; 6+ messages in thread
From: Adam Dinwoodie @ 2023-01-17 23:59 UTC (permalink / raw)
  To: Jon Turney; +Cc: Takashi Yano, cygwin-apps

On Fri, Jan 13, 2023 at 01:22:44PM +0000, Jon Turney via Cygwin-apps wrote:
> On 13/01/2023 11:52, Takashi Yano via Cygwin-apps wrote:
> > Hi,
> > 
> > Is it allowed to include '-' in version string (e.g. '20230113-stable')?
> > I'm asking because mksetupini warns:
> > 
> > mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version
> > 
> > though it works as expected.
> 
> Short answer:
> 
> It's a bug that this isn't a fatal error.  Please don't do it!
> 
> Long answer:
> 
> Package naming in Cygwin has a long and tangled history. This isn't
> explicitly precluded by the rules at [1], but probably should be.
> 
> (Fedora, which we generally follow for packaging rules, now doesn't allow
> '-' in versions, just digits, letters and '.')
> 
> We need to be able to unambiguously separate a NVR string into the package
> name, version and release.
> 
> Underscores are allowed in package names, so the simple approach of
> splitting on the rightmost two hyphens would work, if we don't allow
> exceptions like this.
> 
> (We can get it right in this case, because we have a piece of extra
> information: the directory the package is in, which happens to always be
> named N in the current scheme of things, but we might want to change that)
> 
> [1] https://cygwin.com/packaging-package-files.html

I just spotted [0] in the Cygport documentation, and was reminded of
this conversation.  According to that, the version string is explicitly
allowed to include hyphens!  I suspect that's fundamentally a
documentanion bug these days, and should just be expunged...

[0]: https://cygwin.github.io/cygport/syntax_cygpart.html#VERSION

Quick patch below; I can submit this properly as a GitHub PR or with
`git send-email` or otherwise if that'd be useful...

diff --git a/lib/syntax.cygpart b/lib/syntax.cygpart
index 4a400a71..6b992031 100644
--- a/lib/syntax.cygpart
+++ b/lib/syntax.cygpart
@@ -316,7 +316,7 @@ __target_is_embedded() {
 #****v* Globals/VERSION
 #  DESCRIPTION
 #  The upstream package version number.  PV must begin with a digit 0-9, and
-#  subsequent characters can be a digit, letter, dot, hyphen, or underscore.
+#  subsequent characters can be a digit, letter, dot, or underscore.
 #****
 #****v* Globals/RELEASE
 #  DESCRIPTION

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version string of package
  2023-01-17 23:59   ` Adam Dinwoodie
@ 2023-01-18 16:17     ` Jon Turney
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Turney @ 2023-01-18 16:17 UTC (permalink / raw)
  To: Adam Dinwoodie, cygwin-apps

On 17/01/2023 23:59, Adam Dinwoodie wrote:
> On Fri, Jan 13, 2023 at 01:22:44PM +0000, Jon Turney via Cygwin-apps wrote:
>>
>> [1] https://cygwin.com/packaging-package-files.html
> 
> I just spotted [0] in the Cygport documentation, and was reminded of
> this conversation.  According to that, the version string is explicitly
> allowed to include hyphens!  I suspect that's fundamentally a
> documentanion bug these days, and should just be expunged...
> 
> [0]: https://cygwin.github.io/cygport/syntax_cygpart.html#VERSION
> 
> Quick patch below; I can submit this properly as a GitHub PR or with
> `git send-email` or otherwise if that'd be useful...
> 
> diff --git a/lib/syntax.cygpart b/lib/syntax.cygpart
> index 4a400a71..6b992031 100644
> --- a/lib/syntax.cygpart
> +++ b/lib/syntax.cygpart
> @@ -316,7 +316,7 @@ __target_is_embedded() {
>   #****v* Globals/VERSION
>   #  DESCRIPTION
>   #  The upstream package version number.  PV must begin with a digit 0-9, and
> -#  subsequent characters can be a digit, letter, dot, hyphen, or underscore.
> +#  subsequent characters can be a digit, letter, dot, or underscore.
>   #****
>   #****v* Globals/RELEASE
>   #  DESCRIPTION

Thanks. But that's not quite right either, since we currently allow '+' 
in version.

I revised [1] a bit to mention what I think the valid character set is, 
and disallow a hyphen in version. It might make sense to point to that 
from NAME, VERSION, RELEASE in the cygport documentation, rather than 
repeat it.

(That's assuming I've got the intersection of what's valid in cygport, 
calm and setup correct, of course)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-18 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 11:52 Version string of package Takashi Yano
2023-01-13 13:22 ` Jon Turney
2023-01-13 14:21   ` Takashi Yano
2023-01-13 19:11     ` Brian Inglis
2023-01-17 23:59   ` Adam Dinwoodie
2023-01-18 16:17     ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).