Keep Komodo Perl Project in sync with State Tool cached versions

Hello.

After cleaning State Tool cached projects via state clean , how do I update the Komodo Project preferences so that it “finds” the proper State Tool project executable and libraries ? (And the reverse, how do or should I update Perl libraries in a Komodo project and have them present in the State Tool project where I originally launched Komodo via ko?)

A Komodo Project that recently worked now fails to find XML/Compile/WSDL11.pm . The error message attached came from pressing Go in Komodo. The error appears to refers to older cached project path.

Thanks again,
Wil Blake

@wblake, I think you configured Komodo manually to point at the cached Perl install right? Check your Edit menu > Preferences > Langauges > Perl: Use this interpreter pref.

I think this comes back to the issue where the State tool installs a *.bat file instead of an *.exe so Komodo don’t know what to do with it (it only looks for binary files). You probably need to manually point it at the new cached install location.

Hello careyh,
The Komodo Project now builds but the Ctl-R Run command
perl -c filename
results in
‘perl’ is not recognized as an internal or external command,
operable program or batch file.
Previously Ctl-R perl -c worked and it helps to quickly look for errors after making source changes.
Thanks,
Wil Blake

You can use %(perl) in your Run Command (uses the preferences defined) but if you’re getting the ‘perl’ is not recognized as an internal or external command it means Perl isn’t on your path so you should look into the things that could cause that:

  • you’re not state activateed in the shell you started Komodo from
  • you’re overriding PATH variable in your Preferences > Environment
  • Other reasons your PATH isn’t correct.

Carey

I probably set the path to the old project and neglected to update it. Thanks.

When I launch Komodo from (what I think is) a State Tool Project environment. Komodo does not seem to inherit the State Tool project settings.
Steps :

  • Launch cmd.exe
  • state activate <state project>
  • cd to the Komodo project directory
  • run ko

Komodo starts but the IDE Go command results in the library / module failures cited above.
Also the Commando Run fails to find the Perl executable as described above. Ditto the Commando Shell for invoking the State tool.

AFAIR at one point I may have in frustration uninstalled Komodo and reinstalled it to get it to “see” the State Tool Project that launched it.
Thanks.

@wblake,

It’s hard to diagnose the issue without feedback. What did you try from my suggestions? What did your investigation of your Komodo Environment pref find? Did you confirm that you are pointing at the correct Perl in your Language Preferences? You would get module errors if Komodo was running the wrong Perl interpreter.

Also, please clarify your Go Command that you’re running. Is that a tool box command? What exactly are you executing?

Have you tried this in the CMD window to confirm things run properly there? If they do, can you investigate what might be different between the two envs? Do you see @INC or PERLLIB5 env vars set in the CMD window and are missing from Komodo?

Where you can, please copy and paste input and output of commands you run. Where you can copy and paste stuff, please include screenshots.

Hi careyh,

Thanks for your help. Is there a way to determine what State Tool project name corresponds to a particular cache subdirectory in AppData\Local\ActiveState\cache? I have two cache directories and cannot match them to the “state activate” command that created them.

To clarify “Go Command,” “Run Command,” and the PATH preferences setting in the Komodo Project Environment and the Default Perl Interpreter in the Komodo Project Perl Language:

I refer to the Go Command from the Komodo Toolbar to start a debugging session. Screenshot follows.

I refer to the Run command as the Komodo IDE menu sequence Menu/Run with shortcut Ctl-R Screenshot follows.

In the State Tool project CMD Window the perl and state commands work. Screenshot follows.


I subsequently launch Komodo and then the Go command and Run commands above typically do not work without edits to the Preferences for the Project Environment PATH and Perl Interpreter shown below.

I set the Komodo Project Preferences Environment path to one of the cached projects exec directory.

The Komodo Perl Language Preferences reflect a different cached project.

Thanks again,
WilB

Use which perl (on Windows it’s where perl) in an activated state in your terminal. That will tell you where that particular install is for that project.

Don’t do this. Undo this change. I thought I had mentioned that when looking for this, you should remove it, not add it but I could have left that part out.

That doesn’t look like the correct interpreter. Can you confirm using the where perl command in Cmd that that is the correct file?

Thanks for your help. I will check which perl and unwind the path setup. I also just noticed that the Go command has a Debug Options tab to set environment values as well. I haven’t used this.

The Ctl-R shortcut Run command has a Path variable set as well.

The Perl path returned by “where perl” from the command window matches the Komodo Project Perl Language Preferences Default Perl Interpreter:
C:\Users\wblake\AppData\Local\activestate\cache\91ae0d70\exec\perl.bat

You’re debug dialog looks fine. The Default Env Vars are what Komodo detected. You haven’t set any in the User Env Vars section so that’s good (unless of course you need to set something for your program, then you can feel free to add some but generally, never override PATH).

For the Run Command, remove the PATH variable override. That’s obliterating your system PATH.

This looks good! This should be the only thing you need to set.

Thanks for your help. I’m learning a bit more. I now suspect that my Komodo Perl DBI project leveraged the worng State Tool project and switching back and forth between the Komodo Perl DBI and Komodo Perl SOAP projects hosed up things. I think I’m close to another breakthrough and may work on that yaml file error next.

That’s quite possible depending on where you set the Interpreter variable. I think you’re on the right track setting it in the Project level prefs which you showed in your previous screenshot message.

Now I see that the Platform Project uses the wrong perl. Can I delete the web Platform Project and local file activestate.yaml and allow Komdo to recreate it?
PlatformProject

Komodo Activestate.yaml

@wblake, no need to delete the project or any files. This is literally what the state tool and platform is made for, language install management:

  1. Change the Perl version in the browser and “Commit” the change
  2. state pull in the project folder in your Cmd window
  3. state activate. I THINK this is the final step. You might need to exit the “activated state” THEN state activate.

Running state activate from Komodo Commando opened a Cmd.exe shell window and activated the Platform Perl Project that launched Komodo instead of the Platform Komodo project shown above. I can see that having two different projects is confusing both to me and to Komodo. Thanks for your help.