From: Brian Inglis <Brian.Inglis@Shaw.ca>
To: cygwin-apps@cygwin.com
Cc: Christian Franke <Christian.Franke@t-online.de>
Subject: Re: cygport may not create debug info if top directory contains a symlink
Date: Sun, 17 Sep 2023 09:56:59 -0600 [thread overview]
Message-ID: <c23a4dd4-fb61-a503-7ff0-d302986ddf02@Shaw.ca> (raw)
In-Reply-To: <bba24d53-86b2-4b0f-bdac-a67d8c7c1735@dronecode.org.uk>
On 2023-09-17 08:01, Jon Turney via Cygwin-apps wrote:
> On 16/09/2023 15:17, Christian Franke via Cygwin wrote:
>> Found during tests of busybox package:
>> If the path of the top build directory contains a symlink and the project's
>> build scripts normalize pathnames, no debug info is created by cygport.
>>
>> This is because options like
>> -fdebug-prefix-map=${B}=/usr/src/debug/${PF}
>> have no effect because ${B} contains a symlink but the compiler is run with
>> the real source path.
>
> I think that there was some historical bug with gcc where a relative path for
> the old path in this mapping wasn't correctly handled, which is why were using
> an absolute path here at all.
>
> So changing it to something like [1] (if that works), might be better.
>
> [1]
> https://github.com/jon-turney/cygport/commit/4175d456a9184c5cdebd8bfb4b5ba30583cedd66
>
> Sidenote: we should probably also be using file-prefix-map, now we're on a gcc
> which supports it.
>
>> The postinstall code then does not find any line number info with source path
>> /usr/src/debug/${PF}/...
>>
>> Could be fixed easily in line 414 of /bin/cygport:
>>
>> -declare -r top=$(cd ${_topdir}; pwd);
>> +declare -r top=$(cd ${_topdir}; /bin/pwd);
>
> Can you explain why this makes a difference?
In cygport, pwd is a bash builtin defaulting to -L; /bin/pwd defaults to -P.
Both commands support both options and we might expect the same output.
It would be better to use builtin `pwd -P` if that produces the correct result.
An STC script which creates test dirs to demonstrate the issue and show the
alternative outputs would be nice so anyone can see.
>> No patch provided because I'm not sure whether this has other negative side
>> effects.
>>
>> If this is the case, it possibly makes sense to print a warning if "$(pwd)" !=
>> "$(/bin/pwd)".
>
> This is not unreasonable, and I would take a patch doing this, as there have
> been places in cygport where there are bugs handling that in the past (and
> probably still are some, since it's not something that gets tested often).
--
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 à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
next prev parent reply other threads:[~2023-09-17 15:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9bc07a5f-86d9-76ee-f45d-e1956c9035f8@t-online.de>
2023-09-17 14:01 ` Jon Turney
2023-09-17 15:56 ` Brian Inglis [this message]
2023-09-18 10:41 ` Christian Franke
2023-09-18 10:58 ` Achim Gratz
2023-09-18 17:24 ` Brian Inglis
2023-09-20 10:58 ` Christian Franke
2023-10-29 16:05 ` Jon Turney
2023-10-30 16:37 ` Christian Franke
2024-02-11 17:01 ` Jon Turney
2024-04-29 19:44 ` Jon Turney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c23a4dd4-fb61-a503-7ff0-d302986ddf02@Shaw.ca \
--to=brian.inglis@shaw.ca \
--cc=Christian.Franke@t-online.de \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).