Re: How to CPAN dry run ?
by marto (Cardinal) on Aug 30, 2024 at 08:22 UTC
|
"How do I perform a dry run of a module installation ?
Use cpanm, cpanm --test-only DBI.
| [reply] [d/l] |
|
Note that cpanm --test-only will install any unsatisfied dependencies.
| [reply] [d/l] |
Re: How to CPAN dry run ?
by ikegami (Patriarch) on Aug 30, 2024 at 15:15 UTC
|
You could install to a temporary directory by providing an install base via PERL_MM_OPT and PERL_MB_OPT.
| [reply] |
Re: How to CPAN dry run ?
by afoken (Chancellor) on Aug 31, 2024 at 09:51 UTC
|
How do I perform a dry run of a module installation ?
Let me propose something unconventional:
Create a virtual machine, and create a snapshot BEFORE the installation. Then do a cpan My::New::Module and watch it fail, crash and burn. Revert to the snapshot, fix the problems, and try again.
I did something very similar to get a custom application installed in the last century. My installer required a fully patched Windows 2000 server and a database. Everything after that (webserver, perl, modules, application) was installed by my installer. To test the installer, I used a virtual machine set up with W2K, DB and patches, took a snapshot, and watched my installer fail over and over again, reverting the VM after each fail. See Re: How do you distribute your Perl application to your customers? and Re^3: How do you distribute your Perl application to your customers?.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] [d/l] |
Re: How to CPAN dry run ?
by Danny (Chaplain) on Aug 30, 2024 at 16:46 UTC
|
On a related note, is there a good way to log all the unsatisfied dependencies without installing anything? On Cygwin I like to install modules from the Cygwin repository if available so they get updated etc. I often end up installing via cpan then look up all the newly installed dependencies and checking if any are available from Cygwin. Then I have to go back and remove from /usr/local/... | [reply] |
|
| [reply] [d/l] |
|
| [reply] |
Re: How to CPAN dry run ?
by stevieb (Canon) on Aug 30, 2024 at 08:18 UTC
|
How do I perform a dry run of a module installation ?
What do you want to dry run against? Your current situated environment? A Windows, Linux or MacOS installation nearby? Do you want to ensure compilation of low-level code that isn't pure perl?
Your question is very vague. It almost seems as though you have a complaint against an unimplemented flag, yet you haven't provided any tests or anything.
You don't 'execute' downloads. If a distribution has direction, it is often make test. Done. All tests performed, including dependency checks, and nothing installed.
| [reply] [d/l] |
|
| [reply] [d/l] [select] |
|
| [reply] |
|
"Your question is very vague. It almost seems as though you have a complaint against an unimplemented flag, yet you haven't provided any tests or anything."
It's not a complaint, it's an observation based on what the documentation tells people:
"Do a dry run, but don't actually install anything. (unimplemented)"
I'd argue the question isn't vague, since they ask how to do a specific thing.
| [reply] |
|
What do you want to dry run against? Your current situated environment? A Windows, Linux or MacOS installation nearby? Do you want to ensure compilation of low-level code that isn't pure perl?
I want to review whatever cpan is doing (or going to do), and pre-determine the success of an operation before it actually modifies or installs anything, especially on a production server.
I could tolerate it downloading and installing things into 1 single known temporary directory that I can rm -rf afterwards as long as I can isolate all of its changes (and [preferably] easily rollback).
I'm also surprised the -n option still isn't implemented after +10 years.
| [reply] [d/l] [select] |
|
| [reply] |