www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/09/16/21:50:10

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 58H1oAMl893968
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 58H1oAMl893968
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=sT0NeIMW
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D91FB3858406
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1758073807;
bh=2NNzfQgWAQ5rwttQ/8dMIkzC1YLt5hCWyMj/Hmwevzg=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=sT0NeIMWo1QiD1N5xyKGY9i/HmHdjm436nq4CtQYUjMIcRRhkfz8M5mdO6lauH2Mh
RL/TWFLQQ11VhiudipUvWURPCAqcWJZtquNH+q7oyPMmXoPBN5hUND5j9UwqmqV1sa
nWqcU+c9J4qwLw65mgkLBTcrUfEOmGFOvYJObzNo=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB9173858D33
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB9173858D33
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758073767; cv=none;
b=F4pFfzrtWLwSBfvLjQSIKwJohu7tf8AKwfOhHWcydu8ZGVaLDPqoHlb3AAW8ahcj38twgDm0fA7KSWEmk4HPBdxMlV7PHVKZdl8EdpkUZQxodhEPEdAMVcbh8uC1XyNghYw6SXnZyg0DXyxs4FusYU4nCv6+kwFERPtQToJ1Qd8=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1758073767; c=relaxed/simple;
bh=80Z0QXnlF47A/Jmi6FVIg2BKfYgxt9/cFKNCKvZAyA8=;
h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature;
b=FIXAJsQHoX6QnBvaLunT9XqKosrrBICLzJrmLVaqPtqFt/tpqQmoOIkNM46FpFR2CxdDCUQZkCmEHbtDD2LSA4R9WIZTpTA5PXn1KXBQ7zs4yw0+s5ygM2Hna4IFSwcGCsZVq8H/keNlLApfnIYNAGjgOpsgbaBq6sG6uNThbJM=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB9173858D33
Message-ID: <476a235a-db54-4a0f-8917-d283a6df28c2@SystematicSW.ab.ca>
Date: Tue, 16 Sep 2025 19:49:23 -0600
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: cygport 0.37.2 keeps failing with patch will not apply
To: cygwin AT cygwin DOT com
References: <87a19a0c-c668-b195-e28e-d4dd7a069b9d AT wisemo DOT com>
<95215312-b19a-44bb-a769-6e1faa591821 AT SystematicSW DOT ab DOT ca>
<c849e94b-1116-20db-10a2-adcaf02ace6b AT wisemo DOT com>
Organization: Systematic Software
In-Reply-To: <c849e94b-1116-20db-10a2-adcaf02ace6b@wisemo.com>
X-Rspamd-Server: rspamout04
X-Rspamd-Queue-Id: E7C013D
X-Stat-Signature: g4wx7k8tprhgqnid7rxtcq4qyq76iadg
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX1/mi3bKtrt1JPGt7v0tE1/nNnataqUpO+I=
X-HE-Tag: 1758073764-371361
X-HE-Meta: U2FsdGVkX1921IpSSCB0s89sjSj5vmjl+57KzOPPAe97+JOAGsOimIFgYiuGcs0uDpIGsj5OjK6JOEWG5r+JoYGAtmQxeK5r4222dyjUKjwzEl8uI2X1RHOvUKpL4ahG47HZuwScvCZUTD/sM+ltjf2Ygj+39UhMYOBoTmQXrUjaQ6ndCBg9J2bHdmkiQREe9Omby8lrllVajQi5BKkUSdl1x1680ibSW32ZK5Z4/ODbqHaUHQLZ2QGn/FN+WrVNBUXVxvQ+fM/u2+ApRC0s5mEi14OtadSWGfa/+1hXGrhGnSiQPeC9fg99GYzGcn78A+sGchOc0pqiRw7hrJcEAjdcoLF34ykNzeiSH7YkPmze0dqNRsN29uTEl+Es1XlsHm5zTkCdAweLuEFYOA0NZxNktjmcM7fwkb2rG8naJ3mHTivw/2L9NxyLQkUV/uzOuj82vkck/K2xLhqESUN5sg==
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 58H1oAMl893968

On 2025-09-16 18:11, Jakob Bohm via Cygwin wrote:
> On 9/16/2025 8:49 PM, Brian Inglis via Cygwin wrote:
>> 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):
> Note that above line clarifies that bash was just used as a test example
> to show it was an issue in cygport, not the specific packageI am trying
> to build.  Equivalently, any changes specific to the bash package are
> irrelevant, including your comments about redhat URL specifics.
>>>
>>> $ 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/me/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
>.
>>
>> 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.
> But here is a transcript of trying the undocumented (not in man cygport) --debug 
> option (with username substituted by "me")

It is in `man cygport` for me:

$ man cygport | grep debug
        --debug
               enable debugging messages

Try `cygport --help` for better info: we should probably use `help2man` to 
update man pages, if there are mismatches.

> $ cygport --debug bash.cygport all
> + shift
> + true
> + case ${1} in
> + break
> + argv=('/usr/bin/cygport' 'bash.cygport' 'all')
> + declare -ar argv
> + declare -ir argc=3
> + defined 'argv[1]'
> + ((  1 != 1  ))
> + '[' -n bash.cygport ']'
> + return 0
> + defined 'argv[2]'
> + ((  1 != 1  ))
> + '[' -n all ']'
> + return 0
> + source /usr/share/cygport/lib/check_funcs.cygpart
> + echo -e '\e[1;39m>>> Preparing bash-5.2.21-1.x86_64\e[0;0m'
>  >>> Preparing bash-5.2.21-1.x86_64

> /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21.tar.gz ']'

> + '[' -f /home/me/cygsrc/bash-5.2.21-1.src/bash-2.03-profile.patch -a '!' -f 
> bash-2.03-profile.patch ']'

> + cd /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/origsrc

> + unpack_cmd='tar xf'
> + __step 'Unpacking source bash-5.2.21.tar.gz'
> + echo -e '>>> Unpacking source bash-5.2.21.tar.gz'
>  >>> Unpacking source bash-5.2.21.tar.gz

> + tar xf /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21.tar.gz
> + '[' '!' -d /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/origsrc/ 
> bash-5.2.21 ']'
> + chmod +x /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/origsrc/ 
> bash-5.2.21
> + cd /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/origsrc/bash-5.2.21

> + cygpatch /home/me/cygsrc/bash-5.2.21-1.src/bash-2.03-profile.patch

> + patch -N -s --dry-run -p1 -i /home/me/cygsrc/bash-5.2.21-1.src/bash-2.03- 
> profile.patch

> + error 'patch bash-2.03-profile.patch will not apply'
> + case $? in
> + local errorcode=1
> + echo -e '\e[1;31m*** ERROR:\e[0;0m patch bash-2.03-profile.patch will not apply'
> *** ERROR: patch bash-2.03-profile.patch will not apply
> + exit 1
> 
> me AT MACHINE ~/cygsrc/bash-5.2.21-1.src

Try running:

$ cd /home/me/cygsrc/bash-5.2.21-1.src/bash-5.2.21-1.x86_64/origsrc/bash-5.2.21
$ patch --verbose -N -s --dry-run -p1 -i 
/home/me/cygsrc/bash-5.2.21-1.src/bash-2.03-profile.patch

>> 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>).
> 
> Not sure how the statements below applies to an already populated complete src 
> directory for the test package (which happens to be bash).
> 
>> 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.

If anything is not found locally, and what that means may vary by source, it 
will be checked for in the upstream source cache ${DISTDIR:-$HOME/Downloads}, 
and what is available locally or in the upstream source cache may not be the 
same file used in the original build!

I have no idea where your sources originated without seeing the whole 
transcript, including downloadall or equivalent, but wcurl/tar/prep works for me:

$ wcurl 
https://mirror.cpsc.ucalgary.ca/mirror/cygwin.com/x86_64/release/bash/bash-5.2.21-1-src.tar.xz
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 10.4M  100 10.4M    0     0  19.8M      0 --:--:-- --:--:-- --:--:-- 19.9M
$ tar -xf bash-5.2.21-1-src.tar.xz
$ cd bash-5.2.21-1.src
$ cygport --version
cygport 0.37.2
Copyright (C) 2020 Cygport authors	# -> needs updated!
...
$ cygport bash.cygport prep
*** Info: Trying to enable case sensitivity on 
/usr/src/bash/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
*** Info: applying patch bash-2.03-profile.patch (-p1):
patching file config-top.h
Hunk #1 succeeded at 23 (offset -3 lines).
*** Info: applying patch bash-2.05a-interpreter.patch (-p1):
...
 >>> Preparing working source directory
*** Info: applying patch bash-5.2.21-1.src.patch (-p2):
patching file doc/man.pages
patching file support/bashbug.sh

I also built a bunch of updated packages from sources last weekend with no 
issues, and got nearly identical results on our CI system, from which the 
updated packages were deployed to the mirrors.

Perhaps check no other instances of required utilities are prior to Cygwin's on 
your PATH:

$ which -a bzip2 cat chmod cp date diff diffstat dos2unix file find gawk grep 
gzip install ln mkdir mv patch rm rsync sed sort tar touch which xargs xz
alias chmod='/bin/chmod -c'
	/bin/chmod
alias cp='/bin/cp -iv'
	/bin/cp
alias diff='diff -pu --color --strip-trailing-cr'
	/usr/bin/diff
alias grep='/bin/grep --color=auto'
	/bin/grep
alias ln='/bin/ln -iv'
	/bin/ln
alias mv='/bin/mv -iv'
	/bin/mv
alias rm='/bin/rm -iv'
	/bin/rm
alias tar='/bin/tar -a'
	/bin/tar
alias touch='/bin/touch -ch'
	/bin/touch
/usr/bin/bzip2
/usr/bin/cat
/usr/bin/chmod
/usr/bin/cp
/usr/bin/date
/usr/bin/diffstat
/usr/bin/dos2unix
/usr/bin/file
/usr/bin/find
/proc/cygdrive/c/WINDOWS/system32/find
/usr/bin/gawk
/usr/bin/grep
/usr/bin/gzip
/usr/bin/install
/usr/bin/ln
/usr/bin/mkdir
/usr/bin/mv
/usr/bin/patch
/usr/bin/rm
/usr/bin/rsync
/usr/bin/sed
/usr/bin/sort
/proc/cygdrive/c/WINDOWS/system32/sort
/usr/bin/tar
/proc/cygdrive/c/WINDOWS/system32/tar
/usr/bin/touch
which ()
{
     ( alias;
     declare -f ) | command which --tty-only --read-alias --read-functions 
--show-tilde --show-dot "$@" 2> /dev/null
}
/usr/bin/which
/usr/bin/xargs
/usr/bin/xz

and mounts look normal:

$ mount
C:/.../cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/.../cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/.../cygwin64 on / type ntfs (binary,auto)
C: on /proc/cygdrive/c type ntfs (binary,posix=0,noumount,auto)
D: on /proc/cygdrive/d type ntfs (binary,posix=0,noumount,auto)
F: on /proc/cygdrive/f type unknown (binary,posix=0,noumount,auto)
G: on /proc/cygdrive/g type unknown (binary,posix=0,noumount,auto)

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019