On 25/05/2024 08:25, Daisuke Fujimura via Cygwin-apps wrote:
Having seen this commit (
https://cygwin.com/git/?p=cygwin-apps/cygport.git;a=commit;h=9e82685e32f6717675e9f6bf55dd1336e3fc3831
),
I understand that this is problematic from a reproducibility point of
view, but I would like to be able to specify a `-fdebug-prefix-map`
because C sources with code like `#include __FILE__` cannot be
compiled.

https://github.com/cygwin/scallywag/actions/runs/9002845391/job/24732313857#step:6:1302

```
/cygdrive/d/a/scallywag/ruby/ruby-3.3.1-1.x86_64/src/ruby-3.3.1/debug_counter.h:359:10:
fatal error: /usr/src/debug/ruby-3.3.1-1/debug_counter.h: No such file
or directory
359 | #include __FILE__
| ^~~~~~~~
compilation terminated.
```

The patch is as follows.

Thanks very much for the patch.

Yeah, I tripped over this when I was testing your previous patch.

This seems like a generic problem which everyone is going to have with ruby, though. And from a brief look at the debug_counter.h header, it does seem like a case of excessive cleverness - on first glance, it looks like this could just be written using a separate header, rather than recursively including itself with some define set...

(and I guess it's actually a gcc bug, or at least misfeature, that you can make '#include __FILE__' do something other than it's plain meaning)

Nevertheless, I guess this is needed.

Shell variable names in the patch should be changed to appropriate ones.

Yeah, not sure what a good name for this is. Something like 'DEBUGINFO_ONLY_DEBUG_PREFIX_MAP', maybe?

It needs to be mentioned in the documentation somewhere, as well.

Reply via email to