!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

688 Members
Rust155 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
27 Feb 2025
@charles:computer.surgeryCharlesdirenv requires you to manually allow each .envrc before executing it, so you have a chance to read it before you run it. It re-requests if the file changes too16:44:26
@tomasajt:matrix.orgToma
In reply to @niklaskorz:korz.dev

Toma: I think I just found out why cargo-about has issues with git-fetched crates in nixpkgs, and wondered if you had any idea how/if fetchCargoVendor could accomodate this use-case.

The affected crates for which cargo-about fails to read the LICENSE are from a Cargo workspace git repo, where the LICENSE file is referenced in each crate's Cargo.toml but is located in the parent directory (the root of the repository). For fetchCargoVendor, the parent directory is the vendor directory itself, not the root of the crate's git repository, resulting in this error:

zed-editor> 2025-02-27 15:58:07.231029 +00:00:00 [WARN] failed to validate all files specified in clarification for crate pet-virtualenv 0.1.0: unable to read path '/private/tmp/nix-build-zed-editor-0.175.5.drv-0/zed-editor-0.175.5-vendor/pet-virtualenv-0.1.0/../../LICENSE': No such file or directory (os error 2)

There is a PR that tries to fix the issue with symlinks. (Can't send the url atm)

Though, if it's in the config file, I doubt it solves that.

Would be interesting to see what upstream carg does about this. (fetchCargoTarball or the cargo vendor command)

16:50:36
@tomasajt:matrix.orgToma

A change could be made to fetchCargoVendor that doesn't only copy a crate's subtree, but the entire git tree. This would break the expectation of having all crates in the root of cargoDeps. Though this is something we've been considering doing anyways (to allow duplicate packages with the same version).
Though, this might cause more storage usage, since complete git trees will end up in cargoDeps. This isn't that big of a problem though.


I'm very satisfied with the fact that we can do all these changes without having to worry about breaking the FOD hash.

18:06:56
@r522:matrix.org@r522:matrix.org

that being said, it doesn't re-request if the file didn't change but the flake did

so doing an allow for some project that just uses use flake; means you allowed any flake it could have, which in practice means not re-requesting on code changes

(though in practice i don't think this is much of an issue if it's a project where you would execute the code of it anyways, the allow is just to stop you getting owned by a direnv you don't expect)

21:51:12
@charles:computer.surgeryCharles oh right shellHook exists 21:51:52
@charles:computer.surgeryCharlesi forget about that21:51:56
@r522:matrix.org@r522:matrix.org

but yeah ultimately i don't think it's a problem
because like, if someone gets malicious code into the flake.nix of, say, rust
or servo

they could also just insert malicious code into the project itself and own a lot more people than just nix users

21:56:11
@r522:matrix.org@r522:matrix.org requiring re-validation whenever the environment changes wouldn't be very helpful because there's no way you're actually going to read all the changes every time 21:57:01
@emilazy:matrix.orgemilyit'd be nice if there was a paranoid mode that based the permission on derivation hash23:14:09
@r522:matrix.org@r522:matrix.org hmmm can you know that without actually running any binaries? (even in the presence of, say, IFD) 23:25:17
@r522:matrix.org@r522:matrix.org * hmmm can you know that without actually running any (project-supplied) binaries? (even in the presence of, say, IFD) 23:25:27
@r522:matrix.org@r522:matrix.orgfor the simple case of a git project honestly pinning it to the commit hash would be enough23:25:55
@r522:matrix.org@r522:matrix.org"if the current hash isn't X, bail"23:26:01
@emilazy:matrix.orgemilyI assume you mean "absence"? Nix eval should be safe, nominally23:36:39
@r522:matrix.org@r522:matrix.orgno i mean if you want to implement a paranoid mode, it would need to work even with IFD being used in the project23:38:48
@emilazy:matrix.orgemilywell, it can just pass the Nix flag to disable IFD :)23:45:23
@emilazy:matrix.orgemilybut also – that's still in the Nix sandbox23:45:33
@emilazy:matrix.orgemilywhich is a crummy security boundary admittedly23:45:36
28 Feb 2025
@niko:nrab.lolniko ⚡️ my humble opinion is that IFD should be axed and I run all my systems with allow-import-from-derivation = false so I wouldn't mind the paranoid mode not supporting IFD 09:08:05

Show newer messages


Back to Room ListRoom Version: 6