Skip to content

to_toml test in auditable-serde writes outside the build directory #82

@alexanderkjall

Description

@alexanderkjall

Hi

I'm investigating if this could simplify the tracking of relationship between rust binaries and vulnerable versions of rust libraries in Debian, and as part of that investigation I started by seeing how easy it would be to package this with the Debian tooling.

I noticed that the to_toml test in auditable-serde fails due to that it tries to write a lock file into Debians crate registry directory and became a bit afraid that the project might be dead in the water due to that it needs to write those lock files during normal operations also, and not just for that unit test.

I realize that you don't control the cargo_metadata crate, but I thought that it might be worth asking here if this is a use case for auditable that you are interested in supporting?

Complete test output below for context:

---- tests::to_toml stdout ----
thread 'tests::to_toml' panicked at 'called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "error: failed to write /usr/share/cargo/registry/auditable-serde-0.5.2/Cargo.lock\n\nCaused by:\n  failed to open: /usr/share/cargo/registry/auditable-serde-0.5.2/Cargo.lock\n\nCaused by:\n  Permission denied (os error 13)\n" }', src/lib.rs:506:20
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.62.1/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.62.1/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /usr/src/rustc-1.62.1/library/core/src/result.rs:1785:5
   3: core::result::Result<T,E>::unwrap
             at /usr/src/rustc-1.62.1/library/core/src/result.rs:1078:23
   4: auditable_serde::tests::load_own_metadata
             at ./src/lib.rs:506:9
   5: auditable_serde::tests::to_toml
             at ./src/lib.rs:513:24
   6: auditable_serde::tests::to_toml::{{closure}}
             at ./src/lib.rs:512:5
   7: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.62.1/library/core/src/ops/function.rs:248:5
   8: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.62.1/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    third partyWork item for a third-party dependency

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions