[Mingw-users] Error on mingw-pkg distribute

Keith Marshall keith****@users*****
Thu Jan 9 09:02:28 JST 2020


On 08/01/2020 22:37, Cesar Strauss wrote:
> In ticket #39246 [1], Keith asks me to package a newer version of
> awk for MSYS. I took the opportunity to try out his mingw-pkg tool
> [2], but ran into trouble. Since, according to Keith, he supports his
> tool on this mailing list, I am following-up here.>
> My steps were:
> 
> 1) Clone, build and install mingw-pkg [2].
> 
> 2) Read "mingw-pkg --help"
> 
> 3) Inspect the source for a better understanding of each command.
> 
> 4) Run an MSYS Developer Shell (the package is for MSYS).
> 
> 5) Unpack the source for awk [3] and go into the top directory.
> 
> 6) Run: mingw-pkg --arch=msys initialize

So far, so good, but what SCM have you bound in this step?  Please show
the content of your $HOME/.mingw-pkgrc configuration file.

> 7) Run: mingw-pkg --arch=msys mkspec
> 
> 8) Edit the Package Spec file on arch/msys (attached, work in
> progress)
> 
> 9) Create an MSYS specific patch and put it into arch/msys (attached)
> 
> 10) Run: mingw-pkg --arch=msys patch
> 
> 11) Run: mingw-pkg --arch=msys compile
> 
> Up to here, all seems to go well.
> 
> 12) Run: mingw-pkg --arch=msys install
> 
> This installs to /usr/local, where I was expecting some staging
> directory.

No.  It will install into whatever path is assigned to $prefix, and I
don't see anything in your pkgspec file to configure that, so it will
assume the autoconf default.  However...

> 12) Run: mingw-pkg --arch=msys distribute

...this step, (if it were working correctly), *would* create a staged
installation, independent of $prefix, except that...

> This gives an error:
> 
>  >>> prepare source distribution
> 
> mingw-pkg: *** FATAL *** no handler implemented for action
> 'stage_srcdist'

Without seeing your $HOME/.mingw-pkgrc, I can only speculate: the
required handler is provided by either the "git" or the "hg" plugin; if
you haven't loaded either of these, then you haven't initialized an SCM
source, whence the source package content may be derived.

> Note: I also tried the example pthreads-win32-2.10-pre.tar.xz in [2],
> with the same error above on the distribute step.
> 
> At this point, I suspected that mingw-pkg was incomplete, but Keith
> assures me he is using it for some time already.

I certainly have; my $HOME/.mingw-pkgrc (attached) includes the statement:

   load plugin hg

which provides a suitable "stage_srcdist" handler; it derives the source
package content from the local Mercurial repository, which this same
plugin would have created during your step (6).

I guess it is a fair comment that mingw-pkg is incomplete w.r.t. the
"distribute" action, unless you load the "hg" plugin, (which I have
tested comprehensively), or the "git" plugin, (which I have not).  At
some stage, we should probably develop a fall-back handler; also, some
more comprehensive documentation, than the existing "mingw-pkg --help"
output, would be useful.

> [1] Ticket #39246 - Please update MSYS awk; current awk-3.1.7
> implementation is too old to remain viable
> https://osdn.net/projects/mingw/ticket/39246
> 
> [2] MinGW Package Builder Tool
> https://osdn.net/users/keith/pf/mingw.pkg/wiki/FrontPage
> 
> [3] http://ftp.gnu.org/gnu/gawk/gawk-4.0.1.tar.xz

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-------------- next part --------------
# .mingw-pkgrc
#
# Local initialization preferences for the mingw-pkg tool.
#
# If you plan to publish any MinGW package, or mingw-port, then you
# MUST stipulate your name, and e-mail address, so that such packages
# may be appropriately attributed.
#
AUTHOR="Keith Marshall"
AUTHOR_EMAIL="keith****@users*****"

# For packages which support GNU configure semantics, setting host,
# build, and initial configure_options here will cause mingw-pkg to
# invoke cross compiler tools, as appropriate.
#
host=${host-"mingw32"}
build=${build-"x86_64-pc-linux-gnu"}

# When building packages for deployment on MinGW hosts, requiring the
# use of cross compiler tools, then the host and build options must be
# prefaced to the mingw-pkg configure options; however, to support use
# of mingw-pkg for building the cross compiler tools themselves, defer
# this assignment until the --xtool option has been evaluated, and all
# other configure options have been assigned, by encapsulating these
# prefaced assignments within the xhost_configure_options variable, as
# a command which will be executed immediately prior to invocation of
# the configure script itself, when --xtool mode has NOT been enabled.
#
xhost_configure_options='echo --build=$build --host=$host $configure_options'

# When --xtool mode HAS been enabled, mingw-pkg needs to be informed
# of the installation prefix for the cross compiler tools; this should
# be specified in the xhost_prefix variable.
#
xhost_prefix=/home/keith/mingw32

# Some packages don't support GNU configure semantics, and may need some
# help to specify a host prefix for cross compiler tools; host_prefix may
# be interpreted within the package specification file, e.g. thus:
#
#    option compile ${host_prefix:+HOST_PREFIX=`$host_prefix-`}
#
# Note that this requires $host_prefix to expand to a command, which will
# write the requisite host prefix, excluding its normal '-' terminating
# punctuation, to its standard output; here, we specify an architecture
# dependent host prefix, which will be resolved only when the package
# specification file is parsed.
#
host_prefix='eval echo $ARCH'

# If you intend to publish MinGW packages, or any mingw-port, then you
# MUST enable one of the supported source code management (SCM) systems;
# currently, these are either Mercurial (hg), or git.  Uncomment ONE of
# the following two plugin loaders, according to your preference; note
# that, if you choose hg, you must also enable its mq extension, while
# if you choose git, you should install an mq-compatible patch queue
# management suite; Git-MQ (https://osdn.net/users/keith/pf/git-mq) is
# a suitable candidate.
#
#    load plugin git
#    load plugin hg
#
load plugin hg

# In the event that you do publish packages, or mingw-ports, you should
# also consider providing detached GPG signatures, so that users will be
# able to authenticate them.  Uncomment the following plugin loader, to
# activate the mingw-pkg package signing feature.
#
#    load plugin auth gpg $AUTHOR_EMAIL
#
load plugin auth gpg $AUTHOR_EMAIL

# The following setting allows all option parsing to be performed
# as if by GNU getopt_long_only(), (but without argument reordering);
# without this, GNU getopt_long() semantics will prevail.
#
#    optchk_getopt_long_only=true
#
optchk_getopt_long_only=true

# .mingw-pkgrc: end of file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.osdn.me/mailman/archives/mingw-users/attachments/20200109/275266f6/attachment.sig>


More information about the MinGW-Users mailing list