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
319 stars 40 forks source link

Linux installation fails to build default application #263

Closed BrianHoldsworth closed 2 months ago

BrianHoldsworth commented 2 months ago

Hi. I'm using VSCode on Linux. I'm assuming it is suppose to be plug-and-play. I did nothing other than install the extension from the VSCode Marketplace, point the config at my Kickstart ROM, init a new Amiga program, and try to run it. It fails to build.

I get these errors in the terminal output:

*  Executing task: make -j4 program=out/a 

Compiling main.c
Compiling support/gcc8_c_support.c
Assembling support/gcc8_a_support.s
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `m68k-amiga-elf-gcc -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -ffunction-sections -fdata-sections -c -o obj/main.o /mnt/5A4F-F309/Retro/Amiga (Dev)/Abyss-Test/main.c'
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `m68k-amiga-elf-gcc -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -ffunction-sections -fdata-sections -c -o obj/gcc8_c_support.o /mnt/5A4F-F309/Retro/Amiga (Dev)/Abyss-Test/support/gcc8_c_support.c'
make: *** [Makefile:69: obj/main.o] Error 2
make: *** Waiting for unfinished jobs....
make: *** [Makefile:69: obj/gcc8_c_support.o] Error 2

 *  The terminal process "/usr/bin/bash '-c', 'make -j4 program=out/a'" failed to launch (exit code: 2). 

Additionally, I see this appear two times in the output window:

Error: the description can't be converted into a problem matcher:
{
    "base": "$gcc",
    "fileLocation": "absolute"
}

Perhaps I need to install something else manually? I don't have vasm, vbcc, vamos, or really any Amiga related stuff installed. Just VSCode and the extension.

Perhaps I should be getting the extension from GitHub and installing it manually, rather than using the marketplace version?

BartmanAbyss commented 2 months ago

Yeah, it's supposed to be plug'n'play. make is very picky about directory names. They must not contain spaces. I thought I added a check to the plugin, but apparently I didn't. Just make sure there's no spaces in your directory names and it should work. While you're at it, maybe remove the parentheses of the directory name as well.

BrianHoldsworth commented 2 months ago

@BartmanAbyss Thanks. It did help somewhat. With no spaces in the project path, I can indeed build the project successfully. However, it fails to launch the emulator with an "Error 127".

I verified that my Kickstart path in the extension settings is correct and has no spaces.

I still see many instances of this error in the VSCode Output window:

Error: the description can't be converted into a problem matcher:
{
    "base": "$gcc",
    "fileLocation": "absolute"
}
BartmanAbyss commented 2 months ago

The $gcc error shouldn't have anything to do with launching the emu. You should be able to get rid of it by installing the recommended C/C++ extension.

Unfortunately, I can't help you out with the emu launch problem as I am on Windows only. Can you gather some more information? Maybe with strace or something like that. Maybe @grahambates has some more pointers.

BrianHoldsworth commented 2 months ago

@BartmanAbyss Understood.

I can conform that disabling the clang extension and enabling the Microsoft C extension got rid of the Output window errors.

The exact error popup I am getting only says Emulator exited with code/signal 127 before debugger could connect.

I dug around the extension files and determined that the extension's copy of fs-uae was failing to launch because of a missing library. I installed the Linux package sdl2_ttf that it was looking for, and now all is working!

Thanks for the help! Very cool project. In fact, I am rather shocked to see such a high-level of modern Amiga development support. Congrats to you and all on the team!

BartmanAbyss commented 2 months ago

Thanks. I'm glad you got it working alright!