vscode-amiga-debug icon indicating copy to clipboard operation
vscode-amiga-debug copied to clipboard

MacOS: Permission errors

Open m4rkus opened this issue 1 year ago • 15 comments

Thanks a lot for the macOS support! There seems to be some kind of file permission problem with the extension. I get this (VS Code Version: 1.74.0, macOS 13.0.1 (22A400), Apple Silicon) when compiling the test-project:

Compiling main.c
make: m68k-amiga-elf-gcc: Permission denied
Compiling support/gcc8_c_support.c
make: m68k-amiga-elf-gcc: Permission denied
make: *** [obj/main.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [obj/gcc8_c_support.o] Error 1

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

m4rkus avatar Dec 21 '22 00:12 m4rkus

Manually changing permissions solved it of course but assume that it should work out of the box :)

m4rkus avatar Dec 21 '22 01:12 m4rkus

@grahambates Did I forget to change path names somewhere?

BartmanAbyss avatar Dec 21 '22 13:12 BartmanAbyss

No, the path names which contained version numbers were wrong at some point, but that was fixed before the current release.

What's supposed to happen is that the extension chmods all the binaries on startup as the package is built on Windows and doesn't preserve permissions. Perhaps that's failing for some reason. @m4rkus did you see any error messages / output in VS Code to that effect?

grahambates avatar Dec 21 '22 15:12 grahambates

@grahambates Yes, don't remember exactly but it failed to resolve the path cc1 or something like that. I reinstalled the extension to find out what the exact error message was, but now I cannot reproduce the problem 🙃

m4rkus avatar Dec 21 '22 17:12 m4rkus

I'm a bit stumped on this one. I'm wondering whether maybe it's happening in a specific state when updating from 1.6.7 -> 1.6.8 where it's running the new code, but still looking for the binaries in the old extension dir where the paths are different. If so this should hopefully be resolved by just restarting VS Code.

grahambates avatar Dec 30 '22 11:12 grahambates

Hello all, I am so grateful that you made this available for MacOS. Thanks a bunch.

I have now updated to the latest 1.6.8, and initialized the demo project. As mentioned before, there were the permission errors. I corrected that using chmod +x where necessary.

When I build the demo source from VS Code (F5) I get the following errors:

Compiling main.c
Compiling support/gcc8_c_support.c
Assembling support/gcc8_a_support.s
Assembling support/depacker_doynax.s
Assembling support/depacker_doynax_vasm.asm
clang: error: no such file or directory: 'obj/gcc8_a_support.o'
clang: error: no such file or directory: 'obj/depacker_doynax.o'
make: *** [obj/depacker_doynax.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [obj/gcc8_a_support.o] Error 1
clang: clang: warning: warning: argument unused during compilation: '-mcpu=68000' [-Wunused-command-line-argument]argument unused during compilation: '-mcpu=68000' [-Wunused-command-line-argument]

/var/folders/9m/mm7m7ts959q2mk_7m3y0bf940000gn/T//ccpPoZDj.s:3:11: error: mach-o section specifier uses an unknown section type
        .section        .gnu.debuglto_.debug_info,"",@progbits
                        ^
/var/folders/9m/mm7m7ts959q2mk_7m3y0bf940000gn/T//ccpPoZDj.s:5:2: error: unknown directive
        .weak   gcc8_c_support.c.aa08cc42
        ^ 

.... and so on, there goes hundreds of lines with similar content

I am running MacOS 13.2 Ventura, Silicon M1. I am using homebrew as a package manager (should that become relevant at some point..).

I have tried to run manually the same thing ( I've exported the SDKDIR respectively):


clang: error: unsupported option '--register-prefix-optional'
clang: error: no such file or directory: 'gcc8_a_support.o'

Have you maybe encountered this already? Is there some dependency I am missing? Or further tempering necessary? Thanks in advance

akikoplays avatar Jan 26 '23 11:01 akikoplays

shouldn't execute any clang while compiling amiga stuff...

BartmanAbyss avatar Jan 26 '23 11:01 BartmanAbyss

That's what puzzled me and why I tried to reproduce it manually invoking the provided executable:

./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 -Wa,-g,--register-prefix-optional,-I$SDKDIR,-D -c ~/temp/bartmann/support/gcc8_a_support.s -o ~/temp/gcc8_a_support.o

And still getting the same clang warning:

clang: error: unsupported option '--register-prefix-optional'
clang: error: no such file or directory: '/Users/x/temp/gcc8_a_support.o'

akikoplays avatar Jan 26 '23 11:01 akikoplays

I think even m68k-amiga-elf-gcc is just a wrapper that calls libexec/gcc/m68k-amiga-elf/12.2.0/cc1. at least it should. However I don't know anything about MacOS so we'd probably have to ask @grahambates .

BartmanAbyss avatar Jan 26 '23 11:01 BartmanAbyss

I'd guess that some of the other bundled binaries are still not executable and it's falling back to a system version on your path.

grahambates avatar Jan 26 '23 13:01 grahambates

Make sure you chmod +x all the following:

elf2hunk
exe2adf
fs-uae/fs-uae
opt/bin/*
opt/libexec/gcc/m68k-amiga-elf/12.2.0/*
opt/m68k-amiga-elf/bin/*
Shrinkler
vasmm68k_mot

grahambates avatar Jan 26 '23 13:01 grahambates

Also make sure the relevant dirs are in your path when building manually. You can use the Amiga: Open terminal command to get a shell with these already set up.

grahambates avatar Jan 26 '23 13:01 grahambates

@grahambates Thank you kindly for the swift reply, I managed to compile and run the demo code.

It was my mistake, I didn't see correctly while listing that the opt/m68k-amiga-elf was a directory and not file, so I didn't step into it and of course chmod +x was missing on the all the binaries in there. Sorry for the fuss.

Once again @BartmanAbyss it's an awesome job you did with this extension and @grahambates porting to MacOS.

akikoplays avatar Jan 26 '23 13:01 akikoplays

No problem! Glad you got it working.

grahambates avatar Jan 26 '23 13:01 grahambates

Just in case you aren't aware, the executable flag is missing when you install the VSIX on a Linux box too Cheers

pmprog avatar Oct 26 '23 22:10 pmprog