this enables faster incremental rebuilds in nix. it also allows us to
add clippy and cargo test checks more easily. aside from that, i have
tried to carry over things that i think are sensible from the previous
`mkDerivation` call.
the `checkPhase` may as well rather be done in a `installCheckPhase` and
we can set `enableParallelBuilding` to speed up the compilation of
`libbcachefs.a`.
with this, the gh actions ci will fail if submitted code does not adhere
to rustfmt rules.
additionally, running `nix fmt` will also format rust code.
because we want rules only supported by nightly rustfmt, and nixpkgs
doesn't have a nightly toolchain, we need to pull in another flake
input: fenix.
let's always first check if there is already a key in the keyring
available before we try to get the key from some more involved means.
Fixes: #261
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
We're still having issues with corrupted dumps when we try to dump only
the live part of btree nodes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The error code is in errno, not the return value.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
so since up until the last merged changes, this entire gh action pretty
much equated to a no-op, afaict. and even now, the only thing i added in
PR #272 is a formatter check only for *.nix files.
i plan to add more checks soon that will be run by `nix flake check`.
but as of right now, adding this is the quickest way to make sure at
least something useful is done by this workflow.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
currently still bare but can be extended with a number of different
formatters (rustfmt, clang-format, ...). For full list see
https://flake.parts/options/treefmt-nix
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
it also provides a way for abstracting `system` and provides optional
modules, like treefmt-nix.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
it shouldn't really be our job to define an overlay. it doesn't do
anything for us, afaict, and is trivial to implement for downstream
users of the flake if they so desire.
also the overlay doesn't even overlay anything, there is no package
called `bcachefs` in nixpkgs.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Only bkeys of the specified type will be printed.
Also, this reworks the error type in bch_bindgen to be able to
represent other kinds of error than just "invalid btree id".
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
If the user passes a single device node during the mount and
we have no information for it in the udev db, we read up the
super block. When we do this, if the FS only has 1 block device
we will simply go ahead and do the mount instead of walking
all the block devices and reading up super blocks looking for
devices with a matching FS UUID.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Introduce an env. variable for users that have a broken blkid which
renders the udev db as incomplete. Only checks for the existence
of the variable, not its value.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
If the udev database contains information about bcachefs, utilize it.
Otherwise, resort to traversing block devices and checking for
bcachefs super blocks.
V2: Reduce number of places we call read_super_slient in interators
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
It is more idiomatic to use `commands::mount` than
`commands::cmd_mount`.
No functionality changes intended by this patch.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Without the single char (with ':' if optarg expected) only the long
argument string would successfully parse.
For example, now "-lasdf" parses the same as "--label asdf"