Correct way to ActivateState Perl state project for Komodo integration

What is the correct way to integrate an ActiveState Project with Komodo so that Komodo correctly loads the scripts from the activestate.yaml file?

I would like to integrate a Windows 11 Active State Perl project with a Komodo 12 Perl Project. I experience 100% failure where the Komodo project does not load scripts from the activestate.yaml file. Other errors occur where the state activate command fails due to dependency issues.

Process typically goes

  1. Establish ActiveState Perl project on Web
  2. Activate the ActiveState Perl Project from Windows cmd.exe with state activate
    This step can fail with error message citing unresolvable dependencies.
  3. Launch Komodo via ko from the same cmd.exe shell as the prior step 2.
  4. Proceed through the Komodo State integration wizard choosing project name, directory path, and the Perl language.

Here Komodo bottom pane notification status tab always shows could not load scripts from activatestate.yaml, while the Toolbar pulldown shows “Downloading and Activating project”

After exiting Komodo I routinely run the powershell command
powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/stop.ps1’)))”
to stop running state tool processes- there are usually several such running processes.

Periodically I also force clean up of the cached project, which compels another invocation of the stop process command.

My next recourse will uninstall and reinstall Komodo in Windows 11 and then attempt to use the State Tool and Komodo from a Linux environment.
Thanks for your help. In combination State Tool and Komodo have proved frustratingly useful.

1 Like

@wilb, didn’t you say that the error with the activestate.yaml scripts also occurs in a CMD window? So the issue isn’t related to Komodo, correct?

Hi CareyH,
Thanks again. While trying to use the State Tool / Komodo Integration, I don’t know enough to determine where State Tool ends and Komodo begins and vice versa.
I attempted and failed to activate activestate.yaml through both the Komodo Cmd tool menu and through the Komodo Side Toolbar menu “reactivate” . What is the CMD.exe Command Line command to load/run/execute activestate.yaml?
TinyTake Screen Recording of :

Regards,
WilB

1 Like

Full reference document for the State Tool is available online here:

1 Like

Thanks. Is there a way to verify the file activestate.yaml ?

attempting to run script activationMessage from Komodo commando state run
“Your script failed to execute: Failed to get output of where perl”

End of the log file
TypeError: command.isExecutable is not a function

  • stack
    getCommandStr@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process/subprocess.js:412:16
    subprocess_win32@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process/subprocess.js:1043:18
    subprocess.call@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process/subprocess.js:456:20
    initialize@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process.js:45:14
    constructor@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/core/heritage.js:145:23
    spawn@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process.js:153:10
    this.run@chrome://komodo/content/sdk/shell.js:170:23
    runSh@chrome://state/content/js/sdk/tool.js:310:20
    activate@chrome://state/content/js/sdk/tool.js:664:9
    this.activate@chrome://state/content/js/sdk/tool.js:717:9
    this.reactivate@chrome://state/content/js/sdk/tool.js:875:13
    updateMenu/<.command@chrome://state/content/js/button.js:85:21
    dynamicButton/this.updateMenu/<@chrome://komodo/content/sdk/dynamic-button.js:382:61
    – EXCEPTION END –
    [2022-03-23 15:39:39,299] [ERROR] tool.js: Process exited with code ‘-1’. Error:
    Traceback from ERROR in ‘tool.js’ logger:
    Logger.prototype.error@chrome://komodo/content/sdk/logging.js:411:27
    getDefaultCallbacks/<.onFail@chrome://state/content/js/sdk/tool.js:176:38
    activate/callbacks.onFail@chrome://state/content/js/sdk/tool.js:656:17
    runSh/<@chrome://state/content/js/sdk/tool.js:336:17
    emit@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/event/core.js:96:9
    handleError@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process.js:108:7
    initialize/<@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/system/child_process.js:92:19
    delay/<@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/lang/functional/concurrent.js:38:20
    notify@resource://gre/modules/commonjs/toolkit/loader.js → resource://gre/modules/commonjs/sdk/timers.js:40:9

[2022-03-23 15:39:49,631] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429

@wilb, CMD is the Window command prompt terminal (not Powershell). You can start a CMD session by press the Windows Start button, typing cmd and selecting the Command Prompt. I had assumed you were using this already as you have mentioned before that you start Komodo from your terminal but perhaps I misread.

Once you’re in the CMD session, please confirm that you can state activate and state run activateMessage.

-Carey

1 Like

Regrets for the confusion. I invoke CMD.exe from the PowerShell prompt and then run ko from that CMD.exe shell.

Thanks @wilb. Please verify ^^.

1 Like

Both commands appear to succeed.
Screen recording.
Screenshot:

Ok thanks for confirming all that and sorry for the delayed reply.

How it SHOULD work
So the correct way to have Komodo with with the platform is to create a Komodo project in the same directory as you activestate.yaml file. Komodo then detects your yaml file and activates your project and sets the necessary env vars, which includes updating your system PATH to put the newly installed languages first on your PATH so Komodo SHOULD find it and everything should work perfectly.

The Issue
The issue here, which we discovered over in the Komodo forums, is that the State Tool creates a batch file for executing Perl instead of an executable (*.exe). Komodo doesn’t interpret Batch files as executable I guess so it doesn’t find it when it looks for Perl on your PATH (Preferences > Languages > Perl > Use this interpreter: Find on Path).

The Bug
This would be a bug in Komodo on Windows. Unfortunately, it’s not a bug that is likely to get fixed any time soon.

The Workaround
It looks like you’ve switched to WSL which appears to avoid the issue though I’m surprised that Komodo interprets things properly when launched from WSL. I’m not aware of anyone else trying Komodo from WSL (or I WAS aware of someone trying it and I’ve since forgotten).

  • Carey

Thanks careyh.

Instead running Komodo under WSL Ubuntu, I’m Remote Debugging with Windows Komodo connected to WSL Ubuntu State Tool Perl on the same PC. An initial Remote Debug session followed the Komodo setup steps for environment variables, port, etc. and worked fine. I still have work for Windows Komodo to accept WSL Ubuntu filename paths for project data and configuration files.

1 Like