PerlAlien / App-af

Command line tool for alienfile
2 stars 0 forks source link

Unspecified dependency on Mojo::Dom58? #5

Open jjatria opened 5 years ago

jjatria commented 5 years ago

I suspect that this is not really an issue with af per-se, but with the Download plugin (so I could close this and open one there), but I figured I might as well post it here, since this is how I came across this issue:

When trying an install --dry-run, I encountered the following error:

Alien::Build> error in probe (will do a share install): external command failed at /home/jjatria/.perl5/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/Alien/Build/CommandSequence.pm line 71.
Alien::Build> Don't panic, we will attempt a share build from source if possible.
Alien::Build> Do not file a bug unless you expected a system install to succeed.
Can't locate Mojo/DOM58.pm in @INC (you may need to install the Mojo::DOM58 module) (@INC contains: ... ) at Alien/Build.pm line 314.

It looks like something is falling back on something that depends on Mojo::DOM58, and that should be declared as a dependency.

plicease commented 5 years ago

Prereqs for an alienfile are inherently dynamic, and may change over time. This is to keep system integrators happy (and generally peoples who do not need to do a source install). Likely this is because you upgraded Alien::Build since the last time the install step for this alienfile was run, as we recently changed the default decode plugin to use pure-perl Mojo::DOM58 instead of the XS based HTML::Parser. Although other things can cause it, like if the system libs are uninstalled etc. Normally any changes to the prereqs only matter at configure time, and most modern cpan clients will make sure they are installed. af is mainly intended as an Alien author tool, but it can tell you what prereqs are needed by using the af missing and af requires commands. You can use this short-cut:

af missing | cpanm

to install anything that is missing.

plicease commented 5 years ago

--dry-run just installs into a temp directory, so no share directories are overwritten (it's functionally equivalent to af install --prefix=/tmp/xxxxxxxx (where xxxxxxxx is picked at random). af itself doesn't try to (directly) install any prereqs. It does have the capability to compute the prereqs for just the alienfile. It might be a nice feature to optionally install prereqs as well, but I'm hesitant to replicate functionality in cpanm et. al. If it were to to do so it should call a dedicated cpan client.

jjatria commented 5 years ago

The af missing | cpanm example makes sense, but in that case maybe the error message can be tweaked to point people in the right direction. I'm thinking in the end maybe something like what dzil does: identify that some requirements are not met, and tell the user how to fix it.

As it stands, when I ran into this problem it wasn't clear whether this was an error in af itself, something that I as an alienfile developer should worry about, or some other problem somewhere else.

plicease commented 5 years ago

yeah fair.

Need a method (maybe in Alien::Build, maybe not) that computes a list of missing prereqs for a given $phase and print them out with an appropriate diagnostic and exit 2 instead of using die.