From 83c1546b9ad7c85dba30cb033b31e844e2401e68 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 28 May 2023 09:22:08 +0200 Subject: chore(tvix/store): add fuse feature This brings in fuse (via the `fuser` crate), and adds pkg-config and libfuse to the dev shell, so `cargo build` can link against it. Change-Id: I0d11607490e27d946bdf92b0b9e45f9ab644ba74 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8664 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/Cargo.lock | 69 ++++++++++++++++- tvix/Cargo.nix | 209 ++++++++++++++++++++++++++++++++++++++++++++++++-- tvix/cli/Cargo.toml | 2 +- tvix/default.nix | 15 +++- tvix/store/Cargo.toml | 11 ++- 5 files changed, 295 insertions(+), 11 deletions(-) (limited to 'tvix') diff --git a/tvix/Cargo.lock b/tvix/Cargo.lock index 4716e0e66067..dbc572b01aa7 100644 --- a/tvix/Cargo.lock +++ b/tvix/Cargo.lock @@ -740,6 +740,22 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +[[package]] +name = "fuser" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5910691a0ececcc6eba8bb14029025c2d123e96a53db1533f6a4602861a5aaf7" +dependencies = [ + "libc", + "log", + "memchr", + "page_size", + "pkg-config", + "smallvec", + "users", + "zerocopy", +] + [[package]] name = "futures" version = "0.3.28" @@ -1197,9 +1213,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.143" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libm" @@ -1399,6 +1415,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "page_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -1478,6 +1504,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + [[package]] name = "plotters" version = "0.3.4" @@ -2703,8 +2735,10 @@ dependencies = [ "clap 4.2.7", "count-write", "data-encoding", + "fuser", "futures", "lazy_static", + "libc", "nix-compat", "prost", "prost-build", @@ -2766,6 +2800,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +[[package]] +name = "users" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" +dependencies = [ + "libc", + "log", +] + [[package]] name = "utf8parse" version = "0.2.1" @@ -3074,6 +3118,27 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zerocopy" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f188cc1bcf1fe1064b8c58d150f497e697f49774aa846f2dc949d9a25f236" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6505e6815af7de1746a08f69c69606bb45695a17149517680f3b2149713b19a3" +dependencies = [ + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", +] + [[package]] name = "zstd" version = "0.9.2+zstd.1.5.1" diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index 332c2834f809..30a845dd9c05 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -2047,6 +2047,82 @@ rec { ]; }; + "fuser" = rec { + crateName = "fuser"; + version = "0.12.0"; + edition = "2018"; + sha256 = "1xxalmhjhq54yqribnskdblj7lf24n80455vm3mwdk6f1qd6j42r"; + authors = [ + "Christopher Berner " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "memchr"; + packageId = "memchr"; + } + { + name = "page_size"; + packageId = "page_size"; + } + { + name = "smallvec"; + packageId = "smallvec"; + } + { + name = "users"; + packageId = "users"; + } + { + name = "zerocopy"; + packageId = "zerocopy"; + } + ]; + buildDependencies = [ + { + name = "pkg-config"; + packageId = "pkg-config"; + optional = true; + } + ]; + features = { + "abi-7-10" = [ "abi-7-9" ]; + "abi-7-11" = [ "abi-7-10" ]; + "abi-7-12" = [ "abi-7-11" ]; + "abi-7-13" = [ "abi-7-12" ]; + "abi-7-14" = [ "abi-7-13" ]; + "abi-7-15" = [ "abi-7-14" ]; + "abi-7-16" = [ "abi-7-15" ]; + "abi-7-17" = [ "abi-7-16" ]; + "abi-7-18" = [ "abi-7-17" ]; + "abi-7-19" = [ "abi-7-18" ]; + "abi-7-20" = [ "abi-7-19" ]; + "abi-7-21" = [ "abi-7-20" ]; + "abi-7-22" = [ "abi-7-21" ]; + "abi-7-23" = [ "abi-7-22" ]; + "abi-7-24" = [ "abi-7-23" ]; + "abi-7-25" = [ "abi-7-24" ]; + "abi-7-26" = [ "abi-7-25" ]; + "abi-7-27" = [ "abi-7-26" ]; + "abi-7-28" = [ "abi-7-27" ]; + "abi-7-29" = [ "abi-7-28" ]; + "abi-7-30" = [ "abi-7-29" ]; + "abi-7-31" = [ "abi-7-30" ]; + "default" = [ "libfuse" ]; + "libfuse" = [ "pkg-config" ]; + "pkg-config" = [ "dep:pkg-config" ]; + "serde" = [ "dep:serde" ]; + "serializable" = [ "serde" ]; + }; + resolvedDefaultFeatures = [ "default" "libfuse" "pkg-config" ]; + }; "futures" = rec { crateName = "futures"; version = "0.3.28"; @@ -3408,9 +3484,9 @@ rec { }; "libc" = rec { crateName = "libc"; - version = "0.2.143"; + version = "0.2.144"; edition = "2015"; - sha256 = "0940zabsl3gm2jr03mg2ign4rnakdd4rp5hfhjzddic57s4hghpd"; + sha256 = "1qfzrwhncsradwvdzd8vsj4mc31fh0rb5rvny3884rwa48fcq01b"; authors = [ "The Rust Project Developers" ]; @@ -3952,6 +4028,32 @@ rec { ]; }; + "page_size" = rec { + crateName = "page_size"; + version = "0.4.2"; + edition = "2015"; + sha256 = "1kgdv7f626jy4i2pq8czp4ppady4g4kqfa5ik4dah7mzzd4fbggf"; + authors = [ + "Philip Woods " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (target."unix" or false); + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: (target."windows" or false); + features = [ "sysinfoapi" ]; + } + ]; + features = { + "no_std" = [ "spin" ]; + "spin" = [ "dep:spin" ]; + }; + }; "parking_lot" = rec { crateName = "parking_lot"; version = "0.11.2"; @@ -4136,6 +4238,16 @@ rec { "Josef Brandl " ]; + }; + "pkg-config" = rec { + crateName = "pkg-config"; + version = "0.3.27"; + edition = "2015"; + sha256 = "0r39ryh1magcq4cz5g9x88jllsnxnhcqr753islvyk4jp9h2h1r6"; + authors = [ + "Alex Crichton " + ]; + }; "plotters" = rec { crateName = "plotters"; @@ -8016,6 +8128,11 @@ rec { name = "data-encoding"; packageId = "data-encoding"; } + { + name = "fuser"; + packageId = "fuser"; + optional = true; + } { name = "futures"; packageId = "futures"; @@ -8024,6 +8141,11 @@ rec { name = "lazy_static"; packageId = "lazy_static"; } + { + name = "libc"; + packageId = "libc"; + optional = true; + } { name = "nix-compat"; packageId = "nix-compat"; @@ -8127,11 +8249,12 @@ rec { } ]; features = { - "default" = [ "reflection" ]; + "default" = [ "fuse" "reflection" ]; + "fuse" = [ "dep:fuser" "dep:libc" ]; "reflection" = [ "tonic-reflection" ]; "tonic-reflection" = [ "dep:tonic-reflection" ]; }; - resolvedDefaultFeatures = [ "default" "reflection" "tonic-reflection" ]; + resolvedDefaultFeatures = [ "default" "fuse" "reflection" "tonic-reflection" ]; }; "typenum" = rec { crateName = "typenum"; @@ -8205,6 +8328,33 @@ rec { features = { }; resolvedDefaultFeatures = [ "default" ]; }; + "users" = rec { + crateName = "users"; + version = "0.11.0"; + edition = "2015"; + sha256 = "0cmhafhhka2yya66yrprlv33kg7rm1xh1pyalbjp6yr6dxnhzk14"; + authors = [ + "Benjamin Sago " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + } + { + name = "log"; + packageId = "log"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "cache" "mock" "logging" ]; + "log" = [ "dep:log" ]; + "logging" = [ "log" ]; + }; + resolvedDefaultFeatures = [ "cache" "default" "log" "logging" "mock" ]; + }; "utf8parse" = rec { crateName = "utf8parse"; version = "0.2.1"; @@ -8969,7 +9119,7 @@ rec { features = { "debug" = [ "impl-debug" ]; }; - resolvedDefaultFeatures = [ "basetsd" "consoleapi" "errhandlingapi" "fileapi" "handleapi" "knownfolders" "minwinbase" "minwindef" "ntsecapi" "ntstatus" "objbase" "processenv" "processthreadsapi" "profileapi" "shellapi" "shlobj" "std" "stringapiset" "synchapi" "winbase" "wincon" "winerror" "winnt" "winuser" "ws2ipdef" "ws2tcpip" ]; + resolvedDefaultFeatures = [ "basetsd" "consoleapi" "errhandlingapi" "fileapi" "handleapi" "knownfolders" "minwinbase" "minwindef" "ntsecapi" "ntstatus" "objbase" "processenv" "processthreadsapi" "profileapi" "shellapi" "shlobj" "std" "stringapiset" "synchapi" "sysinfoapi" "winbase" "wincon" "winerror" "winnt" "winuser" "ws2ipdef" "ws2tcpip" ]; }; "winapi-i686-pc-windows-gnu" = rec { crateName = "winapi-i686-pc-windows-gnu"; @@ -9883,6 +10033,55 @@ rec { "Sergio Benitez " ]; + }; + "zerocopy" = rec { + crateName = "zerocopy"; + version = "0.6.1"; + edition = "2018"; + sha256 = "0dpj4nd9v56wy93ahjkp95znjzj91waqvidqch8gxwdwq661hbrk"; + authors = [ + "Joshua Liebow-Feeser " + ]; + dependencies = [ + { + name = "byteorder"; + packageId = "byteorder"; + usesDefaultFeatures = false; + } + { + name = "zerocopy-derive"; + packageId = "zerocopy-derive"; + } + ]; + features = { + "simd-nightly" = [ "simd" ]; + }; + }; + "zerocopy-derive" = rec { + crateName = "zerocopy-derive"; + version = "0.3.2"; + edition = "2018"; + sha256 = "18qr7dqlj89v1xl1g58l2xd6jidv0sbccscgl131gpppba0yc1b5"; + procMacro = true; + authors = [ + "Joshua Liebow-Feeser " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2 1.0.56"; + } + { + name = "quote"; + packageId = "quote 1.0.26"; + } + { + name = "syn"; + packageId = "syn 1.0.109"; + features = [ "visit" ]; + } + ]; + }; "zstd" = rec { crateName = "zstd"; diff --git a/tvix/cli/Cargo.toml b/tvix/cli/Cargo.toml index 676da02a07a2..de73fd6b3ea1 100644 --- a/tvix/cli/Cargo.toml +++ b/tvix/cli/Cargo.toml @@ -9,7 +9,7 @@ path = "src/main.rs" [dependencies] nix-compat = { path = "../nix-compat" } -tvix-store = { path = "../store" } +tvix-store = { path = "../store", features = []} tvix-eval = { path = "../eval" } rustyline = "10.0.0" clap = { version = "4.0", features = ["derive", "env"] } diff --git a/tvix/default.nix b/tvix/default.nix index ef0e2386db0b..c6ac87528765 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -22,6 +22,11 @@ in nixpkgs = pkgs.path; defaultCrateOverrides = pkgs.defaultCrateOverrides // { + fuser = prev: { + buildInputs = prev.buildInputs or [ ] ++ [ pkgs.fuse ]; + nativeBuildInputs = prev.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ]; + }; + prost-build = prev: { nativeBuildInputs = protobufDep prev; }; @@ -56,6 +61,8 @@ in pkgs.cargo pkgs.clippy pkgs.evans + pkgs.fuse + pkgs.pkg-config pkgs.rust-analyzer pkgs.rustc pkgs.rustfmt @@ -72,12 +79,16 @@ in src = depot.third_party.gitignoreSource ./.; PROTO_ROOT = depot.tvix.store.protos; + buildInputs = [ + pkgs.fuse + ]; nativeBuildInputs = with pkgs; [ cargo + pkg-config + protobuf rust-analyzer - rustPlatform.cargoSetupHook rustc - protobuf + rustPlatform.cargoSetupHook ]; buildPhase = '' diff --git a/tvix/store/Cargo.toml b/tvix/store/Cargo.toml index a88bdefd7aac..3b2765f99281 100644 --- a/tvix/store/Cargo.toml +++ b/tvix/store/Cargo.toml @@ -30,10 +30,18 @@ bytes = "1.4.0" smol_str = "0.2.0" serde_json = "1.0" +[dependencies.fuser] +optional = true +version = "0.12.0" + [dependencies.tonic-reflection] optional = true version = "0.5.0" +[dependencies.libc] +optional = true +version = "0.2.144" + [build-dependencies] prost-build = "0.11.2" tonic-build = "0.8.2" @@ -44,5 +52,6 @@ tempfile = "3.3.0" tonic-mock = { git = "https://github.com/brainrake/tonic-mock", branch = "bump-dependencies" } [features] -default = ["reflection"] +default = ["fuse", "reflection"] +fuse = ["dep:fuser", "dep:libc"] reflection = ["tonic-reflection"] -- cgit 1.4.1