Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in Windsurf editor #82

Open
cameroncooke opened this issue Nov 28, 2024 · 2 comments
Open

Not working in Windsurf editor #82

cameroncooke opened this issue Nov 28, 2024 · 2 comments

Comments

@cameroncooke
Copy link

cameroncooke commented Nov 28, 2024

Getting this error when trying to build or run in Windsurf:

dyld[31692]: terminating because inserted dylib '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' could not be loaded: tried: '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' (code signature in <48DD5F7D-C033-3518-BB8A-E08766ECCC43> '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' (no such file), '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' (code signature in <48DD5F7D-C033-3518-BB8A-E08766ECCC43> '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' not valid for use in process: library load disallowed by system policy)
dyld[31692]: tried: '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' (code signature in <48DD5F7D-C033-3518-BB8A-E08766ECCC43> '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/setvbuf_universal.so' (no such file), '/Users/REDACTED/.windsurf/extensions/sweetpad.sweetpad-0.1.42/out/set

The highlight being:

setvbuf_universal.so' not valid for use in process: library load disallowed by system policy

I also get a "Apple could not verify
"setvbuf_universal.so" is free of malware that may harm your Mac or compromise your privacy." alert with two buttons "Done" and "Move to Bin"

The Settings app shows setvbuf_universal.so under the Privacy section but the Allow button doesn't work.

@cameroncooke
Copy link
Author

This seems to be an issue with the security policy of my work MacBook. Trying on my personal MacBook and the extension works fine.

I do wonder if we could resolve this by codesigning the library from a trusted source?

@hyzyla
Copy link
Collaborator

hyzyla commented Dec 1, 2024

Oh, thanks for raising the issue about it. The problem is that command-line tools like xcbeautify work differently in different environments. In non-TTY environments, like Node.js, stdout is buffered instead of being flushed after each line, as it is in TTY environments. Here is a brief article about that: https://jvns.ca/blog/2024/11/29/why-pipes-get-stuck-buffering/

In my case, I was too naïve to think I could insert my own setvbuf_universal.so as a dynamic library for xcbeautify to force this tool to flush stdout at the end of each line instead of buffering output.

DYLD_INSERT_LIBRARIES=${quote([setvbufPath])} DYLD_FORCE_FLAT_NAMESPACE=y ${mainCommand}

macOS does not allow such hacks without proper notarization. I hadn't noticed it because when I compile a .so file on my machine, it uses ad-hoc (local) signing, that allow to ignore the notarization process during development.

A simple solution for now is to disable "setvbuf" by default (this will be included in the next release) and then explore other tools to avoid buffering in xcbeautify and similar cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants