[GH-ISSUE #593] Build fails on FreeBSD #392

Closed
opened 2026-03-03 01:28:41 +03:00 by kerem · 6 comments
Owner

Originally created by @esell on GitHub (Aug 29, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/593

First, thanks for creating/maintaining this project, it is pretty awesome.

With that being said, I am having trouble building it on FreeBSD. I am trying to build just the binary using the directions from the wiki, but it keeps crashing out. I believe, based on the error, that the problem is with a 3rd party dependency but I thought I'd post it here first to make sure.

Running cargo build --features sqlite with a current git checkout ends with:

$ cargo build --features sqlite
   Compiling libc v0.2.62
   Compiling autocfg v0.1.6
   Compiling semver-parser v0.7.0
   Compiling version_check v0.1.5
   Compiling proc-macro2 v1.0.1
   Compiling rand_core v0.4.2
   Compiling unicode-xid v0.2.0
   Compiling byteorder v1.3.2
   Compiling arrayvec v0.4.11
   Compiling syn v1.0.5
   Compiling stable_deref_trait v1.1.1
   Compiling proc-macro2 v0.4.30
   Compiling log v0.4.8
   Compiling cc v1.0.40
   Compiling smallvec v0.6.10
   Compiling either v1.5.2
   Compiling nodrop v0.1.13
   Compiling lazy_static v1.4.0
   Compiling scopeguard v0.3.3
   Compiling siphasher v0.2.3
   Compiling cfg-if v0.1.9
   Compiling unicode-xid v0.1.0
   Compiling matches v0.1.8
   Compiling spin v0.5.2
   Compiling memchr v2.2.1
   Compiling httparse v1.3.4
   Compiling syn v0.15.44
   Compiling pkg-config v0.3.15
   Compiling fnv v1.0.6
   Compiling serde v1.0.99
   Compiling slab v0.4.2
   Compiling bitflags v1.1.0
   Compiling yansi v0.4.0
   Compiling untrusted v0.6.2
   Compiling ryu v1.0.0
   Compiling scopeguard v1.0.0
   Compiling futures v0.1.28
   Compiling getrandom v0.1.11
   Compiling safemem v0.3.2
   Compiling percent-encoding v1.0.1
   Compiling string_cache_shared v0.3.0
   Compiling itoa v0.4.4
   Compiling traitobject v0.1.0
   Compiling typeable v0.1.2
   Compiling language-tags v0.2.2
   Compiling openssl v0.10.24
   Compiling foreign-types-shared v0.1.1
   Compiling failure_derive v0.1.5
   Compiling typenum v1.11.2
   Compiling rustc-demangle v0.1.16
   Compiling yansi v0.5.0
   Compiling try-lock v0.2.2
   Compiling regex-syntax v0.6.11
   Compiling ucd-trie v0.1.2
   Compiling mac v0.1.1
   Compiling indexmap v1.1.0
   Compiling native-tls v0.2.3
   Compiling crc32fast v1.2.0
   Compiling new_debug_unreachable v1.0.3
   Compiling ppv-lite86 v0.2.5
   Compiling adler32 v1.0.3
   Compiling proc-macro-hack-impl v0.4.2
   Compiling state v0.4.1
   Compiling maplit v1.0.2
   Compiling encoding_index_tests v0.1.4
   Compiling byte-tools v0.3.1
   Compiling utf-8 v0.7.5
   Compiling precomputed-hash v0.1.1
   Compiling unicode-xid v0.0.4
   Compiling openssl-probe v0.1.2
   Compiling encoding_rs v0.8.17
   Compiling same-file v1.0.5
   Compiling constant_time_eq v0.1.4
   Compiling ascii_utils v0.9.3
   Compiling dtoa v0.4.4
   Compiling quote v0.3.15
   Compiling subtle v1.0.0
   Compiling byte-tools v0.1.3
   Compiling remove_dir_all v0.5.2
   Compiling percent-encoding v2.1.0
   Compiling fake-simd v0.1.2
   Compiling num-derive v0.2.5
   Compiling opaque-debug v0.2.3
   Compiling lazycell v1.2.1
   Compiling bufstream v0.1.4
   Compiling quick-error v1.2.2
   Compiling bitwarden_rs v1.0.0 (/root/bitwarden_rs)
   Compiling rustc-hex v1.0.0
   Compiling subtle v2.1.1
   Compiling quoted_printable v0.4.1
   Compiling data-encoding v2.1.2
   Compiling semver v0.9.0
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling num-traits v0.2.8
   Compiling num-integer v0.1.41
   Compiling unicase v1.4.2
   Compiling unicase v2.4.0
   Compiling error-chain v0.12.1
   Compiling nom v4.2.3
   Compiling email v0.0.20
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling owning_ref v0.4.0
   Compiling owning_ref v0.3.3
   Compiling unicode-normalization v0.1.8
   Compiling thread_local v0.3.6
   Compiling crossbeam-utils v0.6.6
   Compiling try_from v0.3.2
   Compiling proc-macro2 v0.3.8
   Compiling unicode-bidi v0.3.4
   Compiling ring v0.14.6
   Compiling backtrace-sys v0.1.31
   Compiling openssl-sys v0.9.49
   Compiling libsqlite3-sys v0.12.0
   Compiling pear_codegen v0.1.2
   Compiling lock_api v0.3.1
   Compiling lock_api v0.2.0
   Compiling tokio-sync v0.1.6
   Compiling foreign-types v0.3.2
   Compiling rocket_codegen v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=dbcb0a75b9556763ac3ab708f40c8f8ed75f1a1e#dbcb0a75)
   Compiling rocket v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=dbcb0a75b9556763ac3ab708f40c8f8ed75f1a1e#dbcb0a75)
   Compiling pest v2.1.1
   Compiling futf v0.1.4
   Compiling c2-chacha v0.2.2
   Compiling miniz_oxide v0.3.2
   Compiling proc-macro-hack v0.4.2
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling encoding-index-korean v1.20141219.5
   Compiling encoding-index-japanese v1.20141219.5
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling block-padding v0.1.4
   Compiling synom v0.11.3
   Compiling walkdir v2.2.9
   Compiling fast_chemail v0.9.6
   Compiling rustc_version v0.2.3
error: failed to run custom build command for `rand_pcg v0.1.2`

Caused by:
  process didn't exit successfully: `/root/bitwarden_rs/target/debug/build/rand_pcg-4fcb61996e763c83/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
--- stdout
cargo:rerun-if-changed=build.rs

warning: build failed, waiting for other jobs to finish...
error: build failed****

Any thoughts? The host is a FreeBSD jail running FreeBSD 12.0-RELEASE-p3 GENERIC amd64

Originally created by @esell on GitHub (Aug 29, 2019). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/593 First, thanks for creating/maintaining this project, it is pretty awesome. With that being said, I am having trouble building it on FreeBSD. I am trying to build just the binary using the directions from the wiki, but it keeps crashing out. I believe, based on the error, that the problem is with a 3rd party dependency but I thought I'd post it here first to make sure. Running `cargo build --features sqlite` with a current git checkout ends with: ``` $ cargo build --features sqlite Compiling libc v0.2.62 Compiling autocfg v0.1.6 Compiling semver-parser v0.7.0 Compiling version_check v0.1.5 Compiling proc-macro2 v1.0.1 Compiling rand_core v0.4.2 Compiling unicode-xid v0.2.0 Compiling byteorder v1.3.2 Compiling arrayvec v0.4.11 Compiling syn v1.0.5 Compiling stable_deref_trait v1.1.1 Compiling proc-macro2 v0.4.30 Compiling log v0.4.8 Compiling cc v1.0.40 Compiling smallvec v0.6.10 Compiling either v1.5.2 Compiling nodrop v0.1.13 Compiling lazy_static v1.4.0 Compiling scopeguard v0.3.3 Compiling siphasher v0.2.3 Compiling cfg-if v0.1.9 Compiling unicode-xid v0.1.0 Compiling matches v0.1.8 Compiling spin v0.5.2 Compiling memchr v2.2.1 Compiling httparse v1.3.4 Compiling syn v0.15.44 Compiling pkg-config v0.3.15 Compiling fnv v1.0.6 Compiling serde v1.0.99 Compiling slab v0.4.2 Compiling bitflags v1.1.0 Compiling yansi v0.4.0 Compiling untrusted v0.6.2 Compiling ryu v1.0.0 Compiling scopeguard v1.0.0 Compiling futures v0.1.28 Compiling getrandom v0.1.11 Compiling safemem v0.3.2 Compiling percent-encoding v1.0.1 Compiling string_cache_shared v0.3.0 Compiling itoa v0.4.4 Compiling traitobject v0.1.0 Compiling typeable v0.1.2 Compiling language-tags v0.2.2 Compiling openssl v0.10.24 Compiling foreign-types-shared v0.1.1 Compiling failure_derive v0.1.5 Compiling typenum v1.11.2 Compiling rustc-demangle v0.1.16 Compiling yansi v0.5.0 Compiling try-lock v0.2.2 Compiling regex-syntax v0.6.11 Compiling ucd-trie v0.1.2 Compiling mac v0.1.1 Compiling indexmap v1.1.0 Compiling native-tls v0.2.3 Compiling crc32fast v1.2.0 Compiling new_debug_unreachable v1.0.3 Compiling ppv-lite86 v0.2.5 Compiling adler32 v1.0.3 Compiling proc-macro-hack-impl v0.4.2 Compiling state v0.4.1 Compiling maplit v1.0.2 Compiling encoding_index_tests v0.1.4 Compiling byte-tools v0.3.1 Compiling utf-8 v0.7.5 Compiling precomputed-hash v0.1.1 Compiling unicode-xid v0.0.4 Compiling openssl-probe v0.1.2 Compiling encoding_rs v0.8.17 Compiling same-file v1.0.5 Compiling constant_time_eq v0.1.4 Compiling ascii_utils v0.9.3 Compiling dtoa v0.4.4 Compiling quote v0.3.15 Compiling subtle v1.0.0 Compiling byte-tools v0.1.3 Compiling remove_dir_all v0.5.2 Compiling percent-encoding v2.1.0 Compiling fake-simd v0.1.2 Compiling num-derive v0.2.5 Compiling opaque-debug v0.2.3 Compiling lazycell v1.2.1 Compiling bufstream v0.1.4 Compiling quick-error v1.2.2 Compiling bitwarden_rs v1.0.0 (/root/bitwarden_rs) Compiling rustc-hex v1.0.0 Compiling subtle v2.1.1 Compiling quoted_printable v0.4.1 Compiling data-encoding v2.1.2 Compiling semver v0.9.0 Compiling rand_pcg v0.1.2 Compiling rand_chacha v0.1.1 Compiling rand v0.6.5 Compiling num-traits v0.2.8 Compiling num-integer v0.1.41 Compiling unicase v1.4.2 Compiling unicase v2.4.0 Compiling error-chain v0.12.1 Compiling nom v4.2.3 Compiling email v0.0.20 Compiling rand_core v0.3.1 Compiling rand_jitter v0.1.4 Compiling owning_ref v0.4.0 Compiling owning_ref v0.3.3 Compiling unicode-normalization v0.1.8 Compiling thread_local v0.3.6 Compiling crossbeam-utils v0.6.6 Compiling try_from v0.3.2 Compiling proc-macro2 v0.3.8 Compiling unicode-bidi v0.3.4 Compiling ring v0.14.6 Compiling backtrace-sys v0.1.31 Compiling openssl-sys v0.9.49 Compiling libsqlite3-sys v0.12.0 Compiling pear_codegen v0.1.2 Compiling lock_api v0.3.1 Compiling lock_api v0.2.0 Compiling tokio-sync v0.1.6 Compiling foreign-types v0.3.2 Compiling rocket_codegen v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=dbcb0a75b9556763ac3ab708f40c8f8ed75f1a1e#dbcb0a75) Compiling rocket v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=dbcb0a75b9556763ac3ab708f40c8f8ed75f1a1e#dbcb0a75) Compiling pest v2.1.1 Compiling futf v0.1.4 Compiling c2-chacha v0.2.2 Compiling miniz_oxide v0.3.2 Compiling proc-macro-hack v0.4.2 Compiling encoding-index-singlebyte v1.20141219.5 Compiling encoding-index-tradchinese v1.20141219.5 Compiling encoding-index-korean v1.20141219.5 Compiling encoding-index-japanese v1.20141219.5 Compiling encoding-index-simpchinese v1.20141219.5 Compiling block-padding v0.1.4 Compiling synom v0.11.3 Compiling walkdir v2.2.9 Compiling fast_chemail v0.9.6 Compiling rustc_version v0.2.3 error: failed to run custom build command for `rand_pcg v0.1.2` Caused by: process didn't exit successfully: `/root/bitwarden_rs/target/debug/build/rand_pcg-4fcb61996e763c83/build-script-build` (signal: 11, SIGSEGV: invalid memory reference) --- stdout cargo:rerun-if-changed=build.rs warning: build failed, waiting for other jobs to finish... error: build failed**** ``` Any thoughts? The host is a FreeBSD jail running `FreeBSD 12.0-RELEASE-p3 GENERIC amd64`
kerem closed this issue 2026-03-03 01:28:41 +03:00
Author
Owner

@esell commented on GitHub (Aug 29, 2019):

I am quickly getting out of my element here as I'm not much of a rust person, but I did try to pull down this crate (which I believe is the correct one) https://github.com/rust-random/rand, and all of the tests passed...

<!-- gh-comment-id:526383105 --> @esell commented on GitHub (Aug 29, 2019): I am quickly getting out of my element here as I'm not much of a rust person, but I did try to pull down this crate (which I believe is the correct one) https://github.com/rust-random/rand, and all of the tests passed...
Author
Owner

@mprasil commented on GitHub (Aug 30, 2019):

It might be worth reporting the issue under the rand repo, maybe it will make more sense to them.

<!-- gh-comment-id:526521850 --> @mprasil commented on GitHub (Aug 30, 2019): It might be worth reporting the issue under the rand repo, maybe it will make more sense to them.
Author
Owner

@dani-garcia commented on GitHub (Aug 30, 2019):

We had a user report this in the matrix channel and for him updating the version of rust to the latest nightly fixed it, You might also need to do a cargo clean before to make sure there aren’t any old files around.

<!-- gh-comment-id:526529272 --> @dani-garcia commented on GitHub (Aug 30, 2019): We had a user report this in the matrix channel and for him updating the version of rust to the latest nightly fixed it, You might also need to do a cargo clean before to make sure there aren’t any old files around.
Author
Owner

@esell commented on GitHub (Aug 30, 2019):

I just pulled down the latest nightly with rustup + cargo clean and still am getting the failures. I'll bubble this up to the rand folks and see what happens :). Thanks for taking a look.

<!-- gh-comment-id:526606575 --> @esell commented on GitHub (Aug 30, 2019): I just pulled down the latest nightly with rustup + cargo clean and still am getting the failures. I'll bubble this up to the rand folks and see what happens :). Thanks for taking a look.
Author
Owner

@esell commented on GitHub (Aug 30, 2019):

Just adding some notes here in case anyone else runs into this. It seems like it is the version of the rand crate that is causing issues. Running the tests with rand_pcg at version 0.1.2 fails, but if you run the tests on the latest version, which currently is 0.2.0, everything passes.

It appears one of the bitwarden_rs dependencies is pulling in rand_pcg v0.1.2 :(.

<!-- gh-comment-id:526630000 --> @esell commented on GitHub (Aug 30, 2019): Just adding some notes here in case anyone else runs into this. It seems like it is the version of the rand crate that is causing issues. Running the tests with rand_pcg at version 0.1.2 fails, but if you run the tests on the latest version, which currently is 0.2.0, everything passes. It appears one of the bitwarden_rs dependencies is pulling in rand_pcg v0.1.2 :(.
Author
Owner

@ownaginatious commented on GitHub (Sep 11, 2019):

@esell ran into the exact same issue as you. I'm totally unfamiliar with rust, but I was able to finally get things to build by upgrading to the newest rust compiler first (as @dani-garcia mentioned) by doing the following:

 # Install rustup tool from the internet.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Get the latest nightly.
$HOME/.cargo/bin/rustup install nightly

cd bitwarden_rs
$HOME/.cargo/bin/cargo clean # only necessary if you tried installing once
$HOME/.cargo/bin/cargo +nightly build --features sqlite

Hopefully this helps you and the rest of the tiny handful of people trying to get bitwarden_rs working in a FreeBSD jail out there :)

<!-- gh-comment-id:530241161 --> @ownaginatious commented on GitHub (Sep 11, 2019): @esell ran into the exact same issue as you. I'm totally unfamiliar with `rust`, but I was able to finally get things to build by upgrading to the newest rust compiler first (as @dani-garcia mentioned) by doing the following: ```bash # Install rustup tool from the internet. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Get the latest nightly. $HOME/.cargo/bin/rustup install nightly cd bitwarden_rs $HOME/.cargo/bin/cargo clean # only necessary if you tried installing once $HOME/.cargo/bin/cargo +nightly build --features sqlite ``` Hopefully this helps you and the rest of the tiny handful of people trying to get `bitwarden_rs` working in a FreeBSD jail out there :)
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#392
No description provided.