2021-02-02 02:33:55 +03:00
# Explicitly create a workspace since we have libdnf-sys as a path
# dependency, and in the future we may use other sub-crates.
[ workspace ]
2018-05-31 23:31:22 +03:00
[ package ]
2018-07-04 21:50:40 +03:00
name = "rpmostree-rust"
2018-05-31 23:31:22 +03:00
version = "0.1.0"
2018-10-05 19:57:00 +03:00
authors = [ "Colin Walters <walters@verbum.org>" , "Jonathan Lebon <jonathan@jlebon.com>" ]
2019-04-14 21:54:32 +03:00
edition = "2018"
2021-01-29 20:54:07 +03:00
# See https://rust-lang.github.io/rfcs/2495-min-rust-version.html
# Usually, we try to keep this to no newer than current RHEL8 rust-toolset version.
# You can find the current versions from here:
# https://access.redhat.com/documentation/en-us/red_hat_developer_tools/1/
# However, right now we are bumping to 1.48 so we can use https://cxx.rs
#rust = "1.48"
2021-01-23 18:32:05 +03:00
links = "rpmostreeinternals"
# This currently needs to duplicate the libraries in configure.ac
# until we unify on Cargo as our build system
[ package . metadata . system-deps ]
jsonglib = { name = "json-glib-1.0" , version = "1" }
2021-03-01 18:21:22 +03:00
libarchive = "3.0"
libcurl = "7"
2021-01-23 18:32:05 +03:00
polkitgobject = { name = "polkit-gobject-1" , version = "0" }
rpm = "4"
2018-05-31 23:31:22 +03:00
[ dependencies ]
2021-01-25 12:18:15 +03:00
anyhow = "1.0.38"
2021-03-01 18:21:22 +03:00
c_utf8 = "0.1.0"
chrono = { version = "0.4.19" , features = [ "serde" ] }
2020-10-19 17:58:26 +03:00
clap = "2.33.3"
2021-03-15 09:51:50 +03:00
curl = "0.4.35"
2021-03-01 18:21:22 +03:00
cxx = "1.0.32"
envsubst = "0.2.0"
2021-03-09 22:01:35 +03:00
fn-error-context = "0.1.1"
2021-03-01 18:21:22 +03:00
gio = "0.9.1"
gio-sys = "0.10.1"
2021-03-02 21:20:22 +03:00
gobject-sys = "0.10.0"
2021-03-01 18:21:22 +03:00
glib = "0.10.3"
glib-sys = "0.10.1"
2020-06-15 12:31:43 +03:00
indicatif = "0.15.0"
2020-10-19 17:58:26 +03:00
lazy_static = "1.4.0"
2021-03-05 22:45:42 +03:00
libc = "0.2.88"
2020-12-08 21:29:05 +03:00
libdnf-sys = { path = "rust/libdnf-sys" , version = "0.1.0" }
2021-03-01 18:22:36 +03:00
maplit = "1.0"
2021-02-17 03:31:25 +03:00
memfd = "0.4.0"
2021-03-01 18:21:22 +03:00
nix = "0.20.0"
openat = "0.1.19"
2021-03-05 19:45:34 +03:00
openat-ext = "^0.1.13"
2020-10-13 18:46:00 +03:00
os-release = "0.1.0"
2021-03-01 18:21:22 +03:00
ostree = { version = "0.9.1" , features = [ "v2020_4" ] }
ostree-sys = "0.7.1"
paste = "1.0"
phf = { version = "0.8" , features = [ "macros" ] }
rand = "0.8.3"
rayon = "1.5.0"
2021-02-12 21:47:36 +03:00
rpmostree-client = { path = "rust/rpmostree-client" , version = "0.1.0" }
2021-03-01 18:21:22 +03:00
rust-ini = "0.16.1"
2021-03-08 09:49:39 +03:00
serde = { version = "1.0.124" , features = [ "derive" ] }
2021-03-01 18:21:22 +03:00
serde_derive = "1.0.118"
serde_json = "1.0.64"
serde_yaml = "0.8.17"
structopt = "0.3.21"
subprocess = "0.2.6"
systemd = "0.8.2"
tempfile = "3.2.0"
2018-05-31 23:31:22 +03:00
2020-12-31 19:55:19 +03:00
[ build-dependencies ]
2021-03-01 18:21:22 +03:00
anyhow = "1.0"
2021-02-18 02:21:53 +03:00
system-deps = "3.0"
2020-12-31 19:55:19 +03:00
2018-05-31 23:31:22 +03:00
[ lib ]
2018-07-04 21:50:40 +03:00
name = "rpmostree_rust"
2020-12-08 21:29:05 +03:00
path = "rust/src/lib.rs"
2021-01-26 14:34:59 +03:00
[ [ bin ] ]
name = "rpm-ostree"
path = "rust/src/main.rs"
2018-05-31 23:31:22 +03:00
[ profile . release ]
2018-11-05 18:50:24 +03:00
# Unwinding across FFI boundaries is undefined behavior, and anyways, we're
# [crash-only](https://en.wikipedia.org/wiki/Crash-only_software)
2018-05-31 23:31:22 +03:00
panic = "abort"
2018-11-05 18:50:24 +03:00
# We assume we're being delivered via e.g. RPM which supports split debuginfo
2018-09-10 20:50:24 +03:00
debug = true
2020-10-28 23:06:26 +03:00
# We need this to avoid leaking symbols, see
# https://internals.rust-lang.org/t/rust-staticlibs-and-optimizing-for-size/5746
lto = true
2020-12-22 01:27:52 +03:00
[ features ]
sqlite-rpmdb-default = [ ]
2020-12-28 17:16:32 +03:00
fedora-integration = [ ]
Add --enable-sanitizers (not on by default yet)
This way we at least get unit test coverage (which...
our unit test coverage doesn't do much because our
main code paths require privileges or virt).
One main blocker to this is that rustc doesn't expose
first-class support for this yet:
https://github.com/rust-lang/rust/issues/39699
At a practical level this works when building in release
mode but fails with `cargo test` for some reason; linker
arguments being pruned? Not sure.
So I was able to use this when composing to find a bug,
but then for some other reason the client
side apparently infinite loops inside libsolv.
So we're not enabling this yet for those reasons, but
let's land the build infrastructure now.
```
(lldb) thread backtrace
* thread #4, name = 'pool-/usr/bin/r'
* frame #0: 0x00007fd61b97200f libc.so.6`__memcpy_sse2_unaligned_erms + 623
frame #1: 0x00007fd61cbc88e6 libasan.so.6`__asan::asan_realloc(void*, unsigned long, __sanitizer::BufferedStackTrace*) + 214
frame #2: 0x00007fd61cc4b725 libasan.so.6`__interceptor_realloc + 245
frame #3: 0x00007fd61baec43e libsolv.so.1`solv_realloc + 30
frame #4: 0x00007fd61baf0414 libsolv.so.1`repodata_add_dirstr + 276
frame #5: 0x00007fd61bb6f755 libsolvext.so.1`end_element + 53
frame #6: 0x00007fd61b05855d libxml2.so.2`xmlParseEndTag1.constprop.0 + 317
frame #7: 0x00007fd61b063548 libxml2.so.2`xmlParseTryOrFinish.isra.0 + 888
frame #8: 0x00007fd61af7ed20 libxml2.so.2`xmlParseChunk + 560
frame #9: 0x00007fd61bb727e7 libsolvext.so.1`solv_xmlparser_parse + 183
frame #10: 0x00007fd61bb5ea0e libsolvext.so.1`repo_add_rpmmd + 254
frame #11: 0x000055a4fce7a5f5 rpm-ostree`::load_filelists_cb(repo=<unavailable>, fp=<unavailable>) at dnf-sack.cpp:444:23
frame #12: 0x000055a4fce7cad6 rpm-ostree`load_ext(_DnfSack*, libdnf::Repo*, _hy_repo_repodata, char const*, char const*, int (*)(s_Repo*, _IO_FILE*), _GError**) at dnf-sack.cpp:430:13
frame #13: 0x000055a4fce7df60 rpm-ostree`dnf_sack_load_repo at dnf-sack.cpp:1789:26
frame #14: 0x000055a4fce7eee9 rpm-ostree`dnf_sack_add_repo at dnf-sack.cpp:2217:28
frame #15: 0x000055a4fce7f0fb rpm-ostree`dnf_sack_add_repos at dnf-sack.cpp:2271:32
frame #16: 0x000055a4fce870ee rpm-ostree`dnf_context_setup_sack_with_flags at dnf-context.cpp:1796:29
frame #17: 0x000055a4fcdf757f rpm-ostree`rpmostree_context_download_metadata at rpmostree-core.cxx:1206:44
frame #18: 0x000055a4fcdf95c3 rpm-ostree`rpmostree_context_prepare at rpmostree-core.cxx:2001:48
frame #19: 0x000055a4fce54ab7 rpm-ostree`rpmostree_sysroot_upgrader_prep_layering at rpmostree-sysroot-upgrader.cxx:1018:38
frame #20: 0x000055a4fcdcb143 rpm-ostree`deploy_transaction_execute(_RpmostreedTransaction*, _GCancellable*, _GError**) at rpmostreed-transaction-types.cxx:1445:49
frame #21: 0x000055a4fcdba4cd rpm-ostree`transaction_execute_thread(_GTask*, void*, void*, _GCancellable*) at rpmostreed-transaction.cxx:340:34
frame #22: 0x00007fd61c58f7e2 libgio-2.0.so.0`g_task_thread_pool_thread + 114
frame #23: 0x00007fd61c3d7e54 libglib-2.0.so.0`g_thread_pool_thread_proxy.lto_priv.0 + 116
frame #24: 0x00007fd61c3d52b2 libglib-2.0.so.0`g_thread_proxy + 82
frame #25: 0x00007fd61b8af3f9 libpthread.so.0`start_thread + 233
frame #26: 0x00007fd61b9c9903 libc.so.6`__clone + 67
(lldb)
```
2021-02-03 00:54:38 +03:00
# ASAN+UBSAN
sanitizers = [ ]
2020-12-22 01:27:52 +03:00
default = [ ]