BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
318 stars 40 forks source link

Failing to work with GIT Bash #39

Closed rafamiga closed 4 years ago

rafamiga commented 4 years ago

Hi,

I've installed this plugin on a Windows 7 system with GIT Bash package. After slight modifications to tasks [removed amiga.bin-path, added static paths] I was able to run compilation but it fails:

process_begin: CreateProcess(NULL, m68k-amiga-elf-gcc -g -MP -MMD -m68000 -Ofast -nostdlib -Wall -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -Wa,-g -xassembler-with-cpp -c -o obj/gcc8_a_support.o C:/Users/rafamiga/OneDrive/tmp/amiga/amiga-1st/support/gcc8_a_support.s, ...) failed.

It's obvious paths inserted here [and in fact everywhere] adhere to Windows convention while GIT Bash [MINGW64] expects something like /c/Users...

I'm no VS guru nor any kind of expert but can you think of a way to tweak this in either VS or plugin settings?

BartmanAbyss commented 4 years ago

Hi. why did you need to modify tasks.json? Do you have a 64-bit version of Windows? I don't know why a installed GIT Bash would matter.. Did you just create a new project and tried to build? It should work out of the box.

rafamiga commented 4 years ago

OK, here's the situation:

I'm still using Windows 7 so I don't have built-in bash [vendor's version] hence I use GIT Bash. It works quite alright most of the time.

I all boils down to VS/plugin inserting paths in a usual Windows form, with the drive letter and a colon, like this:

C:/Users/rafamiga/OneDrive/tmp/amiga/amiga-1st/support/

Now, GIT Bash does not subscribe to this convention, it uses a Unix-like one:

/c/Users/rafamiga/OneDrive/tmp/amiga/amiga-1st/support/

That's the reason I had to modify tasks.json; instead of variables I had to use hardcoded filenames like:

"command": "/c/Users/rafamiga/.vscode/extensions/bartmanabyss.amiga-debug-1.0.0/bin/gnumake.exe", "PATH": "/c/Users/rafamiga/.vscode/extensions/bartmanabyss.amiga-debug-1.0.0/opt/bin/;/c/Users/rafamiga/.vscode/extensions/bartmanabyss.amiga-debug-1.0.0/bin"

because variables here seem to adhere to Windows convention.

I'm sorry for not describing it adequately.

I think the example will work out of the box, it starts compiling but the show stopper is the path inserted to m68k-amiga-elf-gcc and I bet other script commands as well – they stick to Windows convention. I'm looking for a way to change it and hence my question.

Maybe there's a VS setting to change C:\ convention to /c/ or maybe it's a plugin setting?

rafamiga commented 4 years ago

OK, I did a little googling and found the same issue here:

https://github.com/microsoft/vscode/issues/35593

Although there's no solution there, it's a good start to find the fix for my [and others'] problems.

rafamiga commented 4 years ago

OK, it seems this tweak in tasks.json does the trick:

 [...]
  "version": "2.0.0",
    "windows": {
        "options": {
            "shell": {
                "executable": "c:\\windows\\system32\\cmd.exe",
                "args": ["/d", "/c"]
            }
        },
    },
        "tasks": [
        {
[...]
BartmanAbyss commented 4 years ago

Glad it works for you.