-
Notifications
You must be signed in to change notification settings - Fork 1.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
Alpine operating system support #4827
Comments
+1 on this. |
Same here, would definitely love to see that coming so that I can use it on gitpod using Alpine. Thanks! |
So what exactly isn't working and how does it depend on musl? |
Yes, so we get that message alpine is not supported but it's not clear which features are affected. |
@WardenGnaw Do you know anything about Alpine support for the debugger? |
If there is a Mono Runtime (using musl) that works on Alpine, we can ship the debugger to work on Alpine. From when I last checked, there was not an officially supported Mono Runtime for Alpine. |
There is a mono package (https://pkgs.alpinelinux.org/package/edge/testing/x86_64/mono), but it's not ready for production right now. The package is only available on edge branch, not on the 3.12 release. And it's tagged as testing. |
Indeed. It can be installed via sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
apk update && apk upgrade --no-cache --available
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing mono Then one can test the current state by removing else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
errMsg = localize(1, null);
} from rm ~/.vscode-server/extensions/ms-vscode.cpptools-*/debugAdapters/mono.linux-x86_64
~/.vscode-server/extensions/ms-vscode.cpptools-1.1.2/debugAdapters/OpenDebugAD7 But...
|
Ok it's way easier: https://github.com/sgerrand/alpine-pkg-glibc#installing |
Related: microsoft/MIEngine#1075 (comment) |
@Trass3r It seems doesn't work on alpine 3.14.0? |
@sean-mcmanus will cpptools run on alpine?is there a plan? |
I've only tested the debugger. Looks like the workaround doesn't work for IntelliSense yet. FROM mcr.microsoft.com/vscode/devcontainers/base:dev-alpine-3.14
RUN rm /etc/alpine-release \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk \
&& apk add glibc-2.33-r0.apk
ENV LD_LIBRARY_PATH=/usr/glibc-compat/lib:/usr/lib:/lib $ ~/.vscode-server/extensions/ms-vscode.cpptools-*/debugAdapters/OpenDebugAD7 --help
OpenDebugAD7: Visual Studio Code debug adapter bridge [...]
$ ~/.vscode-server/extensions/ms-vscode.cpptools-*/bin/cpptools --help
Relink `/usr/lib/libgcc_s.so.1' with `/usr/glibc-compat/lib/libc.so.6' for IFUNC symbol `memset'
Segmentation fault |
It's in the "On Deck" milestone so it's something we want to address, but we don't know when exactly yet. |
There is a debugger shipped for alpine-x64 just not currently added. I was not able to fully validate the debugger works in an alpine container with the vscode-containers extension so I have not added it to the list of it being officially supported. |
@WardenGnaw ah ok so that url is actually the debugger package. $ cd ~/.vscode-server-insiders/extensions/ms-vscode.cpptools-1.6.0-*/
$ unzip /workspaces/alpinedevcontainer/linux-musl-x64.zip -d .
$ chmod +x debugAdapters/bin/OpenDebugAD7
$ debugAdapters/bin/OpenDebugAD7 --help
OpenDebugAD7: Visual Studio Code debug adapter bridge for using Visual Studio
debug engines in VS Code Stepping through a program also works, nice! (Of course you'll get the message |
@Trass3r Let me know if you notice any issues. Are you about to get this working via a docker container? |
Yeah even seems to work without the And you get
Tested on FROM mcr.microsoft.com/vscode/devcontainers/base:dev-alpine-3.14
RUN apk add --no-cache gdb
#RUN rm /etc/alpine-release
#RUN apk add --no-cache coreutils wget file \
# bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib \
#&& wget https://dot.net/v1/dotnet-install.sh \
#&& chmod +x dotnet-install.sh \
#&& ./dotnet-install.sh -c 5.0 |
Yeah. There's one issue that its checking to see if a directory exists but its actually a file and also needing to just launch the debugger without the language service. This includes disabling the "Build and Debug Active File". |
@Trass3r Were you able to get a debug session with that given zip? I used your dockerfile (+ added g++) but I'm running into OpenDebug not getting permissions to setup its fifo queues for terminal redirection.
Were you able to get around this issue? |
Yeah it worked for me, never had this fifo error. Did you use a different user? |
Ah, I was able to by pass that initial issue with uncommenting devcontainer.json// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/alpine
{
"name": "Alpine",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Alpine version: 3.11, 3.12, 3.13, 3.14
"args": { "VARIANT": "3.14" }
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
// Note that some extensions may not work in Alpine Linux. See https://aka.ms/vscode-remote/linux.
"extensions": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
} Current error I'm looking at is an GDB error in a simple Hello World printf project generated with
My Steps:
|
I haven't uncommented runArgs and it still works. The rest of the devcontainer.json is the same. Tested on WSL2. |
|
Debugging works for me: https://gist.github.com/Trass3r/55cccb10eb7b9dc72653a67336dd15e8 sudo apk add --no-cache wget unzip
cd ~/.vscode-server/extensions/ms-vscode.cpptools-*
wget https://download.visualstudio.microsoft.com/download/pr/19b0fca0-b008-4b39-9163-6b7a59e50961/f74cb83d6e43dfc2c30a9a0ec46d46b4/linux-musl-x64.zip
unzip -o linux-musl-x64.zip
chmod 700 ./debugAdapters/bin/OpenDebugAD7
./debugAdapters/bin/OpenDebugAD7 --help
rm linux-musl-x64.zip |
Let me give that a shot. One thing I notice is you are using My scenario was |
Ah ok |
Awesome. I was able to get it to work in your container scenario. I'll be working on getting debugging downloaded / enabled on Alpine. |
Are there any news about this feature? Would love to use Alpine Linux but this issue is a deal breaker as is. I also work in C/C++ with ARM crosscompilers. I would like to share a workaround in any case, I have been using an Ubuntu Jammy docker image as an alternative, which works fine and also happens to have almost the latest versions of relevant packages: ARM GCC compiler, Newlib, CppCheck, gdb debugger, clang-format, doxygen, cmake... |
Next week we hope to have our first preview of Alpine support available. |
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.0-insiders3 or 1.8.0 (via using VS Code's "Pre-Release Version" UI or https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools&ssr=false#version-history ). |
Type: General
I'm not sure if this issue is already tracked somewhere else. I checked before to open this one, and I only found pull requests talking about disabling the support of the extension under Alpine and ARM environment:
Describe the bug
I don't know what are the dependencies of the C/C++ Extension since this is not an open source extension. But what is the cost to add the support of musl library in addition of the usual libc library ?
I'm currently looking to mount a development Docker environment based on an Alpine operating system.
The text was updated successfully, but these errors were encountered: