On 2025-09-16 03:20, Jakob Bohm via Cygwin wrote:
I was looking into trying out some local modifications to a cygwin
packaged program. Thus I installed the sources via setup.exe then
copied /usr/src/* to a working directory and tried to rebuild the
package with the cygport all command. But Even with different
packages and unchanged sources, cygport keeps failing with an error
that the first patch in the source will not apply.
What should I do to get to a buildable state?
Steps to reproduce (using bash as a simpler test example):
$ cd
$ mkdir cygsrc
$ cd cygsrc
$ cp -par /usr/src/* .
$ cd bash-5.2.21-1.src
$ cygport bash.cygport all
$ cygport --version
Results:
*** Info: Trying to enable case sensitivity on /home/jb.WISEMO/cygsrc/
bash-5.2.21-1.src/bash-5.2.21-1.x86_64
>>> Preparing bash-5.2.21-1.x86_64
>>> Unpacking source bash-5.2.21.tar.gz
*** ERROR: patch bash-2.03-profile.patch will not apply
cygport 0.37.2
Copyright (C) 2020 Cygport authors
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any
later version.
For more information about these matters, see the file named COPYING.
Written for the Cygwin project <https://cygwin.com/>.
Without knowing the actual source package, version, and patch, it is hard to
help.
It is also easier to diagnose if we can see a verbatim transcript of commands
run and output shown.
You are expected to run cygport from within the directory where the package
sources including the <PACKAGE>.cygport were downloaded or installed (often
/usr/src/<PACKAGE>).
By default, if you use download/fetch/wget/get/...all cygport will re-download
any sources or patches which are not local or in its upstream cache defined as
${DISTDIR:-$HOME/Downloads}, and they may have changed.
Also incorrect versions of unlabelled/unversioned sources or patches may be
found in its upstream cache and used.
For example, in bash.cygport, it is not the best long term idea to refer to
Fedora upstream patch source branches rawhide or main, as they always refer to
recent sources and they may change:
https://src.fedoraproject.org/rpms/bash/raw/rawhide/f/bash-2.03-profile.patch
so better to refer to f43 (or the then current stable branch release) than
rawhide or main.
It also appears that rawhide upstream sources are now bash 5.3 not 5.2.21, so
some patches may have been changed to accommodate source changes.
Your best approach is probably to run cygport --debug ... prep:
$ cygport --debug <PACKAGE>.cygport prep |& tee <PACKAGE>-cygport-prep-debug.log
to see what it is doing and complaining about, then manually redo the last cd
and patch commands before failure, adding the patch --verbose option to get more
detailed diagnostic messages.
The commands you run should be similar to:
$ cd
/home/jb.WISEMO/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/src/bash-5.2.21/
$ patch --verbose -N -p1 --no-backup-if-mismatch -i .../bash-2.03-profile.patch
--
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 à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple