about summary refs log tree commit diff
path: root/tvix/default.nix
AgeCommit message (Collapse)AuthorFilesLines
2023-12-09 r/7141 feat(tvix): make clippy stricterFlorian Klink1-1/+1
Also run clippy on tests, and enable all features. Change-Id: Ide9f1bc9f565333072afb918c391c7930b658f41 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10234 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-12-07 r/7125 feat(tvix): run crate2nix generate in CIAdam Joseph1-5/+57
This runs `crate2nix generate` in CI and then runs `depotfmt` on the result to ensure that our machine-generated code is really, really readable and pretty. Then it checks that the result of all that is identical to the committed Cargo.nix. A self-hashing FOD is used to allow network access. No magic hashes are involved. Co-Authored-By: Florian Klink <flokli@flokli.de> Change-Id: I68ec5003dbc6a40894a5a4d6e902f138c99f6719 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10194 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-12-05 r/7118 refactor(tvix): move src into let bindingFlorian Klink1-4/+6
Change-Id: Ida2a3ac722fb2445745759323975884dfeef3e87 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10193 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2023-11-19 r/7032 fix(tvix): patch futures::AsyncBufReadExt::fill_bufedef1-0/+9
This fixes EOF handling for buffered readers. Link: https://github.com/rust-lang/futures-rs/pull/2801 Change-Id: Ie98ca6a3e1de38500b0195e9b62511501acb1d2c Reviewed-on: https://cl.tvl.fyi/c/depot/+/10086 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-11-05 r/6960 feat(tvix): add clippy target in CIFlorian Klink1-0/+24
This will invoke `cargo clippy` on the codebase, ensuring we spot things early on. Relates to b/321. Change-Id: Ifba13e5bef995d33b24346c6cee134e84d6566c4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9106 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2023-10-17 r/6846 chore(tvix): move regenerate scripts to passthruFlorian Klink1-10/+0
This keeps things isolated a bit more. Change-Id: I437f2f63ee1567c0cbc02298514ad4d89f1dce85 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9790 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-10-17 r/6844 chore(tvix): move store golang bindings to tvix/store-goFlorian Klink1-7/+4
Similar to the castore-go CL before, this also updates the store-go bindings to the new layout. Change-Id: Id73d7ad43f7d70171ab021728e303300c5db71f0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9788 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-10-17 r/6843 chore(tvix): move castore golang bindings to tvix/castore-goFlorian Klink1-7/+4
Have `tvix/castore/protos` only contain the protos, no go noise. Make the `.pb.go` file generation a pure Nix build at `//tvix/castore/protos:go-bindings`, and have a script at `//tvix:castore-go-generate` (TBD) that copies the results to `tvix/castore-go`. `//tvix:castore-go`, with sources in `tvix/castore-go` now contains the tooling around the generated bindings, and the generated bindings themselves (So go mod replace workflows still work). An additional CI step is added from there to ensure idempotenty of the .pb.go files. The code.tvl.fyi webserver config is updated to the new source code path. I'm still unsure if we want to also update the go.mod name. While being a backwards-incompatible change, it'll probbaly make it easier where to find these files, and the amount of external consumers is still low enough. Part of b/323. Change-Id: I2edadd118c22ec08e57c693f6cc2ef3261c62489 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9787 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-10-16 r/6839 fix(tvix/cli): don't use protobuf from pkgs, but pkgs.buildPackagesFlorian Klink1-1/+1
We need to invoke protoc at build time (only). Change-Id: Ib4c101d2ccdbdbb078725fc98c30d6c00086667d Reviewed-on: https://cl.tvl.fyi/c/depot/+/9754 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-10-16 r/6838 fix(tvix): fix binary building on DarwinFlorian Klink1-0/+8
On Darwin, some crates producing binaries need to be able to link against security. Change-Id: I5bdd69247c12729b9efd5c4f18527d361ef99e87 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9758 Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-10-16 r/6837 refactor(tvix): push rarely-used darwin-specific hacks downFlorian Klink1-8/+10
Also, make some of them buildInputs, not nativeBuildInputs. We likely need to link against libiconv, so it shouldn't be a native build input. Change-Id: I757bc7f5d8c864ecaa3db26988d00b496c085c8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/9757 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
2023-10-14 r/6806 feat(tvix/store/protos): use Validate() function on root nodeFlorian Klink1-1/+1
This updates the code to make use of the new Validate() function defined on a Node. Change-Id: I9b6ed694661f41e700f19cc78d53d2224b61852d Reviewed-on: https://cl.tvl.fyi/c/depot/+/9718 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2023-10-10 r/6772 feat(tvix/store/protos): add ExportFlorian Klink1-1/+1
Export will traverse a given PathInfo structure, and write the contents in NAR format to the passed Writer. It uses directoryLookupFn and blobLookupFn to resolve references. This is being moved over from nar-bridge. We need to keep the code there around until we can bump go.mod to storev1 with this merged, but the tests can already be moved entirely. Change-Id: Ie0de3077b09344cafa00ff1e2ddb8b52e9e631bc Reviewed-on: https://cl.tvl.fyi/c/depot/+/9602 Tested-by: BuildkiteCI Reviewed-by: Brian McGee <brian@bmcgee.ie> Autosubmit: flokli <flokli@flokli.de>
2023-10-09 r/6761 chore(tvix/*store): use google.golang.org/protobufFlorian Klink1-2/+2
The other one is deprecated, according to https://pkg.go.dev/github.com/golang/protobuf/proto. Change-Id: I502d5bfa7431df0dea3d564f1e0ecfea14c90e10 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9597 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Brian McGee <brian@bmcgee.ie>
2023-10-09 r/6758 feat(tvix/nar-bridge): add ToNixNarInfo()Florian Klink1-1/+1
Convenience function, moves all code converting from a PathInfo struct to to go-nix's NarInfo. Change-Id: Idf0dcc38675674563f2dfd3286a4a55fa2a24a82 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9593 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Brian McGee <brian@bmcgee.ie>
2023-10-09 r/6757 test(tvix/store/protos): add go tests for Validate()Florian Klink1-1/+1
We already have validation tests for Rust, let's add the missing ones for golang too. Change-Id: Iaf3a3e1ee72d5647da3f2aa977d6e0d0379b2ce5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9595 Reviewed-by: Brian McGee <brian@bmcgee.ie> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-10-09 r/6756 fix(tvix/castore-protos-go): fix srcFlorian Klink1-2/+2
This was unfortunately using ./castore/protos all the time, so not testing castore at all. Update src to make sure it does get built. Change-Id: I563910c259ffca6aee7f964532bd39c4bcf7aed8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9596 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Brian McGee <brian@bmcgee.ie> Tested-by: BuildkiteCI
2023-10-08 r/6735 refactor(tvix/castore): move tests to grpc client, rm tonic-mockFlorian Klink1-1/+0
Similar to gen_directorysvc_grpc_client, introduce a gen_blobsvc_grpc_client function that provides a gRPC client connected to a blobservice. The test is update to use that client to test against, rather than the server trait, removing the last usage of tonic_mock, so it's removed as well. Fixes b/243. Change-Id: If746e8600588da247eb53a63b70fe72f139e9e77 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9564 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
2023-10-07 r/6721 refactor(tvix,views/tvix): move shell into separate fileFlorian Klink1-16/+3
So far, we provided a custom `default.nix` in the root of the tvix josh workspace, which re-defined the shell attribute from `tvix/default.nix`. Some of the recent fixes, e.g. the MacOS-specific additions to the list of dependencies however didn't get ported over to this file, and in general, it's quite annoying to have two different places for these things. Initially I explored the idea of moving this default.nix file to a default-depot.nix file in the josh worktree only, and then "polyfill" some of the dependencies, or set up readTree in the josh workspace too, but it turned out to pull in too many dependencies to be worth the effort (nix.sparseTree, tools.depotfmt, crate2nix overlay, third_party.gitignoreSource). I now took a different approach - moving the definition of the `shell` attribute from `tvix/default.nix` to its own `shell.nix` file, which is imported from `tvix/default.nix` in regular depot usecases. Josh workspace consumers only see the `shell.nix`, which can be used in a self-contained fashion, the other `default.nix` is gone entirely, and we update the workspace file to also not show `tvix/default.nix` at the root either, so running `nix-shell` and then `cargo build` should still work. Change-Id: I6cb54d45d150c597612530ba44bc578f9d7f9120 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9556 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
2023-10-07 r/6720 fix(tvix/store): Remove virtiofs from default featuresConnor Brewster1-0/+3
vhost-user-backend doesn't support macOS yet, so the virtiofs features will not work on macOS. This removes it as a default feature which makes `cargo build` work out of the box on macOS. The `virtiofs` feature is enabled for Linux when building via Nix, but if being built by cargo directly, the feature must be enabled via a cargo flag. Change-Id: I2aaca9582f8e3dbcf9ee5f1b9831d614909f3799 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9555 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: Connor Brewster <cbrewster@hey.com>
2023-10-05 r/6712 feat(tvix/store/protos): add Validate() method to pathinfo.goFlorian Klink1-2/+2
This is very similar to the Rust counterpart. Change-Id: I40d51aaac3fcf7f52e5896587e561bc2377f6269 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9549 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-09-26 r/6657 chore(third_party/crate2nix): bump crate2nix to current HEADFlorian Klink1-1/+1
This will bring conditional features support. Also invoke crate2nixgenerate with the --all-features argument, so all dependencies, including the ones for optional features are included in the Cargo.nix file. Change-Id: I3bbcb200c9b481f660db89efba650ea4f7418a63 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9470 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-09-22 r/6632 chore(tvix): re-enable {ca,}store-protos-goFlorian Klink1-12/+12
This couldn't be enabled before until go get was able to fetch the modules again. Change-Id: I82db7d22e497661ea2a0c8a45c0c865fcc0a1f18 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9406 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-22 r/6629 refactor(tvix): move castore into tvix-castore crateFlorian Klink1-9/+25
This splits the pure content-addressed layers from tvix-store into a `castore` crate, and only leaves PathInfo related things, as well as the CLI entrypoint in the tvix-store crate. Notable changes: - `fixtures` and `utils` had to be moved out of the `test` cfg, so they can be imported from tvix-store. - Some ad-hoc fixtures in the test were moved to proper fixtures in the same step. - The protos are now created by a (more static) recipe in the protos/ directory. The (now two) golang targets are commented out, as it's not possible to update them properly in the same CL. This will be done by a followup CL once this is merged (and whitby deployed) Bug: https://b.tvl.fyi/issues/301 Change-Id: I8d675d4bf1fb697eb7d479747c1b1e3635718107 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9370 Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-22 r/6626 feat(tvix/shell): add cargo-macheteFlorian Klink1-0/+1
This helps spotting unused crate dependencies. It's preferred over cargo-udeps for the reasons described in https://blog.benj.me/2022/04/27/cargo-machete/ Change-Id: Ie801004485858741f2fa5ae6f33bd0ddfc292cd0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9374 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-20 r/6621 refactor(tvix/store/fuse): Switch from fuser to fuse-backend-rsConnor Brewster1-5/+1
This switches the FUSE implementation from fuser to fuse-backend-rs. fuse-backend-rs is designed to work with both FUSE and virtiofs. Virtiofs support will make it possible to plug the tvix-store into a microvm and have `/nix/store` access without having to setup FUSE inside the guest. Additionally fuse-backend-rs has nice support for running multiple FUSE threads and has some async support. The goal of this commit is to mechanically switch over to fuse-backend-rs with minimal changes. I did have to add some locks here and there because fuse-backend-rs uses `&self` on all methods whereas fuser uses `&mut self`. `&self` is required for concurrent access to the FUSE server, so this makes sense. We can consider switching to concurrent maps and use some other techniques to reduce lock contention and critical section size. Issue: https://b.tvl.fyi/issues/305 Change-Id: Icde5a58c6eef98f8984c1e04e980b756dfb76b47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9341 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-09-11 r/6579 fix(tvix): Get tvix build and shell to work on DarwinBrian Olsen1-2/+19
On Darwin rust crates sometimes needs iconv manually added to compile successfully. There is currently also a bug in strip that requires that you set dontStrip on buildRustCrate for it to work. See: https://github.com/NixOS/nixpkgs/issues/218712 Change-Id: I13555c7bbee1d34f08fc51a668d2067dbbe550ce Reviewed-on: https://cl.tvl.fyi/c/depot/+/9291 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-09-10 r/6576 refactor(tvix): move logo to //tvix:logoFlorian Klink1-0/+10
Also expose both formats, then use it from users/tazjin/presentations/tvix-eval-2023. Change-Id: Id906e8aff5510a7a4f33336326472e86db18ea32 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9280 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2023-09-09 r/6573 feat(tvix/store): add :store-protos-goFlorian Klink1-1/+9
This target builds and runs the go tests in that directory, allowing us to spot regressions as the one fixed in cl/9285. Change-Id: Ia16c0622f29db343eae7c0386e715b292703bd4f Reviewed-on: https://cl.tvl.fyi/c/depot/+/9286 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: Brian McGee <brian@bmcgee.ie> Tested-by: BuildkiteCI
2023-08-20 r/6514 refactor(tvix): assemble cragoDeps outputHashes from Cargo.nixFlorian Klink1-12/+21
We already have these hashes accessible in the Cargo.nix file created by cargo2nix, so there's no need to also manually maintain them here. It removes one potential footgun I ran into while updating wu-manber to a different rev, without updating it here. Change-Id: I93932ac8ba55f83746ee38571b7740af2d49bbdf Reviewed-on: https://cl.tvl.fyi/c/depot/+/9090 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-08-19 r/6493 refactor(tvix): drop rust-analyzer from rust-docs build inputsFlorian Klink1-1/+0
We don't need rust-analyzer to run cargo doc. Change-Id: I5e2fd559e4045cadeab24b438c28d6df7f1d5d5f Reviewed-on: https://cl.tvl.fyi/c/depot/+/9092 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de>
2023-08-19 r/6492 docs(tvix): update commentFlorian Klink1-3/+1
cl/8306 fixed building all docs, but we forgot to update the comment. Change-Id: I17829612f13e7357bd0efe8223cc28ed0f6cdea2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9091 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-07-31 r/6453 refactor(tvix/cli/refscan): use wu-manber crate with &[u8] supportFlorian Klink1-1/+1
PR'ed at https://github.com/tvlfyi/wu-manber/pull/1, and now merged. Change-Id: I8c71e359196396a1d42a3ea2ab7ac15b137b2db0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8992 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-06-10 r/6261 chore(tvix/store): add fuse featureFlorian Klink1-2/+13
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 <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-03-28 r/6052 refactor(views): move view export configuration to //viewsVincent Ambo1-11/+1
Change-Id: I064b996fd52134b7e83541ea1190774c51a8ba30 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8359 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-03-14 r/6007 chore(tvix/store): drop separate bin packageFlorian Klink1-5/+0
Apparently, having multiple packages with the same path is a bad thing: ``` The bin target `tvix-store` in package `tvix-store-bin v0.1.0 (/home/flokli/tvl/tvix/store)` has the same output filename as the lib target `tvix_store` in package `tvix-store-bin v0.1.0 (/home/flokli/tvl/tvix/store)`. Colliding filename is: /home/flokli/tvl/tvix/target/doc/tvix_store/index.html The output filenames should be unique. This is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>. ``` Change-Id: Ic785c0349070783baf5e8fd23f5fb60603a3c995 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8308 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-03-14 r/6006 fix(tvix): build all tvix crate docsFlorian Klink1-1/+3
There's still some shadowing going on, but that's left for a followup CL. Change-Id: I02992f1eb494faca99857a3a5ee4dcd47f1b9fd0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8306 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-03-14 r/6004 feat(tvix): build (some of) our Rust documentation in NixVincent Ambo1-1/+32
This will be published on docs.tvix.dev Change-Id: I348e057351d5295ad20953c9e9a32c257abab089 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8298 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-02-01 r/5818 fix(tvix): add dummy target to attach extra-step toVincent Ambo1-6/+10
Change-Id: I594a6652e2efe7aa6e35c7cdd84fc3097660614f Reviewed-on: https://cl.tvl.fyi/c/depot/+/8009 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su>
2023-02-01 r/5816 chore(tvix): mirror exported repositoryVincent Ambo1-0/+6
Pushes a mirror of tvix to github/tvlfyi/tvix Change-Id: I86e7c1b1dc1fcc1012fa72234588b26ac2554056 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8007 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-06 r/5615 refactor(tvix/store): move protobuf build config one level upVincent Ambo1-0/+24
This embeds the build config directly at the point where `Cargo.nix` is imported, making it transparent to library consumers. Change-Id: I5586e12f02ed14587c32d9ef7d93f079366fb127 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7780 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2022-12-28 r/5526 feat(tvix): add evans to shellFlorian Klink1-0/+1
Change-Id: I7ec8bae236330ec1e38e82da67b47aef2815d4b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7437 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-12-22 r/5472 feat(tvix): add crate2nixGenerate targetFlorian Klink1-1/+8
`mg run //tvix:crate2nixGenerate --` runs crate2nix generate and depotfmt's it afterwards. This removes a frequent point of friction, because the Cargo.nix emitted by crate2nix needs another formatter. Change-Id: I649495980718cd3847d4cff77c9d4bfcb599387c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7612 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-12-15 r/5421 refactor(tvix): provide a combined //tvix:shell mkShell targetVincent Ambo1-0/+20
Manually maintained shell target based on the previous "loose" `shell.nix` file. We might want to have a function that combines the dependencies of all the targets automatically, but at a quick glance that was actually non-trivial so I'm leaving it as an exercise for someone else. Change-Id: I74754940088f1b58e3b6754fb782470c80ea4292 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7540 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-12-15 r/5420 refactor(tvix): build Rust projects using crate2nixVincent Ambo1-9/+5
Introduces granular dependency builds using crate2nix, bootstrapped off the generated configuration from the newly introduced workspace (see cl/7533). This commit checks in the generated Cargo.nix file which can be regenerated with a parameterless invocation of `crate2nix generate` in `//tvix`. I tried generating this in IFD, but it turned out to be harder than what seemed worthwhile for now. In this setup, the various build targets for Rust projects end up being attributes of the imported `Cargo.nix` file at the `tvix.crates` attribute. These still lack configuration, however, which has been fixed in the various `default.nix` files of individual projects. Note that we (temporarily) lose the ability to build tvix-eval's benchmarks in CI. I haven't figured out what magic incantation summons them from the void again ... The `eval-okay-readDir` tests from both test suites have been disabled because they fail for unknown reasons when run in this new derivation. Somebody will have to debug it! Change-Id: I2014614ccb9c8951aedbd71df7966ca191a13695 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7538 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2022-12-15 r/5419 refactor(tvix): share a Cargo.lock file between Rust projectsVincent Ambo1-0/+14
This relates to the (abandoned) cl/7256. Introduces a Cargo workspace at //tvix that is primarily intended to be used as a workaround for the annoying Nix+Rust tooling while having a consistent set of dependencies. This is driven in part by a desire to adopt crate2nix and get more granular Nix builds for Tvix's Rust projects, and in part by a need to split //tvix/eval into something providing the CLI (REPL etc.), and a library providing eval, without significantly altering the structure of build targets. To accomplish this the workspace has been designed to allow projects to remain independent build targets. I want to avoid lumping all the projects together - something like //tvix/eval should always be independent of other parts of tvix. A helper function in //tvix/default.nix lets downstream naersk projects construct a sparse root for the project which combines the workspace's `Cargo.lock` with the project's own `Cargo.toml`. Note that cargo commands in the workspace itself require the build dependencies of _all_ projects to be present, which is currently a bit annoying to accomplish. This introduces some breakage: 1. It breaks usage of rust-analyser without being in a shell with the dependencies of *all* Tvix projects, as it is not capable of respecting only the subset of dependencies for a part of the workspace. 2. It is no longer possible to run tests using `cargo test`, as the test generation crate we use does not work with workspaces: https://github.com/frehberg/test-generator/issues/6 This still works in the Nix build as we construct a Cargo project that looks like it's not in a workspace there. Until somebody fixes that crate / writes a new macro / does something else with the test suite, the way to run the tests is through the Nix build. Long-term we'll probably want to get rid of cargo completely, it's just a big wart and most tooling works without it if correctly configured, but we don't have time for that now. Change-Id: I846bff7a8429a25c077fd1e9ef4e3c34a299a4a1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7533 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-08-12 r/4419 chore(tvix): move nix-store CLI scaffolding to subfolderVincent Ambo1-2/+0
For some reason a top-level Rust project ended up in this location, which is incompatible with the actual project structure that's being prepared for merge right now. Change-Id: I9d919ad72fc7e4e4d8cbb9899e7f8d90fa7ca87a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6060 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: tazjin <tazjin@tvl.su>
2022-01-31 r/3723 style: format entire depot with nixpkgs-fmtVincent Ambo1-2/+2
This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi>
2022-01-06 r/3521 feat(tvix): set up cargo rust projectProfpatsch1-0/+2
First steps for baba Change-Id: Id6a68c5630cb85f280f4dcc7b2acf10c02454fd6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4732 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>