Coder Social home page Coder Social logo

libzetta-rs's Introduction

Build Status codecov Crates.io Cirrus CI - Base Branch Build Status docs.rs license

libzetta-rs is a stable interface for programmatic administration of ZFS

Installation

Not yet. It won't break your pool or kill your brother, but API might change. Wait until 1.0.0. I have a pretty decent roadmap to 1.0.0.

Usage

Public API for zpool stable. Public API for zfs might change after I actually get to use it in other projects. Consult the documention on usage.

FreeBSD

This library focused on FreeBSD support. This should work on any FreeBSD version since 9.2. No intention on supporting legacy versions. Supported versions:

  • 12.1
  • 13.0 (No CI setup for it)

NOTE: FreeBSD 13.0 borked libzfs_core dependencies. Until it's fixed solution is to use LD_PRELOAD to load libzfs_core from ports. NOTE: Since FreeBSD switched to OpenZFS, support for "legacy" will be dropped at first breakage.

Linux

Verified on what is avaiable for Ubuntu 20.04 at the time of writting it's 0.8.3.

How it works

ZFS doesn't have stable API at all.libzfs_core(lzc) fills some gaps, but not entirely. While lzc provides stable APi to some features of zfs, there is no such thing for zpool. This library resorts to zfs(8) and zpool(8) where lzc falls shorts.

Running tests

Vagrantfile has 3 VMS: ubuntu-20.04, FreeBSD 12 and FreeBSD 13 to use them:

  • Spin up either one of those
  • Install just
  • Run just test-ubuntu or just test-freebsd12 to run tests in the VM
  • To run a specific test run just test-ubuntu "-- easy_snapshot_and_bookmark"

NOTE: Integration tests must be run as a root. Zpools and datasets will be created/modified/destroyed. If it wipes your system datasets that's on you for running it outside of VM.

Nix

Project is nix-flake enabled, but it flake itself isn't enough: you need to provide libzfs_core and its dependencies yourself. This is on-purpose.

Current feature status

zpool

Create Destroy Get Properties Set Properties Scrub Export Import List Available Read Status Add vdev Replace Disk
open3 ✔¹
  1. Reads the status, but api isn't stable and does poor job at reporting scrubbing status.

zfs

Filesystem and ZVOL

Create Destroy List Get Properties Update Properties
open3
lzc ✔¹
  1. Might not have all properties available.

Snapshot and bookmark

Create Destroy List Get Properties Send Recv
open3
lzc ✔¹
  1. Might not have all properties available.

Alternatives

Unlike them LibZetta doesn't link against private libraries of ZFS. libzetta also has more documention.

LibZetta has zpool APIs. LibZetta shares -sys crates with this library. LibZetta also will delegate certain features of zfs(8) to open3 implementation.

LICENSE

BSD-2-Clause.

libzetta-rs's People

Contributors

andoriyu avatar asomers avatar candunc avatar dependabot-preview[bot] avatar dependabot[bot] avatar fabianfreyer avatar fossabot avatar ociaw avatar owenthewizard avatar richardstephens avatar s-burris avatar valpackett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libzetta-rs's Issues

Consumer should be able to create zfs data

Describe the bug
Integer overflow in error stats parsing causes panic.

To Reproduce
Parse this:

  pool: tank
 state: DEGRADED
status: One o0 more devices could not be opened.  SufficiWed Jan 20 15r13:59p2010
config:

        NAME        STATE     READ WRITE CKSUM
        tank        DEGRADED     1     0     0
          mirror-0  DEGRADED     0     0     0
            c1t0d0  ONLINE       0     0     0
            c1t1d0  UNAVAIL      0    tank        DEGRADED     1     0     0
          mirror-0  DEGRADED     0     0     0
            c1t0d0  ONLINE       0     0     0
            c1t1d0  UNAVAIL0     0    tank        DEGRADED     1     0     0
          mirror-0  DEGRADED     0     0     0
         c1t0d0  ONLINE       0     0     0
            c1t1d0  UNAVAIL0 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999    0     0  cann  ONLINE      (0     0     0
           c1t1d09 UNAVAIL0     0    tank        DEGRADED     1     0     0
          mirror-0  DEGRADED     0     0     0

Expected behavior
Maybe stop at max uint?

Additional context
fuzzy found

zpool status is not parsing log devices.

Parser fails to parse outputs like this:


  pool: tests-12420843063280352273
 state: ONLINE
  scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        tests-12420843063280352273  ONLINE       0     0     0
          /vdevs/vdev1  ONLINE       0     0     0
        logs
          /vdevs/vdev2  ONLINE       0     0     0

errors: No known data errors

Probably can't parse cache devices too.

Weekly Digest (17 February, 2019 - 24 February, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week 3 issues were created.
Of these, 0 issues have been closed and 3 issues are still open.

OPEN ISSUES

💚 #45 Replace regexp with pest based error message parser, by andoriyu
💚 #44 chore: Update deps, by andoriyu
💚 #43 add regexp for this too..., by source-of-truth[bot]

NOISY ISSUE

🔈 #43 add regexp for this too..., by source-of-truth[bot]
It received 1 comments.


PULL REQUESTS

Last week, 2 pull requests were created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #44 chore: Update deps, by andoriyu

MERGED PULL REQUEST

Last week, 1 pull request was merged.
💜 #39 refactor: Make Vdev and Zpool structure more understandable, by andoriyu


COMMITS

Last week there was 1 commit.
🛠️ refactor: Make Vdev and Zpool structure more understandable (#39) by andoriyu


CONTRIBUTORS

Last week there was 1 contributor.
👤 andoriyu


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (3 March, 2019 - 10 March, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Test easy_snapshot_and_bookmark is failing

Current master has a failing test:

    ☓ easy_snapshot_and_bookmark
        thread 'easy_snapshot_and_bookmark' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 1032, kind: Uncategorized, message: "Unknown error 1032" })', tests/test_zfs.rs:287:48
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Need to:

  • Map error code to a proper error
  • Fix code so test passes

Weekly Digest (27 January, 2019 - 3 February, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (10 February, 2019 - 17 February, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week 1 issue was created.
It is closed now.

CLOSED ISSUES

❤️ #40 chore: Try using cargo-suity for test reports, by andoriyu

NOISY ISSUE

🔈 #40 chore: Try using cargo-suity for test reports, by andoriyu
It received 1 comments.


PULL REQUESTS

Last week, 1 pull request was created, updated or merged.

MERGED PULL REQUEST

Last week, 1 pull request was merged.
💜 #40 chore: Try using cargo-suity for test reports, by andoriyu


COMMITS

Last week there was 1 commit.
🛠️ [chore: Try using cargo-suity for test reports (#40) * Try using cargo-suity for test reports

  • run apt-get update before installing deps

  • Probably the reason

  • Use sudo

  • use sudo

  • Try not reporting

  • spelling

  • LINK_DEAD_CODE](7eb511f) by andoriyu


CONTRIBUTORS

Last week there was 1 contributor.
👤 andoriyu


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (24 February, 2019 - 3 March, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Status during resilver on freebsd 12 is not parsed correctly.

Cirrus CI revealed a bug in parser:

Aug 13 23:03:12.141 DEBG executing, module: zpool, impl: open3, version: 0.1.0, out: Output { status: ExitStatus(ExitStatus(0)), stdout: "  pool: tests-5342281596445495276\n state: ONLINE\nstatus: One or more devices is currently being resilvered.  The pool will\n\tcontinue to function, possibly in a degraded state.\naction: Wait for the resilver to complete.\n  scan: resilver in progress since Tue Aug 13 23:03:11 2019\n\t42.5K scanned at 42.5K/s, 80K issued at 80K/s, 83K total\n\t512 resilvered, 96.39% done, no estimated completion time\nconfig:\n\n\tNAME              STATE     READ WRITE CKSUM\n\ttests-5342281596445495276  ONLINE       0     0     0\n\t  mirror-0        ONLINE       0     0     0\n\t    /vdevs/vdev1  ONLINE       0     0     0\n\t    /vdevs/vdev2  ONLINE       0     0     0\n\nerrors: No known data errors\n", stderr: "" }

output above is not parsed by current grammar.

Missing add_spare and status doesn't show spares

example of zpool:

  pool: test-123
 state: ONLINE
  scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        test-123        ONLINE       0     0     0
          /vdevs/vdev0  ONLINE       0     0     0
        spares
          /vdevs/vdev1  AVAIL

errors: No known data errors

Weekly Digest (25 January, 2019 - 1 February, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

`list_filesystems` Doesn't list all filesystem

z
z/ROOT
z/ROOT/default
z/docker
z/iohyve
z/iohyve/Firmware
z/iohyve/ISO
z/iohyve/ISO/rancheros-v1.4.0.iso
z/iohyve/rancher
z/portshaker
z/portshaker/cache
z/portshaker/cache/andoriyu-local
z/portshaker/cache/freebsd-svn
z/portshaker/cache/vscode-git
z/poudriere
z/poudriere/data
z/poudriere/data/.m
z/poudriere/data/cache
z/poudriere/data/logs
z/poudriere/data/packages
z/poudriere/data/wrkdirs
z/poudriere/jails
z/poudriere/jails/live
z/poudriere/ports
z/poudriere/ports/dev
z/poudriere/ports/prestine
z/poudriere/ports/system
z/tmp
z/usr
z/usr/home
z/usr/ports
z/usr/ports/distfiles
z/usr/src
z/var
z/var/ccache
z/var/crash
z/var/log
z/var/mail
z/var/tmp

^^ gets cut off on z/poudriere/data being added twice

Linking errors on FreeBSD 13

Describe the bug
Applications using libzetta-rs will fail to link on FreeBSD 13

To Reproduce
Create an application with:

Cargo.toml

[package]
name = "test-libzetta"
version = "0.1.0"
edition = "2021"

[dependencies]
libzetta = "0.2.3"

main.rs

use libzetta::zpool::{ZpoolEngine, ZpoolOpen3};

fn main() {
    let engine = ZpoolOpen3::default();
    println!("{:?}", engine.all());
}

Output of cargo build

cargo build
   Compiling test-libzetta v0.1.0 (/usr/home/fabio/test-libzetta)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.13vyoyvt6ut8qa5m.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.1g57q4l20h1sbylx.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.1hc5sscgiwlz5rt1.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.1no4ozf6fihavjsr.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.2eh76mkrra25xfho.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.2lqbqo1ixslvx3np.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.2q3ms8ajj197wbrc.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.2v34mcoc4aaskk2g.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.49ol8z3jsxvjced3.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.4c2kfi2vbw9lpczi.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.4ieoagz6eg9ydm6n.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.4mbepru4rnf3ae8j.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.4z2odpy993llm4j4.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.549sqzbjhbq31uxi.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.58vuh7cvh5xraki.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.adnfmifz9b85jrt.rcgu.o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c.wgzc6r635j683jj.rcgu.o" "-Wl,--as-needed" "-L" "/usr/home/fabio/test-libzetta/target/debug/deps" "-L" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "/usr/home/fabio/test-libzetta/target/debug/deps/liblibzetta-c0c2208462155e81.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libslog_stdlog-85b853dad24924e9.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libslog_scope-d601b90eb7739643.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libarc_swap-9a387d037f68fa26.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/liblog-a130a30210216936.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libcfg_if-2ada713ecf57f413.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libonce_cell-3fc1e37316b7afbe.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libregex-0084bcafe3196267.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libaho_corasick-62a6f1e0526bee88.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libregex_syntax-fc96c88b97e40e22.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libzfs_core_sys-be88779150ee38a4.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/liblibnv-eecd169ea87f0f3c.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libnvpair_sys-25097b93b3c3b815.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libquick_error-7c9e55177c42b376.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libcstr_argument-df5b1e6dd8b365dd.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libmemchr-a756181dd69f6b5b.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libchrono-8ee1bb0565b54ad0.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libnum_integer-f1d8f2152308d647.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libnum_traits-de3d57bfaf559dc1.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libtime-74f52fdd3abe55e3.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/liblibc-ba129cd47f474334.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libbitflags-dc63c3b8344cec44.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libpest-a71e6afb5c619968.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libucd_trie-f00a496b54ceb183.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libstrum-11f00cc59eff11ac.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libslog-9087c004595a5123.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libquick_error-47745199a257fd1c.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/liblazy_static-2aa374100e33a63a.rlib" "/usr/home/fabio/test-libzetta/target/debug/deps/libderive_builder-16b8bd07c2d554a5.rlib" "-Wl,--start-group" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-db85700b5100c208.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-49fd42a110084688.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libminiz_oxide-e7a0baf49db408ae.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libadler-c1e1fe663e9f22dd.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libobject-39a79c649c142089.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libmemchr-3779d4badebd9d41.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libaddr2line-7d901671e3110a8a.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libgimli-b3aca806e91bf121.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd_detect-386bd0661c47d9a4.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-ad743600e2db770d.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-178e77de45f627fb.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-034c9049396643d6.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-85a39d0fb36b02e1.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-5324df6b1bedd9cf.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-87eed9dedb3d1454.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-0b3e94b6f09c9394.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-9a4a1190b7fecb67.rlib" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-9d06bd3c15aab7bc.rlib" "-Wl,--end-group" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-99c13872153b3dea.rlib" "-Wl,-Bdynamic" "-lzfs_core" "-lnvpair" "-lzfs" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/home/fabio/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-o" "/usr/home/fabio/test-libzetta/target/debug/deps/test_libzetta-22c98f66717fc84c" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: ld: error: /usr/lib/libzfs_core.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined]
          ld: error: /usr/lib/libzfs_core.so: undefined reference to zfs_ioctl_fd [--no-allow-shlib-undefined]
          cc: error: linker command failed with exit code 1 (use -v to see invocation)

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `test-libzetta` due to previous error

Expected behavior
The application should compile and build without any issues

** Please complete the following information:**

  • OS: FreeBSD 13.0-RELEASE-p7
  • libZetta 0.2.3
  • cargo 1.58.0 (f01b232bc 2022-01-19)
  • rustc 1.58.1 (db9d1b20b 2022-01-20)
  • cc --version
    FreeBSD clang version 11.0.1 ([email protected]:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
    Target: x86_64-unknown-freebsd13.0
    Thread model: posix
    InstalledDir: /usr/bin

Additional context
There's a related issue on FreeBSD mailing list regarding these missing symbols

Workaround
As a workaround I'm linking these libs explicitly as instructed by the mailing list issue:
build.rs

fn main() {
    println!("cargo:rustc-link-lib=spl");
    println!("cargo:rustc-link-lib=zutil");
}

Now the application will compile and build without any issues:

cargo build
   Compiling test-libzetta v0.1.0 (/usr/home/fabio/test-libzetta)
     Finished dev [unoptimized + debuginfo] target(s) in 0.45s

Weekly Digest (3 February, 2019 - 10 February, 2019)

Here's the Weekly Digest for Inner-Heaven/libzfs-rs:


ISSUES

Last week 1 issue was created.
It is still open.

OPEN ISSUES

💚 #39 refactor: Make Vdev and Zpool structure more understandable [WIP], by andoriyu


PULL REQUESTS

Last week, 1 pull request was created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #39 refactor: Make Vdev and Zpool structure more understandable [WIP], by andoriyu


COMMITS

Last week there were 15 commits.
🛠️ j unit is borked by andoriyu
🛠️ Fix cargo junit script by andoriyu
🛠️ add codecov token by andoriyu
🛠️ Publish Junit test results by andoriyu
🛠️ No more travis by andoriyu
🛠️ run coverage on nightly by andoriyu
🛠️ Try night only step by andoriyu
🛠️ sudo fix by andoriyu
🛠️ tests require sudo by andoriyu
🛠️ Disable fmt check in azure pipeline by andoriyu
🛠️ Fix a few things by andoriyu
🛠️ Update azure-pipelines.yml for Azure Pipelines by andoriyu
🛠️ Update azure-pipelines.yml for Azure Pipelines by andoriyu
🛠️ Update azure-pipelines.yml for Azure Pipelines by andoriyu
🛠️ Set up CI with Azure Pipelines by andoriyu


CONTRIBUTORS

Last week there was 1 contributor.
👤 andoriyu


STARGAZERS

Last week there were 2 stagazers.
sarlalian
ontofractal
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository Inner-Heaven/libzfs-rs to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Make the error type thread-safe

Is your feature request related to a problem? Please describe.

The zfs::Error type cannot be used with e.g. the anyhow/eyre crates that require errors to be Send and Sync:

error[E0277]: `*mut nvpair_sys::nvlist` cannot be sent between threads safely
   --> src/ops.rs:18:46
    |
18  |     let zfs = zfs::DelegatingZfsEngine::new()?;
    |                                              ^ `*mut nvpair_sys::nvlist` cannot be s
ent between threads safely
    |
    = help: within `libzetta::zfs::Error`, the trait `Send` is not implemented for `*mut n
vpair_sys::nvlist`
    = note: required because it appears within the type `libnv::nvpair::NvList`
    = note: required because it appears within the type `libzetta::zfs::Error`
    = note: required because of the requirements on the impl of `From<libzetta::zfs::Error
>` for `anyhow::Error`
    = note: required because of the requirements on the impl of `FromResidual<Result<Infal
lible, libzetta::zfs::Error>>` for `Result<String, anyhow::Error>`

because MultiOpError(err: NvList) contains raw pointers inside the NvList.

Describe the solution you'd like
Convert the nvlist to a Rust value… I'm looking into that

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.