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
bitwarden_rs: 1.9.1 -> 1.13.0 #74927
Conversation
Thank you for updating bitwarden_rs! I have not yet tested the changes myself, but I have looked over the code changes and they look good to me. However what are the implications on the corresponding bitwarden_rs module? Doesn't the backup script and its service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building bitwarden_rs
breaks for me with the following failure:
bitwarden_rs> Compiling bitwarden_rs v1.0.0 (/build/source)
bitwarden_rs> Compiling subtle v2.2.2
bitwarden_rs> error: You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite
bitwarden_rs> --> build.rs:12:5
bitwarden_rs> |
bitwarden_rs> 12 | compile_error!("You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite");
bitwarden_rs> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bitwarden_rs> Compiling data-encoding v2.1.2
bitwarden_rs> Compiling quoted_printable v0.4.1
bitwarden_rs> error: aborting due to previous error
bitwarden_rs> error: could not compile `bitwarden_rs`.
bitwarden_rs> warning: build failed, waiting for other jobs to finish...
bitwarden_rs> error: build failed
bitwarden_rs> builder for '/nix/store/znfdg3299j5mhq87y1p6mdxlc92l41vg-bitwarden_rs-1.13.0.drv' failed with exit code 101
046feb0
to
a4faba1
Compare
@msteen I updated the module (didn't implement alternative backup strategies yet). |
a4faba1
to
b7860cf
Compare
b7860cf
to
45d1db8
Compare
Co-authored-by: msteen <msteen@users.noreply.github.com> Co-authored-by: Daniel Løvbrøtte Olsen <daniel.olsen99+GitHub@gmail.com>
Rolling out initial support for: - mysql (1.10.0) https://github.com/dani-garcia/bitwarden_rs/releases/tag/1.10.0 - postgresql (1.11.0) https://github.com/dani-garcia/bitwarden_rs/releases/tag/1.11.0 As current backup strategy is sqlite-specific, more work is needed. For now, an assertion to make users know those wont work.
45d1db8
to
d611666
Compare
Ah sorry, I totally forgot about that one! (next time feel free to ping me!). Will review/test it locally now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are hardcoding the use of sqlite for now, it is better not to commit the work in progress done in the module, none of those changes are necessary at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module currently breaks with the following error:
error: anonymous function at /home/ma27/Projects/nixpkgs/pkgs/tools/security/bitwarden_rs/default.nix:1:1 called with unexpected argument 'dbBackend', at /home/ma27/Projects/nixpkgs/lib/customisation.nix:69:16
(use '--show-trace' to show detailed location information)
nativeBuildInputs = [ pkgconfig ]; | ||
buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security CoreServices ]; | ||
|
||
RUSTC_BOOTSTRAP = 1; | ||
|
||
cargoSha256 = "0p39gqrqdmgqhngp1qyh6jl0sp0ifj5n3bxfqafjbspb4zph3ls4"; | ||
cargoSha256 = "03szl83r9mjn08mqkwah8fmzpszci8ay7ki69yx1rgv3zx7npnxk"; | ||
cargoBuildFlags = [ "--features sqlite" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the dbBackend
flag (as mentioned above, this currently breaks eval as well) and validate the option's value using types.enum
(this means that you can see all supported backends when looking e.g. at configuration.nix(5)
) and in the package (to ensure that people get an evaluation error for invalid backends during eval when using e.g. bitwarden_rs
from Nix on a non-NixOS system).
Also I'm wondering if it makes sense to provide e.g. a bitwarden_rs-full
/bitwarden_rs-minimal
, but I haven't checked the final closure sizes, so I'm not sure how many variants we actually want to add.
@@ -69,6 +84,11 @@ in { | |||
}; | |||
|
|||
config = mkIf cfg.enable { | |||
assertions = [{ | |||
assertion = cfg.backupDir != null -> elem cfg.dbBackend supportedBackupBackends; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second part of the assertion is always true atm as the only allowed value (which is also the default) is sqlite
which makes the condition always true.
cargoBuildFlags = [ "--features sqlite" ]; | ||
|
||
# FIXME: The rust check phase seems broken due to passing the flags after --. | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I set doCheck
to true
, I currently get the following errors:
bitwarden_rs> error: You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite
bitwarden_rs> --> build.rs:12:5
bitwarden_rs> |
bitwarden_rs> 12 | compile_error!("You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite");
bitwarden_rs> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bitwarden_rs> Compiling dotenv v0.15.0
Not sure if I'm misunderstanding your comment, but isn't it possible to somehow add some additional feature flags (e.g. for a default backend for testing) to the check-phase to ensure that the test builds with a db-backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the right fix would be to fix checkPhase
instead, because it does not really make sense to add flags after --
. Apparently some flags can be added after --
(seems a weird API design choice to me) as can be seen in the cargo test
manpage (e.g. cargo test -- --nocapture
), but the documented flags have to be added before --
, like --features
. Maybe it can be fixed by adding checkArgs
to differentiate between flags and arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just passing all cargo flags to cargo test could solve this issue.
This is what I did to implement postgresql/mysql as well: Mic92@86031cd I had to switch to rust nightly in my fork so. |
Do we actually need nightly features or is it sufficient to set |
Ah. This might be the problem. |
This variant no longer needs nightly: 30c49ee7ba3c43b13f1e26ae8dc7ef6b03e3d13a |
Closing in favor of #78615. |
Motivation for this change
https://github.com/dani-garcia/bitwarden_rs/releases/tag/1.13.0
MySQL and (initial) PostgreSQL support have been added, and are accomodated in this PR. The default DB is still SQLite (to preserve backwards compatibility).
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @msteen
This change is