Skip to content

Conversation

@5c30
Copy link

@5c30 5c30 commented Aug 13, 2025

Do not pass a podroot argument to pod2html if $podroot is empty. $podroot (via original_prefix('core')) is empty if perl is built with no prefix. An argument of '--podroot=' with no value causes pod2html to fail.

Do not pass a podroot argument to pod2html if $podroot is empty. $podroot (via
original_prefix('core')) is empty if perl is built with no prefix. An argument
of '--podroot=' with no value causes pod2html to fail.
@Leont
Copy link
Member

Leont commented Aug 14, 2025

$podroot (via original_prefix('core')) is empty if perl is built with no prefix.

That does not make sense, that should never happen AFAIK. Sounds like you're working around a bug elsewhere? Is this a Windows thing or something?

@5c30
Copy link
Author

5c30 commented Aug 14, 2025

I'm sure it's not common, but yes I am working around a problem. I came across this is my own distro, where I build perl (and everything else) without a prefix.

I'm suggesting it here because I don't think it has any other impact on the code, and avoids the problem should it ever come up for anyone else.

@5c30
Copy link
Author

5c30 commented Aug 15, 2025

In re-reading I noticed I misunderstood part of your comment and my response wasn't very clear. Sorry about that. I missed the word "elsewhere", which changes my answer to "no, I believe the bug is here." I have been working around the problem (for quite a while) by skipping tests whenever M::B is installed.

I'll try to reword in the hope I can be more clear. In the end, this is an edge case so I don't want to take too much of anyone's time.

In my environment, system perl is built with an empty prefix (-Dprefix=). The call to $self->original_prefix('core') returns installprefixexp, which is also empty when prefix is empty. That is how $podroot ends up empty in the code here.

When installing M::B and running tests, t/ppm.t fails, as well as the screen being filled with pod2html usage messages and error text of the form:

Option podroot requires an argument
t/ppm.t: -: invalid parameters

I found the problem to be here, where --podroot= is always passed to pod2html, and there is no accounting for the fact that it could be empty.

This patch fixed the problem for me, and the changes only affect the case of an empty $podroot, which is already broken.

In the other uses of $podroot (assembling $podpaths), when the prefix is empty the paths mapped through abs2rel will stay the fully-qualified paths so I don't believe any changes are necessary here. But again, the only consideration is this edge case of an empty prefix and whether the generated html links are correct.

I don't have enough of an understanding why it was chosen to break off prefix into a podroot arg, relativise the other paths in podpaths with the absolute path to blib. It was done in 876e97c to fix links in the generated html, where previously podroot was just $self->blib. I suspect podroot could be dropped entirely with podpaths containing the absolute paths? I am not suggesting that however, as it's a more intrusive change and I don't know that it's correct. If any links are generated incorrectly after this change, it would only be in the (currently broken) edge case being discussed, and they would have been broken the same way before.

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