vshaxe / hashlink-debugger

Visual Studio Code Debugger for Haxe/HashLink applications
https://hashlink.haxe.org/
MIT License
57 stars 23 forks source link

Could not start 'hl' process, executable was not found in PATH. #95

Open yeslayla opened 3 years ago

yeslayla commented 3 years ago

OS: Fedora 33

Hi there! :wave:

I'm trying to launch Hashlink via vscode launch.json to easily utilize the debugger, but for whatever reason it doesn't seem to be able to find my binary.

image

image

image

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "HashLink",
            "request": "launch",
            "type": "hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        }
    ]
}

compiler.hxml

-cp src
-lib heaps
-lib hlsdl
-hl hello.hl
-main Main
ncannasse commented 3 years ago

Maybe vscode runs with another user that does not have the same path ?

Le lun. 15 févr. 2021 à 12:17, Joseph Manley notifications@github.com a écrit :

OS: Fedora 33

Hi there! 👋

I'm trying to launch Hashlink via vscode launch.json to easily utilize the debugger, but for whatever reason it doesn't seem to be able to find my binary.

[image: image] https://user-images.githubusercontent.com/21203171/107936359-8dae2880-6f50-11eb-8796-14ec47eaf147.png

[image: image] https://user-images.githubusercontent.com/21203171/107936369-91da4600-6f50-11eb-917b-46800a60823f.png

[image: image] https://user-images.githubusercontent.com/21203171/107936555-cc43e300-6f50-11eb-9242-ec53354d88a1.png

launch.json

{

"version": "0.2.0",

"configurations": [

    {

        "name": "HashLink",

        "request": "launch",

        "type": "hl",

        "cwd": "${workspaceFolder}",

        "preLaunchTask": {

            "type": "haxe",

            "args": "active configuration"

        }

    }

]

}

compiler.hxml

-cp src

-lib heaps

-lib hlsdl

-hl hello.hl

-main Main

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vshaxe/hashlink-debugger/issues/95, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZXQFR5NT6N5AJUF2KNXLS7D7F3ANCNFSM4XUQFT4Q .

yeslayla commented 3 years ago

Maybe vscode runs with another user that does not have the same path ?

I wouldn't say it's impossible, but I run vscode directly from the terminal code [dir] with the same user as the terminal. image

image

I know dev containers are sometimes ran as the user vscode by default, but I have no vscode user in /etc/passwd

zagortenej commented 2 years ago

hashlink-debugger launches hl process using nodejs ChildProcess.spawn() (as it should) but, for whatever reason, spawned process does not seem to be getting environment set up correctly, or at least part of it, which may very well be an issue with nodejs in VSCode (didn't investigate that one further).

After installing HashLink from source build, hl ends up in /usr/local/bin folder, which is ok, and I can run it from terminal:

$ hl
HL/JIT 1.12.0 (c)2015-2020 Haxe Foundation
  Usage : hl [--debug <port>] [--debug-wait] <file>

and I can also compile my Haxe code to HL bytecode and run that with hl, no issues there.

None of this works when using VSCode launch.json configuration of the hl type.

The workaround goes like this:

XDG_RUNTIME_DIR and DISPLAYmay be different for you, just get them from "regular" terminal with:

$ echo $XDG_RUNTIME_DIR
/run/user/1000
$ echo $DISPLAY
:0

Once I had all of these set up I was able to run a simple hello world Heaps.io code in VSCode HashLink debugger.

rcstuber commented 2 years ago

What's your OS and arch?

zagortenej commented 2 years ago

Linux Mint 20.2 x86_64