delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/09/18/15:23:01

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 58IJN0tB2558367
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 58IJN0tB2558367
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=dVHHsbfF
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 727B23858C62
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1758223379;
bh=y2HqNoU9AaZFFYqZFo+zpmDqJJzp9cGEM0fsu0zchv4=;
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=dVHHsbfFX7tmwtDTKgP0JAYV7d78lkChRLyJjjrg/7cjs9wM/vwPQIho3VAoydowc
AOXzA8C4+5vNeNH4q4Q7geY5rLxXsZplvsfC2OD6eHvTyGvv9fK52D6tFiXGFuUaYr
OIJ91oJks4pXzDu8teW6khjlXcl7MjHzcbuwAT4E=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9C043858D20
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C9C043858D20
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758223348; cv=none;
b=aR4BI2LAfKFSYOBn35PJuw+mG80OnGX4UXXJNxlNKJN4aMVgw+LyJoGO0pbHC6JhEHjqth9v8otXH0TxSsK8jvQMg+TbqTHbAvLRysdVjwgWn2ozG3qwJL2RP6hmZMjgnvpS4KzrcdH29+g46BlEZaeRdmVl1IZugCHJHwbeZ2Q=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1758223348; c=relaxed/simple;
bh=m9lwWmHmtmfAa+uAVv/D3Iy6ZG+RONT9nZ2IMCgFeWY=;
h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature;
b=rvEnfTixpykbEzj4Kb5WhRTmrBJM7UgNytFTETwe473gxcCjnPXPDEBXH1CqoxZJQStyAj31eBGmO9M3YI7+/LISvsEn9GERYTjbP86hx/9Jt088uoucqDkodL3e/J1sVquT8E/ni0re80FVwrtWcFjPEXBkWPBfJ/4yeCoranI=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9C043858D20
Message-ID: <2811c2e4-40bb-4f8c-9f12-ab55796e5dda@SystematicSW.ab.ca>
Date: Thu, 18 Sep 2025 13:22:25 -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>
<476a235a-db54-4a0f-8917-d283a6df28c2 AT SystematicSW DOT ab DOT ca>
<76025dd8-49f1-cc95-8fa4-1d054c7ab5aa AT wisemo DOT com>
Organization: Systematic Software
In-Reply-To: <76025dd8-49f1-cc95-8fa4-1d054c7ab5aa@wisemo.com>
X-Rspamd-Queue-Id: F29E220026
X-Stat-Signature: ekscwwfdp7ph7ic1fjipxwhd7afq4njj
X-Rspamd-Server: rspamout06
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX1/Kp+BCs3RknbeUj0nmmcTYPrLt6xATc9s=
X-HE-Tag: 1758223346-425834
X-HE-Meta: U2FsdGVkX18ZnUn6+QoaCtHPUpE6CCFafiPdhhHql66iM2WaDzzQDFZv2yo+mLAvu4d/tW5YC+uY6U4yZNQYgmhyX7iz4Mk84/VlV3K3k34EVVOKTP9acsOPxrAD3RXQo+cuEubLohZyfOAHTTM5URD3wBfb8ziu6uSViX3xziQuoosJVc/Zmv0OwYKwXxWCl7MKaA5/42FPxFFhBxIKAyM5vagSN4h0SJm1ImtJ/R1NHVvCn0XAUI9CidiMTjG2SSN7D1qf61k8LZUmiYJxzAX7nEzGJD0zmV4K1S0IpjfQEnMT/ZAYxV9khzRIo5Nrl2a+rqtstzq4EiO81xQvZfM5SP94wL146QGYHi6HO/kp9pq2zHgTOti7IlgcBdHcdt3kRgNsfB/MYkLWtrANnagCnW44+WSqp+AmsicJUOe/uS2v3DAcC8xTvrAn0DpAWxAPtLuF9mFEZxG262qplA==
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 58IJN0tB2558367

On 2025-09-17 05:48, Jakob Bohm via Cygwin wrote:
> Hi List,
> 
> Solution further down!
> 
> On 9/17/2025 3:49 AM, Brian Inglis via Cygwin wrote:
>> 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.
> Reemphasizing this, as I kept getting replies highly specific to bash,
> when bash was just a random choice from the setup.exe menus.
>>>>>
>>>>> $ 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
>>
> OK, admitted, it was on the manpage, I just overlooked it.  Also the
> debug output seems to be both too verbose and too incomplete for anyone
> but the cygport author to understand.
>> 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
> Again, a suggestion specific to bash, but I can try.
> 
> And patch --verbose gave a meaningful error message suppressed by cygport,
> even in debug mode: the CYGWIN tmp dir was still mounted to the
> cygwin64\tmp default location, thus writable only by admins/wheel, not
> developers or other non-wheel users.

Are we talking Windows or some Unix filesystem?

Previously (Cygwin >= 1.7 ~2000) /tmp was created by Cygwin Setup, perms 01777 
a=rwxt set by /etc/postinstall/bash.sh, later (~2008) perms were set in Cygwin 
Setup, owned by install account and group; more recently owned by install 
account and Administrators group.

Problems can be caused if Cygwin directories and perms are backed up and 
restored using Windows utilities that do not retain verbatim ACLs, rather than 
Cygwin utilities like rsync, that try to retain POSIX perms and ACLs.

Any other settings are likely to be admins responsible for the host system, or 
using Windows utilities on Cygwin files, assuming they DTRT.

Who sets up POSIX compatible systems with non-world-writeable /tmp directories?

> Fix was to add this comment and line to /etc/fstab as root, then
> restarting all processes that access cygwin1.dll shared memory.  These
> lines really should be the sane default.
> 
> ###### Solution!!!!!!
> 
> # Map Windows per user temp dir to CYGWIN /tmp dir
> none    /tmp    usertemp binary,posix=1,noacl,dos,user   0       0
> 
> (noacl needed because the cygwin core code uses a broken old algorithm that
> adds NTACL entries for user NONE and generally causes ACL corruption) .
PGA; PTC; feel free to offer patches to improve the implementation while 
maintaining Cygwin and POSIX compatibility.

>>>> 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:
> As I wrote repeatedly, these are the sources installed by setup.exe
> when checking the "src" box for a package, nothing exotic or manual.
>>
>> $ 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:
> PATH in cygwin console has /usr/local/bin and /usr/bin as first elements,
> so that was not the issue.  Issue is that cygport does a bunch of
> unrelated things before invoking patch in a way that requires write access
> to /tmp which failsdue to cygwin defaulting to a root-owned /tmp .
> Then cygport further adds to the confusion by claiming that it is an issue
> withpatching, not /tmp/ access.
> 
>  > (snip long example of using which to check PATH of lots of tools)
> 
> And mounts were subtly wrong (/tmp implicitly included in the root mount
> to a root-owned software dir)

Do you mean Administrators?
Ownerships should not matter if perms and ACLs are set properly, which they 
should be using only Cygwin packages on directories below the Cygwin root mount.

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