Commit graph

20104 commits

Author SHA1 Message Date
Florian Klink
dbf87f3057 chore(tvix): bump tonic to 0.11.0
This bumps tonic and surrounding crates to 0.11.x.

We added support for tonic 0.11.x into tokio-listener
(https://github.com/vi/tokio-listener/pull/4), so that's bumped as well.

Change-Id: Icfade5894403228299836fefb21b2f9ae59dbebb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11156
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-03-16 17:04:12 +00:00
sterni
212f5afdcf fix(tvix/eval): builtins.unsafeGetAttrPos returns path as a string
Change-Id: Ia1058a5ea687f413fbb62365da199032bdbd3fd2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11155
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
2024-03-16 12:52:30 +00:00
Profpatsch
0e0f69881c chore(users/Profpatsch): fix cabal.project & hie.yaml
Change-Id: I39bebe6ce2bde85d26a68b017c0e6d872e9b9705
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11161
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Autosubmit: Profpatsch <mail@profpatsch.de>
2024-03-16 12:42:21 +00:00
Profpatsch
28a83478bc fix(users/Profpatsch/httzip): fix PATH
Change-Id: I6f27a947fe609f7d6ce004ce5aaae76b32dbe4fc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11160
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Autosubmit: Profpatsch <mail@profpatsch.de>
2024-03-16 12:42:16 +00:00
Florian Klink
fdf9657654 fix(tvix): don't emit rerun-if-changed
`build.rs` emits rerun-if-changed statements for all proto files, as
well as all include paths we pass it.

Unfortunately, due to protobufs include path rules, we need to specify
the path to the depot root itself as an include path, at least when
building impurely with `cargo`. This causes cargo to essentially always
rebuild, as it also puts its own temporary files in there.

Unfortunately, tonic-build does not chase down to individual .proto
files that are included.

Disable emitting these `rerun-if-changed` statements for now.

This could cause cargo to not rebuild protos every time, causing stale
data until the next local `cargo clean`, but considering the protos
change not that frequently, and it'll immediately surface if trying to
build via Nix (either locally or in CI), it's a good-enough compromise.

Change-Id: Ifd279a2216222ef3fc0e70c5a2fe6f87997f562e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11157
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2024-03-16 09:34:10 +00:00
Florian Klink
56dc4f735b docs(tvix): fix some docstrings
Change-Id: Ife599387d0472cd746b992bd6755a2fb6a0e0dc4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11158
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
2024-03-15 23:16:01 +00:00
Vincent Ambo
d3534ee051 fix(depotfmt): only exclude *imported* tvix tests
When we added the Nix language test suite in cl/6126, we excluded the
whole tvix tests folder from Nix formatting. This is unintentional, as
we probably want *our* tests to be formatted correctly.

Change-Id: I2b66d79e30fae17e75d5a1f8c44e279886091c5f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11154
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-03-15 14:22:49 +00:00
sterni
d5b6704d3d chore: move protoCheck into extraStep of //nix/bufCheck
Resolves b/385. I have a feeling bufCheck should be moved to
//tools as well.

Change-Id: I2a2b63d135a2f8bcc982aa1138ff3213c6012f20
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11152
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-03-15 11:55:54 +00:00
Florian Klink
5fccbe5939 feat(nix-compat/wire): add read_bytes[_unchecked]
This introduces a version reading sized byte packets. Both read_bytes,
accepting a range of allowed sizes, as well as read_bytes_unchecked,
which doesn't care, are added, including tests.

Co-Authored-By: picnoir <picnoir@alternativebit.fr>
Change-Id: I9fc1c61eb561105e649eecca832af28badfdaaa8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11150
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
Tested-by: BuildkiteCI
2024-03-15 10:35:24 +00:00
Florian Klink
c364c0b4de docs(nix-compat/wire): update docstrings
These are not streams, but AsyncRead and AsyncWrite.

Change-Id: I7d988fa0490800b72862f4f0fcac3dceac70ec26
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11149
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
2024-03-15 10:23:12 +00:00
Florian Klink
907ecff999 feat(nix-compat/wire): add low-level wire format primitives code
This brings some initial Nix wire format parsing code, used in the nix
daemon protocol, remote store/builder protocol, as well as the NAR
format itself (note we already have more specialized code for the last
one).

Thanks to embr, this code already exists, in
https://codeberg.org/gorgon/gorgon/src/branch/main/nix-daemon/src/wire.rs,
and we can vendor it into here, as EUPL is compatible with GPL (in that
direction).

The code uses the tokio::io Reader and Writer traits, not the ones from
the `futures` crate, as they provide some more convenient `read_u64_le`
functions.

More application-specific parsing code, as well as code to read strings,
or bytes are left out for now, as we want to be be more restrictive
w.r.t allowed max sizes, and need to parse bytes, not strings.

The code slightly diverges, as we have clippy looped into CI.
`Ok(…?)` can be turned into just the inner expression, and
some .and_then can be expressed in a simpler fashion.

Change-Id: Ie3adcb485e9d66786673b1962a08d4e5df3781d9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11148
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
2024-03-15 10:23:12 +00:00
Florian Klink
905a79308e refactor(nix-compat/derivation): emphasize aterm_bytes
derivation_or_fod_hash constructs ATerm bytes and feeds them to sha256.

input_derivations being slightly modified is an implementation detail,
so move the BTreeMap construction inline, and have aterm_bytes in a
let binding (and feed it to the hash function directly while
constructing it).

This makes it a bit more understandable what's going on.

Change-Id: I2f5cfbd1c964fd39ac731ca39e76cfc168f4c7d7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11147
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: John Ericson <git@johnericson.me>
2024-03-14 23:10:54 +00:00
Florian Klink
142c72e070 refactor(nix-compat/store_path): add from_name_and_digest_fixed
Allow constructing a StorePath with a fixed-size digest.

Change-Id: Id7d0b0152f6c55660a8973a02c84afa9188ce3ba
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11144
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: John Ericson <git@johnericson.me>
Tested-by: BuildkiteCI
2024-03-14 23:10:54 +00:00
Florian Klink
98e6936301 refactor(nix-compat/store_path/utils): move helper function in
This is only used inside this function, in 2 of the match cases.

Change-Id: Ib361f5ee0e3b203802f7d05b9a7f332d14bbcf80
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11143
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: John Ericson <git@johnericson.me>
Tested-by: BuildkiteCI
2024-03-14 17:38:47 +00:00
Florian Klink
43c851bc84 refactor(nix-compat/store_path): take [u8;32] for outer fingerprint
The outer fingerprint used for store path calculation is always a sha256
digest. This includes both input and output-addressed store paths.

We used a NixHash here, which can also represent other hash types, and
that had a bunch of annoyances:

 - Whenever we had the bytes, we had to wrap them in a NixHash::Sha256().
 - Things like AtermWriteable had to be implemented on NixHash,
   even though we then had an assertion it was only called in the
   NixHash::Sha256 case.

Change-Id: Ic895503d9b071800d2e52ae057666f44bd0ab9d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11142
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: John Ericson <git@johnericson.me>
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
2024-03-14 16:52:42 +00:00
Florian Klink
35f636b684 feat(ops/terraform/deploy-nixos): support argstr map
This allows setting argstr to a map of keys and values.
We use jq to construct "--argstr k v" arguments, which are passed to
nix-instantiate.

Change-Id: I720a597ca2276364bc7005c156064d938f143041
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11141
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
2024-03-14 07:14:55 +00:00
Florian Klink
a9db1455f5 refactor(ops/terraform/deploy-nixos): downcase bash variables
These are not environment variables, so let's shout less.

Change-Id: I3132844937ee78b7230a46afc0240e0225a99f3e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11140
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
2024-03-14 06:03:48 +00:00
Florian Klink
8f19ffc4fd chore(ops/modules/open_eid): use nativeMessagingHosts.packages
trace: warning: The `programs.firefox.nativeMessagingHosts.euwebid`
option is deprecated, please add `web-eid-app` to
`programs.firefox.nativeMessagingHosts.packages` instead.

Change-Id: Ic2518957eb8e9151f2fdb13a5f25dfbc12c577a2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11138
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2024-03-13 18:06:19 +00:00
sterni
dc9c2c9b0c docs(tvix/eval): C++ Nix now has deduplicated inherit (from)
Change-Id: Icf74c699130c2ab774973a7e98bc44ffba8c5ec2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11139
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: flokli <flokli@flokli.de>
2024-03-12 21:23:32 +00:00
Florian Klink
514edc2ea5 feat(tvix/boot/tests): add simple objectstore test
This makes BLOB_SERVICE_ADDR configurable, and creates a flavor setting
it to objectstore+file://$PWD/blobs.

Change-Id: I68c21367f83f68b4dee701c5678f438c7d8fbe43
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11137
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
2024-03-11 22:42:26 +00:00
Florian Klink
f22d5b3d11 feat(tvix/castore/blobsvc/from_addr): support object_store
The object_store crate supports a ton of different stores, with different schemes.

For now, use a objectstore+ scheme prefix to enable these.

Change-Id: I946f76e32a0fb0867ef59060217894cda5b959b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11080
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
2024-03-11 22:42:01 +00:00
Florian Klink
1c2db676a0 feat(tvix/castore/blobsvc): add object storage implementation
This uses the `object_store` crate to expose a tvix-castore BlobService
backed by object storage.

It's using FastCDC to chunk blobs into smaller chunks when writing to
it.

These are exposed at the .chunks() method.

Change-Id: I2858c403d4d6490cdca73ebef03c26290b2b3c8e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11076
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Reviewed-by: Brian Olsen <me@griff.name>
2024-03-11 22:42:01 +00:00
Florian Klink
d327bf775d feat(tvix/store/bin): allow disabling OTLP at runtime
This was only possible by disabling without the otlp feature flag so
far.

Introduce the same --otlp=false mechanism that nar-bridge also supports
to be able to turn it off at runtime.

Change-Id: Ib22a364c35056ca9d8e327c0e2a79970a4cf4b2b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11135
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-03-11 17:02:26 +00:00
sterni
4ec596c8f9 chore(fun/paroxysm): update deps and build against in tree crimp
To achieve this we switch to crate2nix which also requires us to
run `cargo update` before the switch.

Change-Id: I8c19a51f90f344e80064e70a4a2799d1c6db62ec
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11134
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
2024-03-11 16:52:45 +00:00
sterni
b40c4500a3 chore(net/crimp): update dependencies
Change-Id: I30b945859347d8f9b0c6947ecc278a3e9cb7ec2c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11133
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-11 16:52:45 +00:00
sterni
438db1be30 fix(net/crimp): correctly set content length for PUT requests
Since https://github.com/curl/curl/commit/9c845be2797e20475
(presumably), libcurl will overwrite our previously set request
method to POST if we set .post_field_size(…). The fix is to use
the proper option for PUT/upload, .in_filesize(…). While we're
at it, switch to using .upload(…) instead of the deprecated
.put(…) which should be the same for HTTP.

Change-Id: I393c1a02c70d5b99dff5901cd6e9d9434f68c15b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11132
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
2024-03-11 16:36:36 +00:00
Aspen Smith
54609e8c17 feat(tvix/glue): Add AsyncRead wrapper to decompress streams
Add a new AsyncRead wrapper, DecompressedReader, that wraps an
underlying AsyncRead, but sniffs the magic bytes at the start of the
stream to determine which compression format is being used out of the
three that are supported by builtins.fetchTarball, and switches to the
correct decompression algorithm adapter dynamically.

This will be used in the implementation of builtins.fetchTarball

Change-Id: I892a4683d5c93e67d4c173f3d21199bdc6605922
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11019
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-03-11 11:35:18 +00:00
Aspen Smith
de727bccf9 feat(tvix/glue): Implement builtins.fetchurl
Implement the fetchurl builtin, and lay the groundwork for implementing
the fetchTarball builtin (which works very similarly, and is implemented
using almost the same code in C++ nix).

An overview of how this works:

1. First, we check if the store path that *would* result from the
   download already exists in the store - if it does, we just return
   that
2. If we need to download the URL, TvixStoreIO has an `http_client:
   reqwest::Client` field now which we use to make the request
3. As we're downloading the blob, we hash the data incrementally into a
   SHA256 hasher
4. We compare the hash against the expected hash (if any) and bail out
   if it doesn't match
5. Finally, we put the blob in the store and return the store path

Since the logic is very similar, this commit also implements a *chunk*
of `fetchTarball` (though the actual implementation will likely include
a refactor to some of the code reuse here).

The main thing that's missing here is caching of downloaded blobs when
fetchurl is called without a hash - I've opened b/381 to track the TODO
there.

Adding the `SSL_CERT_FILE` here is necessary to teach reqwest how to
load it during tests - see 1c16dee20 (feat(tvix/store): use reqwests'
rustls-native-roots feature, 2024-03-03) for  more info.

Change-Id: I83c4abbc7c0c3bfe92461917e23d6d3430fbf137
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11017
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: aspen <root@gws.fyi>
2024-03-11 02:21:54 +00:00
Aspen Smith
83ad32c481 feat(aspen/emacs): Configure direnv
Change-Id: I541620448137c7e7443d0a7f9c10509fab02bdea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11131
Tested-by: BuildkiteCI
Reviewed-by: aspen <root@gws.fyi>
Autosubmit: aspen <root@gws.fyi>
2024-03-11 01:58:35 +00:00
Aspen Smith
2466ecaf31 feat(aspen/emacs): Use hotfuzz for completion
This is like orderless but a million times better (no need for spaces!)

Change-Id: Id8d2382e1d83792959580bcbe807cdd9aebdde88
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11130
Reviewed-by: aspen <root@gws.fyi>
Autosubmit: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
2024-03-11 01:58:35 +00:00
Aspen Smith
a0225431de feat(aspen/emacs): Some more rust bindings
Change-Id: Iabdd9f75438e83e73c7e423a3646d72b9bbe5b83
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11129
Reviewed-by: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
Autosubmit: aspen <root@gws.fyi>
2024-03-11 01:58:35 +00:00
Aspen Smith
58379302f4 feat(aspen/emacs): Make vertico's faces look nicer with solaire
Change-Id: I7b3befb9f9607a301eaddff9808cdd27dabbfffe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11128
Reviewed-by: aspen <root@gws.fyi>
Autosubmit: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
2024-03-11 01:58:35 +00:00
sterni
a95ce06cf9 fix(users/wpcarro/nixos): ava's not tarasco
Change-Id: Ib9e28120556abdd81dd17e478617f3a84c0d554f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11125
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-10 21:48:05 +00:00
Vincent Ambo
13b0f80e4f feat(treecrumbs): support for TOML
Similar to YAML, but with more weird keys and with sections.

Change-Id: I94d69d2f0e53366855ccb5d99a432c6a0361a910
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11126
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2024-03-10 19:35:46 +00:00
Vincent Ambo
6280706ecd feat(treecrumbs): support for JSON
Fairly similar to YAML, except with only one way of naming keys and
arrays.

Change-Id: Ic2fa539466d69af55b36401bb8c03f2c7edcd91d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11112
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-10 19:35:46 +00:00
Vincent Ambo
3b7e546dfc feat(treecrumbs): initial support for C++
Supports namespaces, functions, fields (including trailing return type
syntax) and so on.

One notable issue about this is that the tree-sitter parser for C++
returns the node *following* point if point is on whitespace, which
means that at the top-level of a namespace the crumbs will often show
the *next* function.

I'm against adding workarounds for stuff like that, so I'll just keep
it as is.

Change-Id: If7e71525c4e86e128157dd4eb17c130297ed1e0a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11109
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-10 19:35:46 +00:00
Vincent Ambo
470f7dfa45 refactor(treecrumbs): macro for language definitions
Adds a macro that provides a more convenient syntax for defining new
languages for treecrumbs (and that can also be easily used outside of
the core treecrumbs code).

This macro automatically takes care of compiling tree-sitter queries
for reuse.

Change-Id: I6a0b892a083c3f243e8b8f0e1c865a9a8a1a5cf5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11107
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-10 19:35:46 +00:00
Vincent Ambo
2c9bbe37be feat(tazjin/emacs): install treecrumbs package
Change-Id: Ia903a38df7258c1528f3d4ac3ca4ae7f82edb3e9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11106
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
2024-03-10 19:27:49 +00:00
Vincent Ambo
eeca6cd891 feat(emacs-pkgs/treecrumbs): support "JSON-style" YAML syntax
Makes crumbs work correctly for weird stuff like:

```yaml
foo:
  - { "bar": [ { baz: 1 }]}
```

Would be nice to have tests for this at some point.

Change-Id: I034e83318435404ef8613e439313dbb08865f228
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11105
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-03-10 19:27:49 +00:00
Vincent Ambo
13cced5b84 feat(tools/emacs-pkgs): configure FSF_OWNERS file
This adds a separate owners file that can be imported in projects with
FSF copyright assignment, so that only people with copyright paperwork
on file can commit (or verify commits before approving).

Change-Id: Ifbe07792572b9d6bf5f7d47c41135892bddea46b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11108
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
2024-03-10 19:27:49 +00:00
Vincent Ambo
0be7b938c2 feat(emacs-pkgs/treecrumbs): tree-sitter based breadcrumbs
Adds a new 'treecrumbs' Emacs package that allows displaying fast,
tree-sitter based breadcrumbs. The initial version only supports
YAML (which is what I needed this for!).

The package is documented, please go read the code and comments for
more information.

I assign copyright over this package to the FSF, paperwork is on file.
This means that I can only accept contributions from people with the
right paperwork. If this package ends up being useful, I intend to
eventually submit it to GNU Emacs.

Change-Id: If1297a080f63f402f83b6cc57fa7c970d32d3695
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11104
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
2024-03-10 19:27:49 +00:00
Florian Klink
5ce76a1bae feat(ops/machines/whitby): let clbot post in #tvix-dev too
Change-Id: Ic49304291ec2f276e1329ffc7e8b4184d472cbe3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11111
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
2024-03-10 18:35:27 +00:00
sterni
ad9b08e43d feat(sterni/nix/lists): implement transpose
This function is inspired by BQN's [⍉] though it is much less elegant
since Nix lacks multi-dimensional arrays. I thought this would be useful
to to avoid multiple `map`s over a single list if we want to return
multiple, separate values from it:

  transpose (builtins.map (x: [ (calcA x) (calcB x) ]) myList)

  # => [ [ (calcA a) … ] [ (calcB a) … ] ]

While this is quite elegant, it turns out that it is faster to write out
multiple maps:

  [ (builtins.map calcA myList) (builtins.map calcB myList) ]

[⍉]: https://mlochbaum.github.io/BQN/doc/transpose.html

Change-Id: Ic333c33af38ab03573b215c9696d75caf2ee18e7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11113
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2024-03-10 18:05:32 +00:00
Florian Klink
37703c9e44 docs(tvix/README): update IRC channels
`#tvl` is the general TVL community channel, `#tvix-dev` is dedicated to
Tvix development discussion.

Change-Id: If899d9ae70dffb4acf6a41ded54f80a1f0551c5d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11110
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-03-10 17:14:41 +00:00
Florian Klink
bd1def3ec4 fix(tvix/store/grpc/pathinfo): skip_all fields, handle errors
request only contains the outer metadata wrapping, and that's not too
interesting:

> Request { metadata: MetadataMap { headers: {"content-type":
> "application/grpc", "user-agent": "grpc-go/1.60.1", "te": "trailers",
> "grpc-accept-encoding": "gzip"} }, message: Streaming, extensions:
> Extensions }

Drop these fields for now, and rely on the underlying implementations to
add instrumentation for the application-specific fields.

Also, ensure we handle all error cases properly, and log them. We
don't use `err` from instrument, as that'd also log an error on
`Status::not_found`.

Change-Id: Id1b983cb8b059c148c8a376f8802a1d28c59ba97
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11103
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
2024-03-09 05:48:46 +00:00
Florian Klink
4e78de7393 fix(tvix/castore/grpc/directory): skip_all fields in instrument
This only contains the outer metadata wrapping, and that's not too interesting:

> Request { metadata: MetadataMap { headers: {"content-type":
> "application/grpc", "user-agent": "grpc-go/1.60.1", "te": "trailers",
> "grpc-accept-encoding": "gzip"} }, message: Streaming, extensions:
> Extensions }

Drop these fields for now, and rely on the underlying implementations to
add instrumentation for the application-specific fields.

Clean up the error logging a bit.

Change-Id: Ife1090ed411766a61e1fa60fd4c9570f38de1e98
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11102
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-03-09 05:47:41 +00:00
Florian Klink
05deb37f44 fix(tvix/castore/grpc/blob): skip_all fields in instrument
This only contains the outer metadata wrapping, and that's not too interesting:

> Request { metadata: MetadataMap { headers: {"content-type":
> "application/grpc", "user-agent": "grpc-go/1.60.1", "te": "trailers",
> "grpc-accept-encoding": "gzip"} }, message: Streaming, extensions:
> Extensions }

Drop these fields for now, and rely on the underlying implementations to
add instrumentation for the application-specific fields.

Log errors in some places where we didn't so far.

Change-Id: Ia68d6c526987d3716be62a0809195401cf28512b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11101
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
2024-03-09 05:47:36 +00:00
Florian Klink
8f804f5d9c chore(tvix/nix-compat): bump zstd dependency
Otherwise this causes conflicts when adding a more recent zstd version
to another crate.

Change-Id: I02d1b1a37f18711c0969cb04e761e967fc4655dc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11100
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
2024-03-09 05:47:03 +00:00
Vincent Ambo
22455cc62c chore(3p/sources): bump channels & overlays (2024-03-07)
* tazjin/nixos: remove unstable ZFS from tverskoy
* skipped agenix update as usual

Change-Id: I21dca17415c147d702ecc14a6c7f1c553ad62b84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11095
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
2024-03-08 10:22:22 +00:00
sterni
16a7c4a1be feat(buildkite): avoid building extraSteps in pipeline construction
In principle we don't want to build any (later) pipeline target during
pipeline evaluation insofar they appear in extraSteps. For this reason,
we have the needsOutput mechanism which prevents the parent target of an
extraStep from being built in 🦙.

Unfortunately, this mechanism is not general purpose enough, as we use
other (i.e. non parent) targets from depot in extraSteps. As a
consequence, kind of expensive builds need to happen during pipeline
construction at the moment. The solution is to use the fact that the
command script we want to run is exposed via the readTree interface to
depot and build the script proper only when the extra step is executed.

To facilitate this, some prerequisite changes need to be made:

- We need to use a symlink different to result in case needsOutput is
  true which needs support in mkBuildCommand. We also need to avoid this
  symlink being picked up by git, as many extra steps check whether the
  tree is dirty or not. (Is there a way to have it outside the depot
  tree?)

- Since we rely on the build command printing a single store path we
  store in $command_script, we need to avoid it printing two paths
  in cases where nix-store(1) is used (nix-store(1) prints the symlink
  and readlink(1) would print the store path in a separate line).

Future work would be to remove/deprecate the needsOutput mechanism:
After this change the parent target wouldn't be built right away even if
it appeared in the script via string interpolation. Thus we could,
instead of expecting the target being available as `./result`, make our
extra steps nix-ier.

Change-Id: Idd2e88a865eadabe229ce1e05406e8cc4cb63f94
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10850
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2024-03-07 15:39:56 +00:00