| 15 Jul 2021 |
matthewcroughan - 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 - 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 - nix.zone | https://discourse.nixos.org/t/git-describe-like-attributes-for-flakes/10805 | 22:27:03 |
matthewcroughan - nix.zone | Looks like someone has asked already | 22:27:07 |
mvnetbiz | Seems not possible unless the description itself is committed into the repo beforehand | 22:47:07 |
mvnetbiz | I think multiple git commit histories could produce the same fixed-output with the way its currently implemented, so that can't be done purely | 22:50:41 |
matthewcroughan - nix.zone | Well, it's an interesting case. | 22:50:57 |
matthewcroughan - nix.zone | Maybe I can talk about it. | 22:51:05 |
mvnetbiz | 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 |
mvnetbiz | * 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 - 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 - nix.zone | In order to use git describe you need the .git index. Which is impure. | 22:54:00 |
matthewcroughan - 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 - 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 - 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 |
mvnetbiz | 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 |
mvnetbiz | Seems 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 - 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 - nix.zone | The cmake build is supposed to use git describe and use it in order to set this string. | 22:59:02 |
matthewcroughan - 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 schema that allows this same string to be resolved without the need for Dolphin to change. | 22:59:50 |
matthewcroughan - 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 |
mvnetbiz | I'm not familiar with git describe, is it possible for the description of a rev to ever change? | 23:00:22 |
matthewcroughan - nix.zone | it shows the latest tag | 23:01:37 |
mvnetbiz | oh 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 description | 23:01:56 |
matthewcroughan - nix.zone | It prints the latest tag in a given tree. | 23:02:56 |
mvnetbiz | which can change even if your ref doesn't | 23:03:26 |
mvnetbiz | I've seen upstream delete a tag before causing reproducibility problems, but this could break without deleting a tag too | 23:04:50 |
matthewcroughan - nix.zone | Yeah, the underlying software just shouldn't be relying on this output for runtime behavior. | 23:05:40 |
matthewcroughan - 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 |
mvnetbiz | It looks like its for the networked multiplayer feature? | 23:08:27 |