-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add RISC-V (64-bit) support #6951
Comments
Cross references: Please upvote microsoft/vscode#206766 to add RISC-V support for |
@sakthivel-axim Could you test one of the following release files:
@code-server There will be follow-up posts on how these release files were created. |
On a RISC-V machine1 that runs Debian unstable (sid) and has Docker installed: HostDockerfile: FROM debian:sid
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
## Install Prerequisites
&& apt-get install -y --no-install-recommends \
bats \
build-essential \
git \
git-lfs \
gnupg \
jq \
libkrb5-dev \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev \
libxt6 \
nodejs \
python-is-python3 \
python3-dev \
python3-pip \
python3-venv \
quilt \
rsync \
unzip \
## Clean up
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
## Install npm and yarn
&& apt-get install -y --no-install-recommends npm \
&& npm install --global yarn \
## Clean up
&& rm -rf /var/lib/apt/lists/*
ARG GO_VERSION=1.23.0
ENV PATH=/root/go/bin:$PATH
## Install go and nfpm
RUN curl -sSLO "https://go.dev/dl/go$GO_VERSION.linux-riscv64.tar.gz" \
&& tar -C /root -xzf "go$GO_VERSION.linux-riscv64.tar.gz" \
&& go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest Build image: docker build -t code-server-builder . Run container: docker run --rm -ti code-server-builder ContainerClone git clone https://github.com/coder/code-server.git
cd code-server Clone git submodule update --init Apply patches quilt push -a playwright/chromium is not (yet) available for Linux/RISC-V. And since electron [therefore] also lacks RISC-V support, https://github.com/microsoft/vscode/blob/26a90463972295bcb960b7487a7c69afa06626eb/build/azure-pipelines/oss/product-build-pr-cache-linux.yml#L62-L63 is required:
Install dependencies: yarn --- Build steps Export version: export VERSION=0.0.0 Build code-server: yarn build
yarn build:vscode
yarn release ℹ️ Footnotes
|
--- Release steps Export version: export VERSION=0.0.0 Build code-server: yarn build
yarn build:vscode
KEEP_MODULES=1 yarn release Modify version: npm version --prefix release "$VERSION" tmp=$(mktemp)
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
chmod 644 release/lib/vscode/product.json Build release packages: yarn release:standalone
yarn test:integration
yarn package |
ℹ️ Without export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 command Container logs
|
❗ This is a proof of concept (PoC). If Node.js for Debian unstable (sid) is updated to v22, this may no longer work. The situation will become (more) stable once Debian 13 (aka trixie) is released – in summer 2025.
Footnotes
|
@sakthivel-axim @karthick-govindaraj @archanox Could any of you confirm that the Linux/RISC-V releases of Thank you. |
@benz0li I tried the linked deb install above, and setup the service, but it didn't come up.
I'm not sure if I'm missing a step or a dependency. |
@archanox What happens if you simply execute |
|
@archanox Thank you for the feedback. On a AArch64 machine,
On a RISC-V machine,
I will start a build1 with an unofficial Linux/RISC-V Node.js binary from https://unofficial-builds.nodejs.org/. Maybe that produces a different result. Time measurements:
Footnotes
|
On a non-'RISC-V' machine: Dockerfile (using an unofficial Linux/RISC-V Node.js binary): FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
## Install Prerequisites
&& apt-get install -y --no-install-recommends \
bats \
build-essential \
git \
git-lfs \
gnupg \
jq \
libkrb5-dev \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev \
libxt6 \
python-is-python3 \
python3-dev \
python3-pip \
python3-venv \
quilt \
rsync \
unzip \
## Clean up
&& rm -rf /var/lib/apt/lists/*
ARG NODE_VERSION=20.14.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
## Install Node.js (https://github.com/nodejs/docker-node)
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-riscv64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-riscv64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-riscv64.tar.xz" \
## Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
&& find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name linux-riscv64 -exec rm -rf {} \; \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
## Clean up Node.js installation
&& rm -f /usr/local/bin/yarn \
&& bash -c 'mv /usr/local/{CHANGELOG.md,LICENSE,README.md} \
/usr/local/share/doc/node' \
## Enable corepack (yarn, [p]npm)
&& corepack enable \
## Clean up
&& rm -rf /var/lib/apt/lists/*
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
ARG GO_VERSION=1.23.0
ENV PATH=/root/go/bin:$PATH
## Install go and nfpm
RUN curl -sSLO "https://go.dev/dl/go$GO_VERSION.linux-riscv64.tar.gz" \
&& tar -C /root -xzf "go$GO_VERSION.linux-riscv64.tar.gz" \
&& go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest # Docker CE
docker run --privileged --rm tonistiigi/binfmt:master --install riscv64 # Docker Desktop
docker run --privileged --rm tonistiigi/binfmt:desktop-master --install riscv64 Build image: docker build --platform linux/riscv64 -t code-server-builder . Run container: docker run --rm --platform linux/riscv64 -ti code-server-builder |
@archanox The Linux/RISC-V releases of Please test whether extensions can be installed successfully. Because
|
Runtime requirement: libatomic1 (
now. Footnotes
|
@archanox I have rebuilt once more using Node.js v20.14.0 to match the version that was used to build VS Code v1.92.2. Thank you for testing. Feedback is welcome. |
@benz0li unfortunately I made some irreversible changes to my environment, and I'm not sure how to get into recovery mode. So it may be a while before I can test again. |
@karthick-govindaraj What Linux distribution and version are you running (I could rebuild 2024-09-02T15:01:32+02:00: A rebuild using |
@karthick-govindaraj To increase compatibility, I rebuilt again using |
can you share the latest build will check and update you.! |
Same URLs:
|
@karthick-govindaraj On your Debian machine, what does strings /lib/*-linux-gnu/libstdc++.so.6 | grep CXXABI return? P.S.: If P.P.S.: If |
|
hi @benz0li |
Nothing that I am aware of. |
@benz0li |
@karthick-govindaraj Thank you for testing! ℹ️ Please be aware that not all extensions [that rely on Linux binaries] will work on Linux/RISC-V. |
@karthick-govindaraj @archanox Unofficial and untested builds are now published at https://gitlab.b-data.ch/coder/code-server/-/releases. FYI @code-asher |
What is your suggestion?
Build releases for Linux/RISC-V (64-bit).
Why do you want this feature?
The next stable version of Debian (13, aka trixie) is expected to ship with RISC-V 64-bit support.
Are there any workarounds to get this functionality today?
Do not know yet: I am trying to build
code-server
in aubuntu:20.04
image.Are you interested in submitting a PR for this?
Maybe.
The text was updated successfully, but these errors were encountered: