Skip to content

vscode-web install error on alpine arm64 #92

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

Open
anasfanani opened this issue May 12, 2025 · 5 comments
Open

vscode-web install error on alpine arm64 #92

anasfanani opened this issue May 12, 2025 · 5 comments

Comments

@anasfanani
Copy link

root@openwrt:~# /root/vscode-server-alpine-arm64-web/bin/code-server --version
1.100.0
19e0f9e681ecb8e5c09d8784acaa601316ca4571
arm64
root@openwrt:~# /root/vscode-server-linux-arm64-web/bin/code-server --version
/root/vscode-server-linux-arm64-web/bin/code-server: line 22: /root/vscode-server-linux-arm64-web/node: not found
root@openwrt:~# uname -a
Linux openwrt 5.15.135-ophub #1 SMP PREEMPT Wed Oct 11 09:51:14 EDT 2023 aarch64 GNU/Linux

Because the module auto select linux variant

output=$(curl -fsSL "https://vscode.download.prss.microsoft.com/dbazure/download/stable/$HASH/vscode-server-linux-$ARCH-web.tar.gz" | tar -xz -C "${INSTALL_PREFIX}" --strip-components 1)

vscode-web has alpine variant

wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/19e0f9e681ecb8e5c09d8784acaa601316ca4571/vscode-server-alpine-arm64-web.tar.gz
@matifali
Copy link
Member

matifali commented May 12, 2025

Thanks for reporting. Would you like to submit a PR?
cc: @DevelopmentCats

@anasfanani
Copy link
Author

Thanks for reporting. Would you like to submit a PR?

I'm willing to submit a PR, what would you prefer to fix this, by auto detect or providing a new variable to select linux distribution, for auto detect I have no idea, maybe check with command -v ash

@DevelopmentCats
Copy link

I will take a crack at updating the module to accurately detect and select the correct code-server version based on the target system’s architecture. I’ll post updates here as I make progress.

@anasfanani
Copy link
Author

I will take a crack at updating the module to accurately detect and select the correct code-server version based on the target system’s architecture. I’ll post updates here as I make progress.

vscode has support multiple platform & arch

https://github.com/microsoft/vscode/blob/4606b09baf075fde61744585daf481d68a862106/build/gulpfile.reh.js#L43-L55

maybe just create simple variable to fill

variable "platform" {
  type        = string
  description = "The platform to use for the VS Code Web binary."
  default     = "linux"
  validation {
    condition     = var.platform == "linux" || var.platform == "darwin" || var.platform == "alpine" || var.platform == "win32"
    error_message = "Incorrect value. Please set either 'linux', 'darwin', or 'alpine' or 'win32'."
  }
}

@DevelopmentCats
Copy link

Instead of just adding a variable, I think the best approach would be to auto-detect the platform (e.g., Alpine vs. glibc Linux) in the script, but also let users override it with a variable if needed. This way, it works out-of-the-box for most users, but still gives flexibility for edge cases. It’s more robust and user-friendly than requiring everyone to set the variable manually.

Here is an idea of how you could go about detecting the platform, while allowing for a platform to be specified by a variable:

if [ -n "${PLATFORM}" ]; then
  DETECTED_PLATFORM="${PLATFORM}"
elif [ -f /etc/alpine-release ] || grep -qi 'ID=alpine' /etc/os-release 2>/dev/null; then
  DETECTED_PLATFORM="alpine"
elif [ "$(uname -s)" = "Darwin" ]; then
  DETECTED_PLATFORM="darwin"
else
  DETECTED_PLATFORM="linux"
fi

You could then go and use this to define which version of VSCode is installed.

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

3 participants