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

Can't find bundled superbol-free executable on darwin-arm64 #387

Open
ilyagr opened this issue Jan 8, 2025 · 0 comments
Open

Can't find bundled superbol-free executable on darwin-arm64 #387

ilyagr opened this issue Jan 8, 2025 · 0 comments

Comments

@ilyagr
Copy link

ilyagr commented Jan 8, 2025

A bit of an experience report: I successfully compiled the VS Code extension on ARM Mac OS using Nix. However, the extension did not work when installed because it couldn't find the LSP executable.

The reason seems to be that the LSP executable was named superbol-free-linux-x64, but the extension couldn't find it under that name even though it was in the correct _dist directory.

Workaround: The file should renamed from $HOME/.vscode/extensions/ocamlpro.superbol-0.1.5/_dist/superbol-free-linux-x64 to $HOME/.vscode/extensions/ocamlpro.superbol-0.1.5/_dist/superbol-free. After that, things work fine.

Relatedly, the VSIX file generated by the build process also ends up being called superbol-vscode-platform-0.1.5-linux-x64.vsix for some reason.

I found the workaround after looking at

let find_superbol root =
let open Node.Process in
let prefix = "superbol-free" in
let suffix = if platform == "win32" then ".exe" else "" in
Vscode.Uri.fsPath @@ find_existing @@ List.map (fun name ->
Vscode.Uri.joinPath root ~pathSegments:[name]) @@ [
Format.asprintf "%s-%s-%s%s" prefix platform arch suffix;
Format.asprintf "%s-%s%s" prefix platform suffix;
Format.asprintf "%s%s" prefix suffix
] @ if platform = "darwin" && arch = "arm64" then
[ Format.sprintf "%s-%s-%s%s" prefix platform "x64" suffix]
else


Hope this helps, and thanks for making this extension!

Aside: To emphasize, the LSP executable that was built was in fact a darwin-arm64 executable despite the name:

$ file superbol-free-linux-x64
superbol-free-linux-x64: Mach-O 64-bit executable arm64
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

1 participant