Skip to content

Commit

Permalink
[antlir2] import sendstream_parser crate
Browse files Browse the repository at this point in the history
Summary:
I wrote this upstream, now I need to actually use it in antlir2.

I'm re-homing this crate here and will publish future revisions from the
antlir2 github repository and will archive my own copy.

Test Plan:
```
❯ buck2 test fbcode//antlir/antlir2/sendstream_parser/...
Buck UI: https://www.internalfb.com/buck2/bcf62163-969c-4806-9d97-511de66fd1ab
Test UI: https://www.internalfb.com/intern/testinfra/testrun/14636698802964271
Note:    Using experimental modern dice
Network: Up: 2.9KiB  Down: 5.7KiB  (reSessionID-52f3c095-f2e3-41fe-a37e-2ad379a55a43)
Jobs completed: 767. Time elapsed: 8.8s.
Cache hits: 0%. Commands: 2 (cached: 0, remote: 0, local: 2)
Tests finished: Pass 3. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D52049042

fbshipit-source-id: aa414ab61cfd4ab8a036669cc1c8e709e2953409
  • Loading branch information
vmagro authored and facebook-github-bot committed Jan 9, 2024
1 parent e1853fe commit 8e5b4f4
Show file tree
Hide file tree
Showing 11 changed files with 1,792 additions and 0 deletions.
28 changes: 28 additions & 0 deletions antlir/antlir2/sendstream_parser/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("//antlir/bzl:build_defs.bzl", "rust_library")

oncall("antlir")

rust_library(
name = "sendstream_parser",
srcs = glob(["src/**/*.rs"]),
autocargo = {
"cargo_target_config": {
"test": True,
},
},
features = ["serde"],
test_deps = [
"similar-asserts",
],
test_features = ["serde"],
test_srcs = glob(["testdata/*"]),
deps = [
"derive_more",
"hex",
"nix",
"nom",
"serde",
"thiserror",
"uuid",
],
)
32 changes: 32 additions & 0 deletions antlir/antlir2/sendstream_parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# @generated by autocargo from //antlir/antlir2/sendstream_parser:[sendstream_parser,sendstream_parser-unittest]

[package]
name = "sendstream_parser"
version = "0.0.0"
edition = "2021"
repository = "https://github.com/facebookincubator/antlir"
license = "MIT"

[lib]
doctest = false

[[test]]
name = "sendstream_parser"
path = "src/lib.rs"

[dependencies]
derive_more = "0.99.17"
hex = "0.4.3"
nix = "0.25"
nom = "7.1"
serde = { version = "1.0.185", features = ["derive", "rc"], optional = true }
thiserror = "1.0.49"
uuid = { version = "1.2", features = ["serde", "v4", "v5", "v6", "v7", "v8"] }

[dev-dependencies]
serde = { version = "1.0.185", features = ["derive", "rc"] }
similar-asserts = "1.4.2"

[features]
default = ["serde", "serde"]
serde = []
12 changes: 12 additions & 0 deletions antlir/antlir2/sendstream_parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[![Workflow Status](https://github.com/vmagro/sendstream_utils/actions/workflows/main.yml/badge.svg)](https://github.com/vmagro/sendstream_utils/actions)
[![docs.rs](https://img.shields.io/docsrs/sendstream_parser)](https://docs.rs/sendstream_parser)
![Maintenance](https://img.shields.io/badge/maintenance-experimental-blue.svg)

# sendstream_parser

Rust parser for [BTRFS
Sendstreams](https://btrfs.readthedocs.io/en/latest/Send-receive.html)
which are created via
[btrfs-send](https://btrfs.readthedocs.io/en/latest/btrfs-send.html).

License: MIT
Loading

0 comments on commit 8e5b4f4

Please sign in to comment.