rra / podlators

Format POD source into various output formats
https://www.eyrie.org/~eagle/software/podlators/
Other
6 stars 11 forks source link

Simplify build process #36

Open haarg opened 3 months ago

haarg commented 3 months ago

This cleans up and simplifies the build process.

Some code was removed because it is no longer relevant on perl 5.12.

Some code was removed because we can rely on ExtUtils::MakeMaker to handle it.

The largest change is removing the .PL files to generate the pod2man and pod2text scripts. The only thing they enabled, allowing the resulting scripts to be run with a shell, has not been a useful feature for decades.

rra commented 3 months ago

I tried to drop the .PL files at one point in the past, and was asked to restore them by Craig A. Berry because, if I recall correctly, VMS relied on that mechanism and couldn't build without that level of indirection. I would be happy to remove them again, but I wanted to make sure that this is now definitely not required.

rra commented 3 months ago

Oh, also, perlpodstyle had special handling in Perl core, which was part of why it was separated out, since it's not installed as part of the module in Perl core. Is the intent to change Perl core to remove that special handling? If so, that's great; I just wanted to double-check.

haarg commented 3 months ago

perlpodstyle would still need special handling in core, but it would just be a minor tweak for the new location. The problem with the way things are currently in podlators is that the actual pod file is not installed, only the man page. As well as being installed in the wrong section.

It looks like I'll need to do some more research on the .PL scripts. Most other dists don't have the kind of special handling seen in these. In core, there are scripts in utils/ that do some of this, but I'm unclear on how much that is needed. https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/14ff930dd862286d6dafe4228b3a72415b5df9a5 seems to be an attempt at doing this in EUMM, but maybe it is incomplete. @craigberry, could you help clarify the state of this?

rra commented 3 months ago

Thanks, all of this looks great if we can get confirmation that VMS no longer needs the separate .PL files.

I'm happy to wait for that confirmation, or would be happy to merge a PR that included all the other changes except that change.

craigberry commented 3 months ago

Sorry for the slow reply. I believe how this used to work is that running the .PL file on unixy systems resulted in a script file with no extension and a shebang line that has been edited to have the path of the Perl used to run the .PL file. So then you can just run ./myscript and the shell will interpret the shebang line to invoke Perl and off you go. I don't know if the shebang line editing still happens or is still needed.

On non-unixy systems, there is no concept analogous to a shebang line. So it's always been simulated by creating a script in the native shell language with some tricks to exit and re-invoke itself as a Perl script. On Windows, the result of running the pod2text.PL file would be pod2text.bat, and on VMS it would be pod2text.com, each with its own magic code at the top to run the embedded Perl script (pod2man is not of much use on non-unixy systems since there is nothing that can read a man file).

As far as I know, nothing's really changed here about shebang or the lack of it. However, in core we define commands to invoke everything under the utils/ directory directly as Perl scripts and don't really use the shebang emulation. For example, pod2text is defined to run perl perl_root:[utils]pod2text.com. We could certainly change that to chop off the .com from the end, though that would make it different from everything else in the utils/ directory.

I fear I may just be muddying the waters. Let me know if I can clarify anything.