Re: Creating package debug... Fatal error: can't parse comment is too long

2021-02-04 Thread Mikolaj Kucharski
Marc, Stuart,

Does that mean it's okay to commit below change?

Index: bsd.port.mk
===
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1542
diff -u -p -u -r1.1542 bsd.port.mk
--- bsd.port.mk 26 Jun 2020 11:51:16 -  1.1542
+++ bsd.port.mk 1 Jan 2021 19:48:31 -
@@ -1201,7 +1201,7 @@ _pkg_cookie${_S} = ${_PACKAGE_COOKIE${_S
 .  if ${DEBUG_PACKAGES:M${_S}}
 _DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
 _DBG_PKG_ARGS${_S} += 
-P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
-_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
+_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${PKGSTEM${_S}}"
 _DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
 # XXX revisit that fullpkgpath later ?
 _DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}


Full thread at https://marc.info/?t=16095308942&r=1&w=2

On Tue, Feb 02, 2021 at 01:05:14PM +0100, Marc Espie wrote:
> On Tue, Feb 02, 2021 at 11:45:24AM +, Stuart Henderson wrote:
> > On 2021/02/02 10:05, Marc Espie wrote:
> > > On Sun, Jan 24, 2021 at 09:50:50PM +, Stuart Henderson wrote:
> > > > You are correct that it will require bumping every port that has
> > > > debug packages. It might be better to only change the comment
> > > > if it's too long (so that existing ones aren't changed).
> > > 
> > > Actually, I'm not sure it's strictly required. In fact it's not.
> > > 
> > > See, debug packages don't go through register-plist, so changes
> > > are not really a problem with them.
> > 
> > Oh, that's a bit of luck!
> 
> More of a design property actually :)
> 
> There's an explicit test in the packaging loop to avoid registering
> debug-packages, for several reasons
> - their packing-lists don't exist independently of normal packages
> - I don't think you'd fancy twice that many files in the plist directory
> - it allowed for rapid development while in-tree, as the generating code
> has had to evolve several times.
> 

-- 
Regards,
 Mikolaj



Re: Creating package debug... Fatal error: can't parse comment is too long

2021-02-02 Thread Marc Espie
On Tue, Feb 02, 2021 at 11:45:24AM +, Stuart Henderson wrote:
> On 2021/02/02 10:05, Marc Espie wrote:
> > On Sun, Jan 24, 2021 at 09:50:50PM +, Stuart Henderson wrote:
> > > You are correct that it will require bumping every port that has
> > > debug packages. It might be better to only change the comment
> > > if it's too long (so that existing ones aren't changed).
> > 
> > Actually, I'm not sure it's strictly required. In fact it's not.
> > 
> > See, debug packages don't go through register-plist, so changes
> > are not really a problem with them.
> 
> Oh, that's a bit of luck!

More of a design property actually :)

There's an explicit test in the packaging loop to avoid registering
debug-packages, for several reasons
- their packing-lists don't exist independently of normal packages
- I don't think you'd fancy twice that many files in the plist directory
- it allowed for rapid development while in-tree, as the generating code
has had to evolve several times.



Re: Creating package debug... Fatal error: can't parse comment is too long

2021-02-02 Thread Stuart Henderson
On 2021/02/02 10:05, Marc Espie wrote:
> On Sun, Jan 24, 2021 at 09:50:50PM +, Stuart Henderson wrote:
> > You are correct that it will require bumping every port that has
> > debug packages. It might be better to only change the comment
> > if it's too long (so that existing ones aren't changed).
> 
> Actually, I'm not sure it's strictly required. In fact it's not.
> 
> See, debug packages don't go through register-plist, so changes
> are not really a problem with them.

Oh, that's a bit of luck!

> They're also 100% "tied" to their originating package: they have all
> dependencies in order to update in synch with it.
> 
> So, yeah, changing every comment in one go should be fine.

In that case (and now tested) I'm OK with this.



Re: Creating package debug... Fatal error: can't parse comment is too long

2021-02-02 Thread Marc Espie
On Sun, Jan 24, 2021 at 09:50:50PM +, Stuart Henderson wrote:
> You are correct that it will require bumping every port that has
> debug packages. It might be better to only change the comment
> if it's too long (so that existing ones aren't changed).

Actually, I'm not sure it's strictly required. In fact it's not.

See, debug packages don't go through register-plist, so changes
are not really a problem with them.

They're also 100% "tied" to their originating package: they have all
dependencies in order to update in synch with it.

So, yeah, changing every comment in one go should be fine.



Re: Creating package debug... Fatal error: can't parse comment is too long

2021-01-24 Thread Stuart Henderson
You are correct that it will require bumping every port that has
debug packages. It might be better to only change the comment
if it's too long (so that existing ones aren't changed).

Also, you don't need to use the full $prefix.0.$date.git.$sha in
the PKGNAME, in particular the sha is likely to be problematic.

On 2021/01/24 19:20, Mikolaj Kucharski wrote:
> I didn't receive any feedback. Would like to hear your thoughts. As
> below diff helps me in certain way, I would like to have this change
> incorporated into OpenBSD ports tree.
> 
> On Fri, Jan 01, 2021 at 07:53:42PM +, Mikolaj Kucharski wrote:
> > Hi,
> > 
> > I often generate my own distfiles from git checkout when I debug code
> > from OpenBSD ports tree. Some of the ports have already debug packages
> > defined. Sample debug package looks as follows:
> > 
> > # pkg_info -I debug-sane-backends
> > debug-sane-backends-1.0.31p1 debug info for sane-backends-1.0.31p1
> > debug-sane-backends-1.0.31p1-snmp debug info for sane-backends-1.0.31p1-snmp
> > 
> > As you can see package version ends up inside the COMMENT. When I
> > generate my debugging distfiles, they are usually generated from
> > git repos as most projects are currently hosted on GitHub and that's
> > git. Here is example distfile:
> > 
> > sane-backends-1.0.31.0.20201130.120702.git.e3e397556.tar.gz
> > 
> > and I generate it something a long the lines of:
> > 
> > git archive --format=tar --prefix="$prefix.0.$date.git.$sha/" $hash | gzip 
> > -9nf
> > 
> > I find that naming convention useful to me. However with that long
> > versioning it goes over the limit of 60 characters in COMMENT, per code
> > in OpenBSD/PkgCreate.pm, function add_description().
> > 
> > Looking at current code in bsd.port.mk:
> > 
> > 1201.  if ${DEBUG_PACKAGES:M${_S}}
> > 1202_DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
> > 1203_DBG_PKG_ARGS${_S} += 
> > -P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
> > 1204_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
> > 1205_DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
> > 1206# XXX revisit that fullpkgpath later ?
> > 1207_DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}
> > 1208_DBG_PKG_ARGS${_S} += -f ${_WRKDEBUG}/${PLIST${_S}:T}
> > 1209_EXCLUDE_DEBUG_PLISTS += ${_WRKDEBUG}/${PLIST${_S}:T}
> > 1210_pkg${_S} += ${_DBG_PKGFILE${_S}}
> > 1211_pkg_cookie${_S} += ${_DBG_PACKAGE_COOKIE${_S}}
> > 1212.  endif
> > 
> > We see that version information is also inside description of the
> > package:
> > 
> > # pkg_info debug-sane-backends-- | grep -A1 -E '^(Comment|Description)'
> > Comment:
> > debug info for sane-backends-1.0.31p1
> > Description:
> > debug info for sane-backends-1.0.31p1
> > 
> > So my proposition is to just drop the version part from the comment:
> > 
> > Index: bsd.port.mk
> > ===
> > RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> > retrieving revision 1.1542
> > diff -u -p -u -r1.1542 bsd.port.mk
> > --- bsd.port.mk 26 Jun 2020 11:51:16 -  1.1542
> > +++ bsd.port.mk 1 Jan 2021 19:48:31 -
> > @@ -1201,7 +1201,7 @@ _pkg_cookie${_S} = ${_PACKAGE_COOKIE${_S
> >  .  if ${DEBUG_PACKAGES:M${_S}}
> >  _DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
> >  _DBG_PKG_ARGS${_S} += 
> > -P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
> > -_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
> > +_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${PKGSTEM${_S}}"
> >  _DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
> >  # XXX revisit that fullpkgpath later ?
> >  _DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}
> > 
> > However I think that would require to bump all debug packages across the
> > entire OpenBSD ports tree, right? Anyway, I would love to see above diff
> > committed. Comments?
> > 
> 
> -- 
> Regards,
>  Mikolaj
> 



Re: Creating package debug... Fatal error: can't parse comment is too long

2021-01-24 Thread Mikolaj Kucharski
I didn't receive any feedback. Would like to hear your thoughts. As
below diff helps me in certain way, I would like to have this change
incorporated into OpenBSD ports tree.

On Fri, Jan 01, 2021 at 07:53:42PM +, Mikolaj Kucharski wrote:
> Hi,
> 
> I often generate my own distfiles from git checkout when I debug code
> from OpenBSD ports tree. Some of the ports have already debug packages
> defined. Sample debug package looks as follows:
> 
> # pkg_info -I debug-sane-backends
> debug-sane-backends-1.0.31p1 debug info for sane-backends-1.0.31p1
> debug-sane-backends-1.0.31p1-snmp debug info for sane-backends-1.0.31p1-snmp
> 
> As you can see package version ends up inside the COMMENT. When I
> generate my debugging distfiles, they are usually generated from
> git repos as most projects are currently hosted on GitHub and that's
> git. Here is example distfile:
> 
> sane-backends-1.0.31.0.20201130.120702.git.e3e397556.tar.gz
> 
> and I generate it something a long the lines of:
> 
> git archive --format=tar --prefix="$prefix.0.$date.git.$sha/" $hash | gzip 
> -9nf
> 
> I find that naming convention useful to me. However with that long
> versioning it goes over the limit of 60 characters in COMMENT, per code
> in OpenBSD/PkgCreate.pm, function add_description().
> 
> Looking at current code in bsd.port.mk:
> 
> 1201.  if ${DEBUG_PACKAGES:M${_S}}
> 1202_DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
> 1203_DBG_PKG_ARGS${_S} += 
> -P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
> 1204_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
> 1205_DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
> 1206# XXX revisit that fullpkgpath later ?
> 1207_DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}
> 1208_DBG_PKG_ARGS${_S} += -f ${_WRKDEBUG}/${PLIST${_S}:T}
> 1209_EXCLUDE_DEBUG_PLISTS += ${_WRKDEBUG}/${PLIST${_S}:T}
> 1210_pkg${_S} += ${_DBG_PKGFILE${_S}}
> 1211_pkg_cookie${_S} += ${_DBG_PACKAGE_COOKIE${_S}}
> 1212.  endif
> 
> We see that version information is also inside description of the
> package:
> 
> # pkg_info debug-sane-backends-- | grep -A1 -E '^(Comment|Description)'
> Comment:
> debug info for sane-backends-1.0.31p1
> Description:
> debug info for sane-backends-1.0.31p1
> 
> So my proposition is to just drop the version part from the comment:
> 
> Index: bsd.port.mk
> ===
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1542
> diff -u -p -u -r1.1542 bsd.port.mk
> --- bsd.port.mk   26 Jun 2020 11:51:16 -  1.1542
> +++ bsd.port.mk   1 Jan 2021 19:48:31 -
> @@ -1201,7 +1201,7 @@ _pkg_cookie${_S} = ${_PACKAGE_COOKIE${_S
>  .  if ${DEBUG_PACKAGES:M${_S}}
>  _DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
>  _DBG_PKG_ARGS${_S} += 
> -P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
> -_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
> +_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${PKGSTEM${_S}}"
>  _DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
>  # XXX revisit that fullpkgpath later ?
>  _DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}
> 
> However I think that would require to bump all debug packages across the
> entire OpenBSD ports tree, right? Anyway, I would love to see above diff
> committed. Comments?
> 

-- 
Regards,
 Mikolaj



Creating package debug... Fatal error: can't parse comment is too long

2021-01-01 Thread Mikolaj Kucharski
Hi,

I often generate my own distfiles from git checkout when I debug code
from OpenBSD ports tree. Some of the ports have already debug packages
defined. Sample debug package looks as follows:

# pkg_info -I debug-sane-backends
debug-sane-backends-1.0.31p1 debug info for sane-backends-1.0.31p1
debug-sane-backends-1.0.31p1-snmp debug info for sane-backends-1.0.31p1-snmp

As you can see package version ends up inside the COMMENT. When I
generate my debugging distfiles, they are usually generated from
git repos as most projects are currently hosted on GitHub and that's
git. Here is example distfile:

sane-backends-1.0.31.0.20201130.120702.git.e3e397556.tar.gz

and I generate it something a long the lines of:

git archive --format=tar --prefix="$prefix.0.$date.git.$sha/" $hash | gzip -9nf

I find that naming convention useful to me. However with that long
versioning it goes over the limit of 60 characters in COMMENT, per code
in OpenBSD/PkgCreate.pm, function add_description().

Looking at current code in bsd.port.mk:

1201.  if ${DEBUG_PACKAGES:M${_S}}
1202_DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
1203_DBG_PKG_ARGS${_S} += 
-P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
1204_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
1205_DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
1206# XXX revisit that fullpkgpath later ?
1207_DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}
1208_DBG_PKG_ARGS${_S} += -f ${_WRKDEBUG}/${PLIST${_S}:T}
1209_EXCLUDE_DEBUG_PLISTS += ${_WRKDEBUG}/${PLIST${_S}:T}
1210_pkg${_S} += ${_DBG_PKGFILE${_S}}
1211_pkg_cookie${_S} += ${_DBG_PACKAGE_COOKIE${_S}}
1212.  endif

We see that version information is also inside description of the
package:

# pkg_info debug-sane-backends-- | grep -A1 -E '^(Comment|Description)'
Comment:
debug info for sane-backends-1.0.31p1
Description:
debug info for sane-backends-1.0.31p1

So my proposition is to just drop the version part from the comment:

Index: bsd.port.mk
===
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1542
diff -u -p -u -r1.1542 bsd.port.mk
--- bsd.port.mk 26 Jun 2020 11:51:16 -  1.1542
+++ bsd.port.mk 1 Jan 2021 19:48:31 -
@@ -1201,7 +1201,7 @@ _pkg_cookie${_S} = ${_PACKAGE_COOKIE${_S
 .  if ${DEBUG_PACKAGES:M${_S}}
 _DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
 _DBG_PKG_ARGS${_S} += 
-P${FULLPKGPATH${_S}}:${FULLPKGNAME${_S}}:${FULLPKGNAME${_S}}
-_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${FULLPKGNAME${_S}}"
+_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${PKGSTEM${_S}}"
 _DBG_PKG_ARGS${_S} += -d"-debug info for ${FULLPKGNAME${_S}}"
 # XXX revisit that fullpkgpath later ?
 _DBG_PKG_ARGS${_S} += -DFULLPKGPATH=debug/${FULLPKGPATH${_S}}

However I think that would require to bump all debug packages across the
entire OpenBSD ports tree, right? Anyway, I would love to see above diff
committed. Comments?

-- 
Regards,
 Mikolaj