The ./site-generator should fail to run if all the perl modules needed are not installed #164

Closed
opened 2023-08-31 16:57:58 +00:00 by ken_fallon · 4 comments
Owner

Currently the perl script fails to run at different points when run.

Some modules only give errors when their template is called.

The script should not run at all if all the perl modules are not installed.

Currently the perl script fails to run at different points when run. Some modules only give errors when their template is called. The script should not run at all if all the perl modules are not installed.
Owner

This is not simple as far as I can tell. I have looked at collecting the module names by scanning the site-generator script itself, then feeding it to a mini-script that performs module checks. My tests used Module::Runtime which gives a fairly clean interface to the module check process, but what if Module::Runtime is not installed?!

Also, it seems that there are modules that are referred to only in the templates (though they may be sub-modules of those that are defined in site-generator). This needs investigation.

I think it would be easiest to write a script in utils that can be run to perform the check, and that's what I'm working on at present.

This is not simple as far as I can tell. I have looked at collecting the module names by scanning the `site-generator` script itself, then feeding it to a mini-script that performs module checks. My tests used ` Module::Runtime` which gives a fairly clean interface to the module check process, but what if ` Module::Runtime` is not installed?! Also, it seems that there are modules that are referred to only in the templates (though they may be sub-modules of those that are defined in `site-generator`). This needs investigation. I think it would be easiest to write a script in `utils` that can be run to perform the check, and that's what I'm working on at present.
Contributor

Would it be possible to create a "scanner" module that does nothing but try to reference all of the modules we use? Run that as a check up front and allow it to halt the rest of the script if anything is amiss?

Would it be possible to create a "scanner" module that does nothing but try to reference all of the modules we use? Run that as a check up front and allow it to halt the rest of the script if anything is amiss?
Owner

Would it be possible to create a "scanner" module that does nothing but try to reference all of the modules we use? Run that as a check up front and allow it to halt the rest of the script if anything is amiss?

Yes, that was what I was proposing. I think I had started writing something or had made some notes about how it might be done.

> Would it be possible to create a "scanner" module that does nothing but try to reference all of the modules we use? Run that as a check up front and allow it to halt the rest of the script if anything is amiss? Yes, that was what I was proposing. I think I had started writing something or had made some notes about how it might be done.
Owner
A [check dependencies bash script](https://repo.anhonesthost.net/HPR/hpr_generator/pulls/203) is [merged into main](https://repo.anhonesthost.net/HPR/hpr_generator/commit/1853715a19ee747d2873816814a221e42ffcb5ac)
rho_n closed this issue 2024-09-28 16:38:10 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HPR/hpr_generator#164
No description provided.