Skip to content
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

Simplify build process #36

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

haarg
Copy link
Contributor

@haarg haarg commented Jul 15, 2024

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.

ExtUtils::MakeMaker can parse "package NAME VERSION" syntax since 6.56,
which is included in perl 5.12, the same version that added support for
the syntax.
The minimum perl version is perl 5.12, which includes
ExtUtils::MakeMaker 6.56. We don't need compatibility code for versions
earlier than that.
@rra
Copy link
Owner

rra commented Jul 15, 2024

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
Copy link
Owner

rra commented Jul 15, 2024

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.

Move perlpodstyle to lib so it is installed normally. Also remove the
handling from Makefile.PL. It was being installed as a man(1) page, but
section 1 is the wrong location for it. If we don't configure anything
ourselves, ExtUtils::MakeMaker will install the man page in section 3.
This is not perfect, but matches what perl itself does with its
non-library pod files. In the future, perl may understand section 7 and
adjustments can be made for that.
The .PL files used to generate the pod2man and pod2text scripts only
adds a header to the files allowing them to be executed with a shell
rather than with perl. This hasn't been useful for decades. Any other
modifications needed to make the scripts runnable will already be taken
care of by ExtUtils::MakeMaker. We can just include them as normal
scripts. EUMM will also properly install the man pages without needing
any extra work.

We also don't need to convert the file paths to native paths ourselves.
EUMM will work properly using / as a directory separator for EXE_FILES
on all platforms.
@haarg
Copy link
Contributor Author

haarg commented Jul 16, 2024

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. Perl-Toolchain-Gang/ExtUtils-MakeMaker@14ff930 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
Copy link
Owner

rra commented Jul 30, 2024

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
Copy link

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.

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