Skip to content

ParseXS - Disable alias value collision warnings by default #20517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

demerphq
Copy link
Collaborator

We always had a bug with the value 0, when fixing it, we discovered a lot of people were doing duplicate aliases with 0. This patch disables the warnings except when in a special dev mode, as it makes no sense to show warnings like thus to end users, its not a system issue its a code issue, and only the XS files author can fix it. It would seem most times its not an issue and is entirely deliberate. So showing such warnings only on request also makes sense.

@demerphq demerphq mentioned this pull request Nov 16, 2022
@demerphq demerphq force-pushed the yves/dev_mode_parsexs branch 2 times, most recently from fa6606c to 6cc0635 Compare November 16, 2022 12:09
We always had a bug with the value 0, when fixing it, we discovered a lot
of people were doing duplicate aliases with 0. This patch disables the warnings
except when in a special author mode, as it makes no sense to show these warnings
to end users. It would seem most times creating such aliases is not an issue and
is entirely deliberate. So showing such warnings only to module authors and only
on request also makes sense.
@demerphq demerphq force-pushed the yves/dev_mode_parsexs branch from 6cc0635 to 40db0dd Compare November 16, 2022 12:14
@demerphq
Copy link
Collaborator Author

Those last pushes include tests and a fix for perl 5.8

@demerphq demerphq marked this pull request as ready for review November 16, 2022 12:15
@jkeenan
Copy link
Contributor

jkeenan commented Nov 16, 2022

We always had a bug with the value 0, when fixing it, we discovered a lot of people were doing duplicate aliases with 0.

Could you be a bit more specific in this commit message, e.g., a reference to a bug ticket or a user complaint? How far back in time does always cover?

This patch disables the warnings except when in a special dev mode, as it makes no sense to show warnings like thus to end users, its not a system issue its a code issue, and only the XS files author can fix it. It would seem most times its not an issue and is entirely deliberate. So showing such warnings only on request also makes sense.

@jkeenan
Copy link
Contributor

jkeenan commented Nov 16, 2022

Those last pushes include tests and a fix for perl 5.8

What about perl-5.8 needed to be fixed?

@jkeenan
Copy link
Contributor

jkeenan commented Nov 16, 2022

I can confirm that this does turn off the warnings that begin with Warning::

$ zgrep -c 'Warning:' 40db0ddf69.freebsd.threaded.clang10.dev_mode_parsexs.maketp.output.txt.gz
0

There were 15 such warnings being generated in blead at eae8123.

@demerphq
Copy link
Collaborator Author

How far back in time does always cover

I don't specifically. I haven't checked. It wouldn't surprise me if it either dates back to Larrys code on xubpp, or the refactor that produced ParseXS, or alternatively I would not be surprised if the warning was added after the fact, and was misimplemented when it was.

What about perl-5.8 needed to be fixed?

In the initial push of this patch I used // (defined-or), which isnt supported in 5.8. Nothing big.

@demerphq
Copy link
Collaborator Author

e.g., a reference to a bug ticket or a user complaint?

I said before I noticed it while I working on silencing the non-buggy part of the warning.

How far back in time does always cover?

Long enough that we have multiple files in core that exploit the bug. See #20496 (comment)

@demerphq
Copy link
Collaborator Author

I checked, it is present in the original version of ParseXS from 2005:

commit 6b09c16
Author: Yitzchak Scott-Thoennes sthoenna@efn.org
Date: Wed May 18 00:13:40 2005 -0700

@demerphq
Copy link
Collaborator Author

@tonycoz any thoughts on this? id like to merge tomorrow.

@demerphq
Copy link
Collaborator Author

Im going ahead with this. I dont think it makes anything worse.

@demerphq demerphq merged commit 78582e3 into blead Nov 20, 2022
@demerphq demerphq deleted the yves/dev_mode_parsexs branch November 20, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants