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

[vaultwarden] Bitwarden guide would only work with dev/nightly builds of Rust #708

Closed
jonmz opened this issue Jul 10, 2020 · 20 comments · Fixed by #1170
Closed

[vaultwarden] Bitwarden guide would only work with dev/nightly builds of Rust #708

jonmz opened this issue Jul 10, 2020 · 20 comments · Fixed by #1170
Labels
bug Something isn't working. ✨Goodie for three PRs

Comments

@jonmz
Copy link
Contributor

jonmz commented Jul 10, 2020

The bitwarden guide currently fails at this point:

[bitwtest@stardust bitwarden_rs]$ cargo build -j 1 --release --features sqlite
[...]
error: failed to run custom build command for `pear_codegen v0.1.4`

Caused by:
  process didn't exit successfully: `/home/bitwtest/bitwarden_rs/target/release/build/pear_codegen-eb17718987529976/build-script-build` (exit code: 101)
--- stderr
Error: Pear requires a 'dev' or 'nightly' version of rustc.
Installed version: 1.43.1 (2020-05-04)
Minimum required:  1.31.0-nightly (2018-10-05)
thread 'main' panicked at 'Aborting compilation due to incompatible compiler.', /home/bitwtest/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.1.4/build.rs:24:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

There is an issue about that: Pear requires a nightly or dev version of Rust. The author of the package in question states:

The message continues to be correct for the time being and will disappear in a later release of pear that doesn't require nightly.

Uberspace is providing a version of Rust that is even way more recent than the minimum required version, but it is a stable version, not a dev or nightly version, so the check of Pear fails.

I do not see any reason why Uberspace should provide a nightly build if a current stable build is available. So until this is fixed in the Pear module, I would suggest to - temporarily - drop the guide because I do not see how it could be made working.

@SalocinHB SalocinHB added the bug Something isn't working. ✨Goodie for three PRs label Jul 20, 2020
@luto
Copy link
Member

luto commented Jul 20, 2020

I'm a bit lost here. Can a rust user/dev chime in, please? Is the stable version enough for most use cases and bitwarden is just special? Or do we need to provide a nightly one too, because that's just how rust works?

@jonmz
Copy link
Contributor Author

jonmz commented Jul 20, 2020

There seems to be some light at the end of the tunnel: SergioBenitez/Pear#23 (comment)

@felixfoertsch
Copy link
Contributor

Any update on this one? I don't fully understand the connections between the software here, but from what I could gather, Pear should compile on stable now? Which project do I have to poke to move the ball forward? 😁

@luto
Copy link
Member

luto commented Jul 23, 2020

Try to compile the newest bitwarden release and let us know what happens. If that doesn't work, poke bitwarden to get the newest pear into their deps, I guess :)

@felixfoertsch
Copy link
Contributor

felixfoertsch commented Jul 23, 2020

Did a little more research. The land marks seem to be the next releases of Rocket and Rust. Source

@dani-garcia
Copy link

Hey bitwarden_rs dev here! The reason behind the nightly requirement is due to the use of some unstable language features by Rocket and its dependencies.

When I say "unstable features", these are simply new Rust features that are still subject to change, so they are only enabled on the nightly builds, because otherwise people might rely on their current API making it impossible for the Rust dev team to change them without breaking people's code.

This is why you can currently compile Rocket 0.4 with a nightly build from a year ago, but not with the stable release from last month. Yes the stable release would be newer, but the unstable features that Rocket requires (and that weren't stabilized yet) would be disabled.

Of these unstable features, the macro-related ones are the more painful ones, as they are essential for the functionality of Rocket, but they've been stuck on the stabilization track for a couple of years now.

That said, the new Rust release 1.45.0 from last week has stabilized the last of those features and the master branch of Rocket now compiles on stable. I've made a separate branch of bitwarden_rs using Rocket master, and it compiles with stable Rust: https://github.com/dani-garcia/bitwarden_rs/tree/async

Sadly the changes between Rocket 0.4 and the current master are too great to backport, but I think Rocket 0.5 is not that far into the future, and once it releases I'll update to it in the main branch.

Hope that solved some of the doubts y'all had!

@jonmz
Copy link
Contributor Author

jonmz commented Jul 23, 2020

Thanks a lot for your insights, @dani-garcia!

@felixfoertsch
Copy link
Contributor

felixfoertsch commented Jul 24, 2020

Alright! I just tried compiling it on my Uberspace with the branch @dani-garcia published. Now the ball is in the court of the Ubernauten, I think:

error: failed to run custom build command for `rocket v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=adc79016cdfe732a6c095dd96aa5286a70c4d3be#adc79016)`

Caused by:
  process didn't exit successfully: `/home/*************/services/bitwarden_rs/target/release/build/rocket-a426be6b7e7855e8/build-script-build` (exit code: 101)
--- stderr
Error: Rocket requires a more recent version of rustc.
Installed version: 1.43.1
Minimum required:  1.45.0
thread 'main' panicked at 'Aborting compilation due to incompatible compiler.', /home/*************/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/adc7901/core/lib/build.rs:19:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@brutus
Copy link
Contributor

brutus commented Jul 24, 2020

@felixfoertsch I just rolled out Rust release 1.45 on all hosts.

@felixfoertsch
Copy link
Contributor

I just compiled bitwarden_rs successfully. Build process took quite a while:

Finished release [optimized] target(s) in 49m 29s

I pushed a temporary note. #722

@pepa65
Copy link

pepa65 commented Nov 29, 2020

I'm hitting this. What is the command for building it with the nightly?

@bhopmann
Copy link
Contributor

bhopmann commented Feb 7, 2021

Build fails with latest release 1.19.0 (using the async branch):

error: could not compile `bitwarden_rs`

Caused by:
  process didn't exit successfully:
[...]
(signal: 9, SIGKILL: kill)

Edit1: submitted issue on dani-garcia/vaultwarden#1369

Edit2: Is this failure perhaps caused by the memory limit (https://manual.uberspace.de/basics-resources/#ram) - the previous version 1.18.0 compiled without problems?

@bhopmann
Copy link
Contributor

bhopmann commented Feb 7, 2021

Ok, it seems, that version 1.19.0 uses more resources than the previous version - after stopping other processes the build suceeded.

@sdoering
Copy link

I currently have the same (or similar problem).

I followed the steps, cloned the git repo into vault.DOMAIN.TLD, checked out --async and created a data directory. The next step, the build step fails:

cargo build -j 1 --release --features sqlite
error: failed to parse manifest at `/var/www/virtual/mcats/vault.greynoise.studio/Cargo.toml`

Caused by:
  feature `edition2021` is required

  The package requires the Cargo feature called `edition2021`, but that feature is not stabilized in this version of Cargo (1.55.0 (32da73ab1 2021-08-23)).
  Consider trying a newer version of Cargo (this may require the nightly release).
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2021 for more information about the status of this feature.

@dani-garcia
Copy link

Hey dev here, the newest async branch needs rust stable 1.56. If you can't update the compiler, the previous async code before the migration to the 2021 edition is available in the async_2021_03_22 branch. That should work with an older rust stable.

@luto
Copy link
Member

luto commented Nov 14, 2021

thanks for the heads-up! I put an update to .56 into the pipeline. Should be available in a few days :)

@luto
Copy link
Member

luto commented Nov 14, 2021

rust 1.56.0 is now deployed everywhere. Does the guide need any further updates or does that solve the problem?

@kurti500
Copy link

kurti500 commented Nov 14, 2021

rust 1.56.0 is now deployed everywhere. Does the guide need any further updates or does that solve the problem?

just tried to rebuild and get following error:
package vaultwarden v1.0.0 (/home/xxx/vaultwarden) cannot be built because it requires rustc 1.56 or newer, while the currently active rustc version is 1.53.0

however rustc --version shows
rustc 1.56.0 (09c42c458 2021-10-18)

Anything still missing?

@knhash
Copy link
Contributor

knhash commented Nov 27, 2021

Looks we need 1.57 or newer, running into the following error:

error: package `vaultwarden v1.0.0 (/home/isabell/vaultwarden)` cannot be built because it requires rustc 1.57 or newer, while the currently active rustc version is 1.56.0

@knhash
Copy link
Contributor

knhash commented Nov 27, 2021

Although... I did have success following the steps here: Pre-built-binaries#extracting-binaries-without-docker-installed

Everything seems to work, across web vault and mobile app.

@noave noave changed the title Bitwarden guide would only work with dev/nightly builds of Rust [vaultwarden] Bitwarden guide would only work with dev/nightly builds of Rust Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. ✨Goodie for three PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.