!9IQChSjwSHXPPWTa:lix.systems

Lix

706 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms218 Servers

Load older messages


SenderMessageTime
9 Nov 2024
@aidalgol:matrix.orgaidalgol Semi-related to this: I found that you can nix flake update input-a from repo B when input A points to a local checkout with uncommitted changes, and repo B will now be pointing to the uncommitted changes in your local repo A. 23:19:58
@kfears:matrix.orgKFears (annoying)
In reply to @benjamin:computer.surgery
I cannot imagine a situation where the current behavior would be desirable
Me neither, but with flakes, better safe than sorry :P
Still, it's like a CLI issue and I would expect people to run into actually insane breakages due to old transitive inputs, it just doesn't help anyone, and it's thankfully isolated to CLI I think
23:20:05
@aidalgol:matrix.orgaidalgolIt was somewhat useful, but it's also a bit of a footgun.23:20:21
@kfears:matrix.orgKFears (annoying)
In reply to @aidalgol:matrix.org
Semi-related to this: I found that you can nix flake update input-a from repo B when input A points to a local checkout with uncommitted changes, and repo B will now be pointing to the uncommitted changes in your local repo A.
Wait wut, can you give an inputs example for it? Does it work only for path, or for git+file too?
23:22:06
@aidalgol:matrix.orgaidalgol IIRC, I was using git+file. 23:22:29
@benjamin:computer.surgeryoliviacursed23:22:38
@kfears:matrix.orgKFears (annoying)No way, that sounds broken23:22:41
@kfears:matrix.orgKFears (annoying)Eww23:22:48
@benjamin:computer.surgeryolivia I would expect that to work with path: but not git+file 23:22:52
@kfears:matrix.orgKFears (annoying) Wait, so what does ref and rev give you in the lockfile in that case? 23:23:18
@aidalgol:matrix.orgaidalgol I ran into it while working on https://github.com/aidalgol/valheim-server-flake and https://github.com/nix-community/steam-fetcher, when I needed to change something in steam-fetcher but test it via valheim-server-flake. 23:23:49
@aidalgol:matrix.orgaidalgolThis was before I switched to Lix, though. Let me see if I can make it happen again.23:24:02
@kfears:matrix.orgKFears (annoying)

Oh, reading 2.18 manual, there's this:

When git+file is used without specifying ref or rev, files are fetched directly from the local path as long as they have been added to the Git repository. If there are uncommitted changes, the reference is treated as dirty and a warning is printed.

23:24:21
@aidalgol:matrix.orgaidalgolWhat's the URL for whatever you're reading?23:24:57
@kfears:matrix.orgKFears (annoying) Gahh, I hate it. I also disable warn-dirty because it's so ridiculously noisy for normal workflows... 23:26:33
@aidalgol:matrix.orgaidalgol

OK, here we go. I'm going to abbreviate the repos to vsf and sf. What I did was.

  1. Made a code change in my local checkout of sf (did not stage or commit anything)
  2. In my local vsf checkout, I changed the input for sf to git+file:///path/to/sf
  3. Ran nix flake update sf

This is the git diff of flake.lock in my local vsf checkout.:

diff --git a/flake.lock b/flake.lock
index dae015e..638ec92 100644
--- a/flake.lock
+++ b/flake.lock
@@ -29,17 +29,16 @@
]
},
"locked": {
+        "dirtyRev": "12f66eafb7862d91b3e30c14035f96a21941bd9c-dirty",
+        "dirtyShortRev": "12f66ea-dirty",
"lastModified": 1714795926,
-        "narHash": "sha256-PkgC9jqoN6cJ8XYzTA2PlrWs7aPJkM3BGiTxNqax0cA=",
-        "owner": "nix-community",
-        "repo": "steam-fetcher",
-        "rev": "12f66eafb7862d91b3e30c14035f96a21941bd9c",
-        "type": "github"
+        "narHash": "sha256-nyLyYPhzZ76Gltyeyl3/b4sLPc+W7L7m2BTTT3icyOw=",
+        "type": "git",
+        "url": "file:///home/aidan/src/nix-steam-fetcher"
},
"original": {
-        "owner": "nix-community",
-        "repo": "steam-fetcher",
-        "type": "github"
+        "type": "git",
+        "url": "file:///home/aidan/src/nix-steam-fetcher"
}
}
},
23:30:53
@kfears:matrix.orgKFears (annoying) It will probably be unfixable too, until we can fork off flakes :/
Given that dirty warnings pop up even when the only local flake you have is the one you're directly working with, it seems like self is treated as git+file, and removing the dirty behavior will break iterative improvements on self extremely hard, and replacing git+file with path will probably break too much stuff people are used to
23:32:07
@aidalgol:matrix.orgaidalgol Er, correction. I did not actually do step 3. What causes the flake.lock to be updated is direnv. 23:32:13
@aidalgol:matrix.orgaidalgol I have use flake in .envrc in this repo. 23:32:24
@aidalgol:matrix.orgaidalgolIs direnv supposed to mess with the lock file?23:32:41
@kfears:matrix.orgKFears (annoying)
In reply to @aidalgol:matrix.org

OK, here we go. I'm going to abbreviate the repos to vsf and sf. What I did was.

  1. Made a code change in my local checkout of sf (did not stage or commit anything)
  2. In my local vsf checkout, I changed the input for sf to git+file:///path/to/sf
  3. Ran nix flake update sf

This is the git diff of flake.lock in my local vsf checkout.:

diff --git a/flake.lock b/flake.lock
index dae015e..638ec92 100644
--- a/flake.lock
+++ b/flake.lock
@@ -29,17 +29,16 @@
]
},
"locked": {
+        "dirtyRev": "12f66eafb7862d91b3e30c14035f96a21941bd9c-dirty",
+        "dirtyShortRev": "12f66ea-dirty",
"lastModified": 1714795926,
-        "narHash": "sha256-PkgC9jqoN6cJ8XYzTA2PlrWs7aPJkM3BGiTxNqax0cA=",
-        "owner": "nix-community",
-        "repo": "steam-fetcher",
-        "rev": "12f66eafb7862d91b3e30c14035f96a21941bd9c",
-        "type": "github"
+        "narHash": "sha256-nyLyYPhzZ76Gltyeyl3/b4sLPc+W7L7m2BTTT3icyOw=",
+        "type": "git",
+        "url": "file:///home/aidan/src/nix-steam-fetcher"
},
"original": {
-        "owner": "nix-community",
-        "repo": "steam-fetcher",
-        "type": "github"
+        "type": "git",
+        "url": "file:///home/aidan/src/nix-steam-fetcher"
}
}
},
Oh. So it gets worse
23:32:48
@kfears:matrix.orgKFears (annoying)💀💀💀💀💀💀💀23:32:55
* @aidalgol:matrix.orgaidalgol dies23:33:03
@kfears:matrix.orgKFears (annoying)Thanks for the report, I'll try to document it somewhere23:33:30
@aidalgol:matrix.orgaidalgolIs this worth raising as a bug on the Lix issue tracker just so it's on record?23:33:34
@aidalgol:matrix.orgaidalgolOr I'll leave it to you. :P23:33:38
@kfears:matrix.orgKFears (annoying)I'm not sure that it even makes sense to open a bug D: Seems like a design issue in flakes that we'll have to live with, because actually fixing it will break the universe23:34:18
@kfears:matrix.orgKFears (annoying)
In reply to @aidalgol:matrix.org
Is direnv supposed to mess with the lock file?
I think it is, at least it has been updating my lock files for me for years
23:34:53
@aidalgol:matrix.orgaidalgolYeah, best not to do that until such time as it is worth it for Lix to diverge from CppNix.23:35:16
10 Nov 2024
@kurotoshiro:envs.netkurotoshiro joined the room.13:00:38

Show newer messages


Back to Room ListRoom Version: 10