[GH-ISSUE #1078] can't compile on arm board in good conditions #764

Closed
opened 2026-03-03 02:02:58 +03:00 by kerem · 10 comments
Owner

Originally created by @changemenemo on GitHub (Aug 1, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1078

Hi,

I will modify this post if requested but it's pretty simple.
We have some problems to compile your package with the rust compiler on arm board like used for https://labriqueinter.net/
which is based on yunohost.
the rust is too heavy to be able to compile the whole thing in one long thread. So I wanted to know if it was possible to divide the work into several small ones. Like other app based on node.js. It would release RAM and swap back and forth as the process go forward.
I've made a feature request a few days ago but apparently this has been deleted ?
Thanksi n advance to give my some feedback on it.

Originally created by @changemenemo on GitHub (Aug 1, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1078 Hi, I will modify this post if requested but it's pretty simple. We have some problems to compile your package with the rust compiler on arm board like used for https://labriqueinter.net/ which is based on yunohost. the rust is too heavy to be able to compile the whole thing in one long thread. So I wanted to know if it was possible to divide the work into several small ones. Like other app based on node.js. It would release RAM and swap back and forth as the process go forward. I've made a feature request a few days ago but apparently this has been deleted ? Thanksi n advance to give my some feedback on it.
kerem 2026-03-03 02:02:58 +03:00
Author
Owner

@dani-garcia commented on GitHub (Aug 4, 2020):

By heavy you mean it uses too much RAM and runs out of memory? If so I don't think there's too much we can do, you can try building with cargo build -j 1 to reduce the number of parallel jobs to 1, but that might still not be enough.

The other option would be to have a big swap but that would make the compile time considerably longer.

To be honest compiling rust code in weak arm boards is usually a bad idea, it's easier to cross compile it from some beefier x86 machine.

<!-- gh-comment-id:668602637 --> @dani-garcia commented on GitHub (Aug 4, 2020): By heavy you mean it uses too much RAM and runs out of memory? If so I don't think there's too much we can do, you can try building with `cargo build -j 1` to reduce the number of parallel jobs to 1, but that might still not be enough. The other option would be to have a big swap but that would make the compile time considerably longer. To be honest compiling rust code in weak arm boards is usually a bad idea, it's easier to cross compile it from some beefier x86 machine.
Author
Owner

@changemenemo commented on GitHub (Aug 5, 2020):

yup runs out of RAM and swap which is 1G of RAM 4G of swap.

your compilation process seems, in opposition to a compiling job with node, to build up in RAM as I said in place of releasing after each module that has been compiled, am I correct here?

<!-- gh-comment-id:668913155 --> @changemenemo commented on GitHub (Aug 5, 2020): yup runs out of RAM and swap which is 1G of RAM 4G of swap. your compilation process seems, in opposition to a compiling job with node, to build up in RAM as I said in place of releasing after each module that has been compiled, am I correct here?
Author
Owner

@changemenemo commented on GitHub (Aug 6, 2020):

@dani-garcia and if it's a bad idea to do it on a arm board, wouldn't be possible to per-compile it for specific platform? And so deliver some pre compiled packages to the specified platform?

I'm sorry, I'm going to try to stay logic on a higher level here and being stucked into a programming-level discussion since we are discussing about user-usability and experience.
Is this web app-endpoint, needing that much of ressources and modules ? I mean that I have been able to compile something like Jupiterlab which is supposed to be able to do way much more things than bitwarden which is(sorry for this word) 'just' a password manager. Or for nextcloud same debate for example.

<!-- gh-comment-id:669937524 --> @changemenemo commented on GitHub (Aug 6, 2020): @dani-garcia and if it's a bad idea to do it on a arm board, wouldn't be possible to per-compile it for specific platform? And so deliver some pre compiled packages to the specified platform? I'm sorry, I'm going to try to stay logic on a higher level here and being stucked into a programming-level discussion since we are discussing about user-usability and experience. Is this web app-endpoint, needing that much of ressources and modules ? I mean that I have been able to compile something like Jupiterlab which is supposed to be able to do way much more things than bitwarden which is(sorry for this word) 'just' a password manager. Or for nextcloud same debate for example.
Author
Owner

@mqus commented on GitHub (Aug 12, 2020):

I think that you can cross-compile bitwarden_rs on your desktop pc by choosing a different target with cargo --target=. I just googled it and e.g. https://sigmaris.info/blog/2019/02/cross-compiling-rust-on-mac-os-for-an-arm-linux-router/ could work. Once you have compiled the binary you can copy it on your target machine(s), setup the configuration and everything else.

But as you mention the runtime experience: Once you have compiled the binary, you really only need that binary and it runs fast on pretty much any hardware. The binary itself is ~20MB big, which should fit easily on any SBC storage. It also uses about 32mb of RAM.

It really is only the compile process that takes this much computation power, but I have to add my own datapoint: I'm regularly compiling bitwarden_rs on a raspberry pi 3b (armv7h(8h?), 4 cores, 1gb RAM) and while I have to enable swap for building the vault, building bitwarden_rs itself didn't need it. But I do have to wait ~2.5 hours to let it compile.

<!-- gh-comment-id:673100158 --> @mqus commented on GitHub (Aug 12, 2020): I think that you can cross-compile bitwarden_rs on your desktop pc by choosing a different target with `cargo --target=`. I just googled it and e.g. https://sigmaris.info/blog/2019/02/cross-compiling-rust-on-mac-os-for-an-arm-linux-router/ could work. Once you have compiled the binary you can copy it on your target machine(s), setup the configuration and everything else. But as you mention the runtime experience: Once you have compiled the binary, you really only need that binary and it runs fast on pretty much any hardware. The binary itself is ~20MB big, which should fit easily on any SBC storage. It also uses about 32mb of RAM. It really is only the compile process that takes this much computation power, but I have to add my own datapoint: I'm regularly compiling bitwarden_rs on a raspberry pi 3b (armv7h(8h?), 4 cores, 1gb RAM) and while I have to enable swap for building the vault, building bitwarden_rs itself didn't need it. But I do have to wait ~2.5 hours to let it compile.
Author
Owner

@rkojedzinszky commented on GitHub (Aug 30, 2020):

I am building my images on arm with 2G ram, the process takes nearly two hours. The multiarch multidb images are available here: https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server

<!-- gh-comment-id:683441714 --> @rkojedzinszky commented on GitHub (Aug 30, 2020): I am building my images on arm with 2G ram, the process takes nearly two hours. The multiarch multidb images are available here: https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server
Author
Owner

@changemenemo commented on GitHub (Aug 31, 2020):

I am building my images on arm with 2G ram, the process takes nearly two hours. The multiarch multidb images are available here: https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server

Thanks this is what you are using ? I m using yunohost installation process but I could use docker too.
The arm board is an olimex lime2 here so 1G of RAM and several G oof swap

<!-- gh-comment-id:683886342 --> @changemenemo commented on GitHub (Aug 31, 2020): > I am building my images on arm with 2G ram, the process takes nearly two hours. The multiarch multidb images are available here: https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server Thanks this is what you are using ? I m using yunohost installation process but I could use docker too. The arm board is an olimex lime2 here so 1G of RAM and several G oof swap
Author
Owner

@rkojedzinszky commented on GitHub (Aug 31, 2020):

I am building this on an orange pi plus 2e. It has 2gigs of ram, without any swap. I am building it with drone.io in k8s.

  1. augusztus 31. 18:28:07 CEST, Impostor syndrom notifications@github.com írta:

I am building my images on arm with 2G ram, the process takes nearly
two hours. The multiarch multidb images are available here:
https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server

Thanks this is what you are using ? I m using yunohost installation
process but I could use docker too.
The arm board is an olimex lime2 here so 1G of RAM and several G oof
swap

--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/dani-garcia/bitwarden_rs/issues/1078#issuecomment-683886342

--
Ezt a levelet az Android készülékemről küldtem K-9 Mail-el. Elnézést a tömörségemért.

<!-- gh-comment-id:684002577 --> @rkojedzinszky commented on GitHub (Aug 31, 2020): I am building this on an orange pi plus 2e. It has 2gigs of ram, without any swap. I am building it with drone.io in k8s. 2020. augusztus 31. 18:28:07 CEST, Impostor syndrom <notifications@github.com> írta: >> I am building my images on arm with 2G ram, the process takes nearly >two hours. The multiarch multidb images are available here: >https://hub.docker.com/r/rkojedzinszky/bitwardenrs-server > >Thanks this is what you are using ? I m using yunohost installation >process but I could use docker too. >The arm board is an olimex lime2 here so 1G of RAM and several G oof >swap > >-- >You are receiving this because you commented. >Reply to this email directly or view it on GitHub: >https://github.com/dani-garcia/bitwarden_rs/issues/1078#issuecomment-683886342 -- Ezt a levelet az Android készülékemről küldtem K-9 Mail-el. Elnézést a tömörségemért.
Author
Owner

@changemenemo commented on GitHub (Sep 1, 2020):

Ooow so with kubernetes, yeah that's a bit different then. I can understand that I t could work that way. Thanks for the tip anyway

<!-- gh-comment-id:684260892 --> @changemenemo commented on GitHub (Sep 1, 2020): Ooow so with kubernetes, yeah that's a bit different then. I can understand that I t could work that way. Thanks for the tip anyway
Author
Owner

@rkojedzinszky commented on GitHub (Sep 1, 2020):

I think that is irrelevant that I compile it with some ci-cd pipeline. The point is that on a PI with 2G ram it can be compiled.

<!-- gh-comment-id:684444354 --> @rkojedzinszky commented on GitHub (Sep 1, 2020): I think that is irrelevant that I compile it with some ci-cd pipeline. The point is that on a PI with 2G ram it can be compiled.
Author
Owner

@BlackDex commented on GitHub (Nov 18, 2020):

I will close this ticket as this is not something we can fix on our side.
Please feel free to continue this discussion on the forum: https://bitwardenrs.discourse.group/

<!-- gh-comment-id:729630416 --> @BlackDex commented on GitHub (Nov 18, 2020): I will close this ticket as this is not something we can fix on our side. Please feel free to continue this discussion on the forum: https://bitwardenrs.discourse.group/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#764
No description provided.