Are there any plans to release a binary built for x86_64-unknown-linux-musl? I would like to run the bws cli on alpine, but can’t get the x86_64-unknown-linux-gnu release to run with compatibility layers. I was also unsuccessful building the source code with musl as the target.
I’m also trying to install the bitwarden cli into an alpine-based container, with no success so far. I don’t know too much about the root technical issue but I can provide some more context from myself and other posts.
My use case is to install bitwarden cli into the ansible-semaphore container, as I intend to use the bitwarden lookup in ansible to reference passwords in the ansible files.
When I try to run the extracted linux x64 cli, it initially responds with not found:
/usr/local/bin $ ls bw semaphore semaphore-wrapper /usr/local/bin $ bw /bin/ash: bw: not found
I found a suggested fix for this in a github issue from the archived bitwarden repository, but after adding the packages, it fails with a segmentation fault:
/usr/local/bin # bw Segmentation fault
So I ran gbd to try to get more information and found the segementation fault is being caused by ld-musl-x86_64:
/usr/local/bin # gdb bw GNU gdb (GDB) 13.1 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-alpine-linux-musl". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from bw... (No debugging symbols found in bw) (gdb) run Starting program: /usr/local/bin/bw warning: Error disabling address space randomization: Operation not permitted warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. process 106 is executing new program: /lib/ld-musl-x86_64.so.1 [New LWP 109] [New LWP 110] [New LWP 111] [New LWP 112] [New LWP 113] Thread 1 "ld-musl-x86_64." received signal SIGSEGV, Segmentation fault. 0x00007fd842206128 in ?? ()
and I’m not sure where to go from here.
I was able to compile the SDK under alpine using an alpine docker image and doing :
apk add curl cargo openssl-dev pkgconfig
curl -LO https://github.com/bitwarden/sdk/archive/refs/tags/bws-v0.3.1.tar.gz
tar -xzf bws-v0.3.1.tar.gz
cargo build -r --bin bws
Then, the file bws is found into the target/release directory.
Months later and nothing from the devs, but the community comes to the rescue. Thank you my hero!