cezarmathe / btrfsutil-rs

Safe wrappers for libbtrfsutil.
https://crates.io/crates/btrfsutil
MIT License
6 stars 5 forks source link

Building examples fails #18

Closed lUNuXl closed 1 year ago

lUNuXl commented 3 years ago

Hello,

I just cloned the repository and wanted to compile the examples like it's shown in the readme by using: cargo build --examples

   Compiling btrfsutil v0.1.0 (/tmp/btrfsutil-rs)
     Running `rustc --crate-name subvolume_iterator_info --edition=2018 examples/subvolume_iterator_info.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=99493dc0e499a1f7 -C extra-filename=-99493dc0e499a1f7 --out-dir /tmp/btrfsutil-rs/target/debug/examples -C incremental=/tmp/btrfsutil-rs/target/debug/incremental -L dependency=/tmp/btrfsutil-rs/target/debug/deps --extern bitflags=/tmp/btrfsutil-rs/target/debug/deps/libbitflags-0cd415034ee648ca.rlib --extern btrfsutil=/tmp/btrfsutil-rs/target/debug/deps/libbtrfsutil-966ab251e35e1ce3.rlib --extern btrfsutil_sys=/tmp/btrfsutil-rs/target/debug/deps/libbtrfsutil_sys-71a95990b4d2e496.rlib --extern chrono=/tmp/btrfsutil-rs/target/debug/deps/libchrono-e2e17c2673c59046.rlib --extern libc=/tmp/btrfsutil-rs/target/debug/deps/liblibc-bb07417106e69ff9.rlib --extern libmount=/tmp/btrfsutil-rs/target/debug/deps/liblibmount-375cfedd7c41acff.rlib --extern loopdev=/tmp/btrfsutil-rs/target/debug/deps/libloopdev-644ecdbbd5c7ce20.rlib --extern nix=/tmp/btrfsutil-rs/target/debug/deps/libnix-a65400f06839ac2c.rlib --extern tempfile=/tmp/btrfsutil-rs/target/debug/deps/libtempfile-28cb05591749222e.rlib --extern thiserror=/tmp/btrfsutil-rs/target/debug/deps/libthiserror-bfaab245d3803832.rlib --extern uuid=/tmp/btrfsutil-rs/target/debug/deps/libuuid-959314128929bc1a.rlib`
error[E0599]: no function or associated item named `from_path` found for struct `btrfsutil::subvolume::Subvolume` in the current scope
 --> examples/subvolume_iterator_info.rs:7:34
  |
7 |     let root_subvol = Subvolume::from_path(Path::new("/")).unwrap();
  |                                  ^^^^^^^^^ function or associated item not found in `btrfsutil::subvolume::Subvolume`

error[E0599]: no method named `info` found for enum `std::result::Result<btrfsutil::subvolume::Subvolume, btrfsutil::error::LibError>` in the current scope
  --> examples/subvolume_iterator_info.rs:15:36
   |
15 |         println!("{:?}", subvolume.info().unwrap());
   |                                    ^^^^ method not found in `std::result::Result<btrfsutil::subvolume::Subvolume, btrfsutil::error::LibError>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `btrfsutil`.

Caused by:
  process didn't exit successfully: `rustc --crate-name subvolume_iterator_info --edition=2018 examples/subvolume_iterator_info.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=99493dc0e499a1f7 -C extra-filename=-99493dc0e499a1f7 --out-dir /tmp/btrfsutil-rs/target/debug/examples -C incremental=/tmp/btrfsutil-rs/target/debug/incremental -L dependency=/tmp/btrfsutil-rs/target/debug/deps --extern bitflags=/tmp/btrfsutil-rs/target/debug/deps/libbitflags-0cd415034ee648ca.rlib --extern btrfsutil=/tmp/btrfsutil-rs/target/debug/deps/libbtrfsutil-966ab251e35e1ce3.rlib --extern btrfsutil_sys=/tmp/btrfsutil-rs/target/debug/deps/libbtrfsutil_sys-71a95990b4d2e496.rlib --extern chrono=/tmp/btrfsutil-rs/target/debug/deps/libchrono-e2e17c2673c59046.rlib --extern libc=/tmp/btrfsutil-rs/target/debug/deps/liblibc-bb07417106e69ff9.rlib --extern libmount=/tmp/btrfsutil-rs/target/debug/deps/liblibmount-375cfedd7c41acff.rlib --extern loopdev=/tmp/btrfsutil-rs/target/debug/deps/libloopdev-644ecdbbd5c7ce20.rlib --extern nix=/tmp/btrfsutil-rs/target/debug/deps/libnix-a65400f06839ac2c.rlib --extern tempfile=/tmp/btrfsutil-rs/target/debug/deps/libtempfile-28cb05591749222e.rlib --extern thiserror=/tmp/btrfsutil-rs/target/debug/deps/libthiserror-bfaab245d3803832.rlib --extern uuid=/tmp/btrfsutil-rs/target/debug/deps/libuuid-959314128929bc1a.rlib` (exit code: 1)
cezarmathe commented 3 years ago

Hi!

The examples are supposed to work for the tagged 0.1.0 release :(. The master branch is a work-in-progress which includes breaking changes, although I'm no longer working on this library at this point in time.

NAlexPear commented 1 year ago

This should be fixed on the master branch and in the imminent v0.2.0 release :+1: