empathicqubit / vscode-cc65-debugger

VSCode extension for CC65 debugging with VICE or Mesen
Other
36 stars 6 forks source link

Issues installing/running the extension based on template #88

Closed bjartwolf closed 2 years ago

bjartwolf commented 2 years ago

In progres... I will update the text while I do some troubleshooting and add some more info...

Hi! Following up on your twitter message. Would love to get the plugin running, I gave up after some initial attempts. ⚠️ I might have messed up PATHs and even the plugin troubleshooting it... I think I have a clean install, but good to be aware that I did mess around a bit trying to get things to run... Will try to read the README with fresh eyes and make sure my system is farily reasonable setup...⚠️

I did have some attempts at having it run from WSL2, which I think got me into a few issues to begin with. I am now trying to run it in VS Code on a Windows 10 only environment and I am starting fresh based on https://github.com/empathicqubit/vscode-cc65-debugger/tree/master/src/__tests__/c-project-template

I copied the files except the main.c file (I am keeping my own right now) and the .vimspector.json file as I guess it is not required. I keep them at a separate branch https://github.com/bjartwolf/langtoncant/tree/try-vscode-cc65-debugger

My first attempt at pressing "Launch" the CC65 Vice Launch gives

image

process_begin: CreateProcess(NULL, echo, ...) failed.
Makefile:183: pipe: No error
C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe TARGETS=c64 all
make[1]: Entering directory 'C:/code/langtoncant'    
process_begin: CreateProcess(NULL, echo, ...) failed.
Makefile:183: pipe: No error
mkdir -p obj/c64
process_begin: CreateProcess(NULL, mkdir -p obj/c64, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [Makefile:289: obj/c64] Error 2
make[1]: Leaving directory 'C:/code/langtoncant'
make: *** [Makefile:326: all] Error 2

Just running

make

or

make OPTIONS=mapfile,labelfile,debugfile

gives the same error as when I try to launch, both in PowerShell and Command Prompt.

PS C:\code\langtoncant> C:\Users\bjart\.vscode\extensions\entan-gl.cc65-vice-5.1.2\dist\cc65\bin_win32_x64\cc65.exe --version

cc65.exe V2.19 - Git fd8d51497
❯ make --version
GNU Make 4.3
Built for Windows32
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
empathicqubit commented 2 years ago

What happens when you try to run these commands in cmd.exe?

echo
where mkdir
bjartwolf commented 2 years ago

I realize I do not know cmd.exe very well. I used to know how to write bat files...

C:\code\langtoncant>echo
ECHO is on.

C:\code\langtoncant>where mkdir
INFO: Could not find files for the given pattern(s).
empathicqubit commented 2 years ago

It looks like the script has determined that your system is Linux for some reason (mkdir -p). Do you have Git tools in your PATH? That caused some strange issues on my system and I had to remove them.

empathicqubit commented 2 years ago

Okay, what you posted looks correct.

empathicqubit commented 2 years ago

What happens if you remove pet from the Makefile targets? That's one thing I did to get it to work in my fork.

bjartwolf commented 2 years ago

I removed three git entries from the PATH, rebooted and WIN 🥳 image

bjartwolf commented 2 years ago

(I mean, we might need to figure out why, as removing git from the PATH is probably not a solution for most people in the long term...)

empathicqubit commented 2 years ago

Nice! I'll have to about how to handle this situation a little more.

empathicqubit commented 2 years ago

You shouldn't need to remove Git from the PATH, only the Unix tools it tells you not to install on the PATH because it might break things.

empathicqubit commented 2 years ago

Can you try it with only Git on the PATH?

empathicqubit commented 2 years ago

That would be the C:\Program Files\Git\cmd folder.

bjartwolf commented 2 years ago

Yes, so leave the C:\Program Files\Git\bin out.

empathicqubit commented 2 years ago

Probably. The problematic directory is usr\bin, since that masks echo. bin looks like it should be okay though.

bjartwolf commented 2 years ago

Yes, can confirm it fails with

C:\Program Files\Git\bin
C:\Program Files\Git\cmd

and works with C:\Program Files\Git\cmd in the PATH. Took a little time, had to restart to make sure the effect was there... It is easy to get false positives without deleting the build files and doing a proper restart...

empathicqubit commented 2 years ago

What's in your bin folder? I only have git, bash, and sh in there.

bjartwolf commented 2 years ago

Same.

bjartwolf commented 2 years ago

(The plugin is fantastic, being able to debug like this makes the program trivial to write :) The hard part of writing it was not having a clue what is going on when there is some random bug...)

empathicqubit commented 2 years ago

Odd. I'll look at it a little more. Thanks for letting me know about this.

empathicqubit commented 2 years ago

Thanks! I'm glad it's helpful to you. ^_^

bjartwolf commented 2 years ago

Let me know if you want me to test something - I can not promise fast response during xmas, but have time before new year... It sounds horrible to debug, supporting linux and windows is hard enough without stuff "leaking" between the two...

empathicqubit commented 2 years ago

Thanks! Testing against both systems is rather hellish sometimes. :| I would like to run integration tests against Windows but it goes so slowly in Github Actions that it eventually times out.

bjartwolf commented 2 years ago

I was thinking of trying to run things in WSL2, maybe that in theory would be easier, but then I remembered there is talking to VICE and some communication stuff going on that is probably not trivial either... And that might run in to another set of complexity....

With https://github.com/microsoft/wslg hopefully becoming more mainstream maybe you can ditch native support for Windows? WSLg is going to be generally available alongside the upcoming release of Windows.

empathicqubit commented 2 years ago

I'll have to think about that. I'm not sure if running the Makefile under WSL context will be more confusing for the users, but native Windows is a kind of frustratingly inconsistent environment sometimes.

empathicqubit commented 2 years ago

Thanks for the plug, btw