!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

883 Members
180 Servers

Load older messages


SenderMessageTime
15 Jul 2021
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone The flake lock outputs lots of things, but I can't actually use git describe on a given source, because in order to do that I'd need to download the git index, which is highly impure! 22:04:46
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone * The flake lock describes lots of things, but I can't actually use git describe on a given source, because in order to do that I'd need to download the git index, which is highly impure! 22:04:54
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zonehttps://discourse.nixos.org/t/git-describe-like-attributes-for-flakes/1080522:27:03
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneLooks like someone has asked already22:27:07
@mvtva:matrix.orgmvnetbizSeems not possible unless the description itself is committed into the repo beforehand22:47:07
@mvtva:matrix.orgmvnetbizI think multiple git commit histories could produce the same fixed-output with the way its currently implemented, so that can't be done purely22:50:41
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneWell, it's an interesting case.22:50:57
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneMaybe I can talk about it.22:51:05
@mvtva:matrix.orgmvnetbiz I didin't thikn about it, I was just thinking I could git describe ${self} in the outputs, but it doesn't have the git data itself, I think it was you were saying right? 22:52:02
@mvtva:matrix.orgmvnetbiz * I didin't thikn about it, I was just thinking I could git describe ${self} in an output derivation, but it doesn't have the git data itself, I think that is what you were saying right? 22:52:46
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone

https://github.com/dolphin-emu/dolphin uses CMake to find git, which in turn sets DOLPHIN_WC_DESCRIBE. This is used at runtime to determine compatibility between clients.

https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/misc/emulators/dolphin-emu/master.nix#L51

The nixpkg currently requires the maintainer to find this information out by hand and then bind it to the version value on L24.

22:53:21
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone In order to use git describe you need the .git index. Which is impure. 22:54:00
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone * In order to use git describe you need the .git index. Which is impure, because if someone adds a branch upstream, then you've mutated the .git index state. 22:54:12
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone so using leaveDotGit = true; in a package just to do this is a bad idea, as the sha256 will always be mutating. 22:55:23
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone * so using leaveDotGit = true; in a package just to do this is a bad idea, as the sha256 will always be changing. 22:55:28
@mvtva:matrix.orgmvnetbiz how is that dolphinemu case different than other packages where the version is specified? just because you can go look for a tag easily without the local repo, vs cloning it to do describe? 22:56:23
@mvtva:matrix.orgmvnetbizSeems like a dolphin problem, couldn't it be a problem for the runtime behavior to change based on what is bsically a side effect of the particular VCS in use?22:58:33
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone
In reply to @mvtva:matrix.org
how is that dolphinemu case different than other packages where the version is specified? just because you can go look for a tag easily without the local repo, vs cloning it to do describe?
It's supposed to happen as part of the build.
22:58:45
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone The cmake build is supposed to use git describe and use it in order to set this string. 22:59:02
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneI've honestly suggested this is a problem to Dolphin, but I also believe it would be possible to put some data in the flake schema that allows this same string to be resolved without the need for Dolphin to change.22:59:50
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone * I've honestly suggested this is a problem to Dolphin, but I also believe it would be possible to put some data in the flake lock schema that allows this same string to be resolved without the need for Dolphin to change.22:59:57
@mvtva:matrix.orgmvnetbizI'm not familiar with git describe, is it possible for the description of a rev to ever change?23:00:22
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneit shows the latest tag23:01:37
@mvtva:matrix.orgmvnetbizoh yeah, if you are referring to a ref thats newer than a tag, then they can make a new tag ahead of the old tag and behind your ref, it would change the description23:01:56
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneIt prints the latest tag in a given tree.23:02:56
@mvtva:matrix.orgmvnetbizwhich can change even if your ref doesn't23:03:26
@mvtva:matrix.orgmvnetbizI've seen upstream delete a tag before causing reproducibility problems, but this could break without deleting a tag too23:04:50
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zoneYeah, the underlying software just shouldn't be relying on this output for runtime behavior.23:05:40
@matthewcroughan:defenestrate.itmatthewcroughan - nix.zone * Yeah, the underlying software just shouldn't be relying on this output for runtime behavior, which it currently is, and a friend is going to make a PR to change.23:05:49
@mvtva:matrix.orgmvnetbizIt looks like its for the networked multiplayer feature?23:08:27

Show newer messages


Back to Room ListRoom Version: 6