Skip to content

Magic v2 Internal Code Conversions - #24547

Closed
leonerd wants to merge 0 commit into
Perl:bleadfrom
leonerd:magic-v2-phase1-conversions
Closed

Magic v2 Internal Code Conversions#24547
leonerd wants to merge 0 commit into
Perl:bleadfrom
leonerd:magic-v2-phase1-conversions

Conversation

@leonerd

@leonerd leonerd commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

(This is a dependent PR that requires first that #24163 be merged)

The three four new commits here are each individual conversions of static internal magic types to use magic v2. None of them are strictly "required", but we felt it useful to have some code sitting around that uses magic-v2, as a demonstration that it works. These ones were picked because they're all static and don't have associated PERL_MAGIC_* constants anyway, so there's no way that external code / CPAN / DarkPAN would be aware of them in any way that this could break.

@leonerd leonerd added the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jul 8, 2026
@leonerd

leonerd commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

All three commits currently introduce new warnings when building with g++, as discussed at some length over in #24508 (comment) and which ultimately lead to the mailing list discussion about using g++ in the first place:
https://www.nntp.perl.org/group/perl.perl5.porters/2026/06/msg271009.html

I still don't have a satisfactory solution to this problem. My personal vote is "lets stop caring about building Perl using g++".

@tonycoz

tonycoz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Another one would be argvout_vtbl in doio.c, that's on an IO but it only uses the free and dup callbacks.

@tonycoz

tonycoz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

It looks reasonable, but I think the g++ build thing needs to be resolved one way or another.

@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from b1fde0c to 32d5641 Compare July 10, 2026 15:27
@leonerd

leonerd commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

I've opened a new issue (#24553) to discuss the g++ warnings issue

@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from 32d5641 to 173a190 Compare July 13, 2026 13:00
@leonerd

leonerd commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Ahyes; I had missed the one in doio.c before, but now added. I don't know why it had previously been using PERL_MAGIC_uvar as it didn't seem to be using any of the special get/set behaviour that provides, just free and dup. So it might as well be a MGv2s_BASE now.

@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from 173a190 to c1bef0a Compare July 14, 2026 10:37
@leonerd leonerd removed the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jul 16, 2026
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from c1bef0a to c705d33 Compare July 16, 2026 12:20
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from c705d33 to 1d3f27f Compare July 17, 2026 14:44
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch 2 times, most recently from a3bd9d0 to 7b1e3bd Compare July 20, 2026 11:40
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch 6 times, most recently from 3bfab2a to 25ce5aa Compare July 27, 2026 10:30
#define NEEDS_LINES 1

static const MGVTBL PerlIOEncode_tag = { 0, 0, 0, 0, 0, 0, 0, 0 };
/* An empty hook structure just for the purpose of marking an SV */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:encoding has always struck me as the sort of module that should be dual-life, but clearly absolutely no one wants that responsibility so probably this is fine.

@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from 25ce5aa to a9b1f24 Compare July 27, 2026 17:07
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from a9b1f24 to a194182 Compare July 27, 2026 20:57
@leonerd

leonerd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Annoyingly, github appears to believe this PR wants to add 6 commits, even though the first 2 of those have already been merged; this would only do the other 4. Rather than risk an upset here I will merge it on commandline.

@leonerd
leonerd changed the base branch from blead to smoke-me/optimize_nothing_ops July 28, 2026 11:33
@leonerd
leonerd changed the base branch from smoke-me/optimize_nothing_ops to blead July 28, 2026 11:33
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from a194182 to 7c9c085 Compare July 28, 2026 11:50
@leonerd leonerd closed this Jul 28, 2026
@leonerd
leonerd force-pushed the magic-v2-phase1-conversions branch from 7c9c085 to ab4447b Compare July 28, 2026 12:54
@leonerd
leonerd deleted the magic-v2-phase1-conversions branch July 28, 2026 12:54
@leonerd

leonerd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

github is confused about what I did here. This was merged with a local git merge --ff-only, to preserve the identity of each of the 4 commits

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.

3 participants