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

Alpine ARM64 - Search and file quick pick is broken #133993

Closed
sandy081 opened this issue Sep 28, 2021 · 10 comments · Fixed by microsoft/vscode-ripgrep#25
Closed

Alpine ARM64 - Search and file quick pick is broken #133993

sandy081 opened this issue Sep 28, 2021 · 10 comments · Fixed by microsoft/vscode-ripgrep#25
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded

Comments

@sandy081
Copy link
Member

Testing #133893

image

@deepak1556
Copy link
Collaborator

The binary is indeed available in the server folder but the libc library it is linked with does not exist on the image.

> file rg
rg: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=9aeeefc40f268f2df9b99c2549fddbd3f9fe0171, stripped

> pwd
/vscode/vscode-server-insiders/bin/alpine-arm64/214ac689ca9874a8a4be386f73d5cb60e15af25e-insider/node_modules/vscode-ripgrep/bin

> /vscode/vscode-server-insiders/bin/alpine-arm64/214ac689ca9874a8a4be386f73d5cb60e15af25e-insider/node_modules/vscode-ripgrep/bin/rg
/bin/ash: /vscode/vscode-server-insiders/bin/alpine-arm64/214ac689ca9874a8a4be386f73d5cb60e15af25e-insider/node_modules/vscode-ripgrep/bin/rg: not found

> ldd /vscode/vscode-server-insiders/bin/alpine-arm64/214ac689ca9874a8a4be386f73d5cb60e15af25e-insider/node_modules/vscode-ripgrep/bin/rg

/lib/ld-linux-aarch64.so.1 (0xffff9741d000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xffff96fd9000)
        libpthread.so.0 => /lib/ld-linux-aarch64.so.1 (0xffff9741d000)
        libdl.so.2 => /lib/ld-linux-aarch64.so.1 (0xffff9741d000)
        libc.so.6 => /lib/ld-linux-aarch64.so.1 (0xffff9741d000)
Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by ./node_modules/vscode-ripgrep/bin/rg)

> ldd /vscode/vscode-server-insiders/bin/alpine-arm64/214ac689ca9874a8a4be386f73d5cb60e15af25e-insider/node

/lib/ld-musl-aarch64.so.1 (0xffff9b3e3000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xffff973b2000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xffff9738d000)
        libc.musl-aarch64.so.1 => /lib/ld-musl-aarch64.so.1 (0xffff9b3e3000)

@deepak1556
Copy link
Collaborator

deepak1556 commented Sep 28, 2021

Ripgrep should also build for aarch64-unknown-linux-musl rust target in https://github.com/microsoft/ripgrep-prebuilt/blob/main/build/main.yml to support alpine images so that it is uses the musl c library.

@roblourens
Copy link
Member

I can add that, thanks

@roblourens
Copy link
Member

Ripgrep couldn't build under that target.

https://github.com/BurntSushi/ripgrep/blob/df83b8b44426b3f2179abe632eb183e8c8270524/crates/core/main.rs#L29 My understanding is… when building with musl, it uses jemalloc, jemalloc uses background_threads_runtime_support, and that doesn’t support our target.

If we can figure out how to un set that flag on jemalloc that might work around it but i don’t know what consequences that would have https://github.com/gnzlbg/jemallocator/blob/master/jemalloc-sys/README.md#cargo-features

@roblourens roblourens added this to the October 2021 milestone Sep 29, 2021
@roblourens roblourens changed the title Search and file quick pick is broken Alpine ARM64 - Search and file quick pick is broken Sep 29, 2021
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues labels Sep 29, 2021
@deepak1556
Copy link
Collaborator

deepak1556 commented Sep 30, 2021

@roblourens from gnzlbg/jemallocator#124 it is not sure whether the bug is in jemalloc config or cargo, but the immediate working solution is to build the crate with cross BurntSushi/ripgrep@5ce2d73. I will see if that works.

microsoft/ripgrep-prebuilt#12

@sandy081
Copy link
Member Author

May I know if there is some workaround for this bug for users? If not, I do not think its good to ship Alpine ARM 64 builds with broken experience.

@deepak1556
Copy link
Collaborator

It will require users to install libc6-compat package that will include the required libraries for the executable built using glibc.

apk add libc6-compat

@roblourens
Copy link
Member

roblourens commented Sep 30, 2021

Not with your PR, right @deepak1556? And thanks for the PR!

@deepak1556
Copy link
Collaborator

Yup #133993 (comment) is not needed with the musl binary produced from the PR.

@deepak1556
Copy link
Collaborator

I didn't put up a PR to adjust https://github.com/microsoft/vscode-ripgrep/blob/main/lib/postinstall.js to download aarch64-unknown-linux-musl for alpine. Can you take care of it ? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants