!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

402 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.135 Servers

Load older messages


SenderMessageTime
28 Oct 2025
@lillecarl:matrix.orglillecarl *
diff --git a/lix/libstore/local-store.cc b/lix/libstore/local-store.cc
index d7cfe6874..865d4e030 100644
--- a/lix/libstore/local-store.cc
+++ b/lix/libstore/local-store.cc
@@ -73,6 +73,7 @@ struct LocalStore::DBState::Stmts {
     SQLiteStmt QueryDerivationOutputs;
     SQLiteStmt QueryPathFromHashPart;
     SQLiteStmt QueryValidPaths;
+    SQLiteStmt UpdateRegTime;
 };
 
 int getSchema(Path schemaPath)
@@ -296,7 +297,7 @@ void LocalStore::prepareStatements(DBState & state)
     state.stmts->RegisterValidPath = state.db.create(
         "insert into ValidPaths (path, hash, registrationTime, deriver, narSize, ultimate, sigs, ca) values (?, ?, ?, ?, ?, ?, ?, ?);");
     state.stmts->UpdatePathInfo = state.db.create(
-        "update ValidPaths set narSize = ?, hash = ?, ultimate = ?, sigs = ?, ca = ? where path = ?;");
+        "update ValidPaths set narSize = ?, hash = ?, ultimate = ?, sigs = ?, ca = ?, registrationTime = unixepoch() where path = ?;");
     state.stmts->AddReference = state.db.create(
         "insert or replace into Refs (referrer, reference) values (?, ?);");
     state.stmts->QueryPathInfo = state.db.create(
@@ -318,6 +319,7 @@ void LocalStore::prepareStatements(DBState & state)
     state.stmts->QueryPathFromHashPart = state.db.create(
         "select path from ValidPaths where path >= ? limit 1;");
     state.stmts->QueryValidPaths = state.db.create("select path from ValidPaths");
+    state.stmts->UpdateRegTime= state.db.create("update ValidPaths set registrationTime = unixepoch() where path = ?;");
 }
 
 
@@ -715,6 +717,7 @@ try {
 
 std::shared_ptr<const ValidPathInfo> LocalStore::queryPathInfoInternal(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     /* Get the path info. */
     auto useQueryPathInfo(state.stmts->QueryPathInfo.use()(printStorePath(path)));
 
@@ -779,6 +782,7 @@ void LocalStore::updatePathInfo(DBState & state, const ValidPathInfo & info)
 
 uint64_t LocalStore::queryValidPathId(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     auto use(state.stmts->QueryPathInfo.use()(printStorePath(path)));
     if (!use.next()) // TODO: I guess if SQLITE got corrupted..?
         throw InvalidPath("path '%s' does not exist in the Lix database", printStorePath(path));
@@ -788,6 +792,7 @@ uint64_t LocalStore::queryValidPathId(DBState & state, const StorePath & path)
 
 bool LocalStore::isValidPath_(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     return state.stmts->QueryPathInfo.use()(printStorePath(path)).next();
 }
 

~~How on earth does this not update registrationTime on a package when I build it?~~ AAaaaaaaa I'm running the Nixpkgs daemon. It's getting too late πŸ€”

01:57:59
@lillecarl:matrix.orglillecarl *
diff --git a/lix/libstore/local-store.cc b/lix/libstore/local-store.cc
index d7cfe6874..865d4e030 100644
--- a/lix/libstore/local-store.cc
+++ b/lix/libstore/local-store.cc
@@ -73,6 +73,7 @@ struct LocalStore::DBState::Stmts {
     SQLiteStmt QueryDerivationOutputs;
     SQLiteStmt QueryPathFromHashPart;
     SQLiteStmt QueryValidPaths;
+    SQLiteStmt UpdateRegTime;
 };
 
 int getSchema(Path schemaPath)
@@ -296,7 +297,7 @@ void LocalStore::prepareStatements(DBState & state)
     state.stmts->RegisterValidPath = state.db.create(
         "insert into ValidPaths (path, hash, registrationTime, deriver, narSize, ultimate, sigs, ca) values (?, ?, ?, ?, ?, ?, ?, ?);");
     state.stmts->UpdatePathInfo = state.db.create(
-        "update ValidPaths set narSize = ?, hash = ?, ultimate = ?, sigs = ?, ca = ? where path = ?;");
+        "update ValidPaths set narSize = ?, hash = ?, ultimate = ?, sigs = ?, ca = ?, registrationTime = unixepoch() where path = ?;");
     state.stmts->AddReference = state.db.create(
         "insert or replace into Refs (referrer, reference) values (?, ?);");
     state.stmts->QueryPathInfo = state.db.create(
@@ -318,6 +319,7 @@ void LocalStore::prepareStatements(DBState & state)
     state.stmts->QueryPathFromHashPart = state.db.create(
         "select path from ValidPaths where path >= ? limit 1;");
     state.stmts->QueryValidPaths = state.db.create("select path from ValidPaths");
+    state.stmts->UpdateRegTime= state.db.create("update ValidPaths set registrationTime = unixepoch() where path = ?;");
 }
 
 
@@ -715,6 +717,7 @@ try {
 
 std::shared_ptr<const ValidPathInfo> LocalStore::queryPathInfoInternal(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     /* Get the path info. */
     auto useQueryPathInfo(state.stmts->QueryPathInfo.use()(printStorePath(path)));
 
@@ -779,6 +782,7 @@ void LocalStore::updatePathInfo(DBState & state, const ValidPathInfo & info)
 
 uint64_t LocalStore::queryValidPathId(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     auto use(state.stmts->QueryPathInfo.use()(printStorePath(path)));
     if (!use.next()) // TODO: I guess if SQLITE got corrupted..?
         throw InvalidPath("path '%s' does not exist in the Lix database", printStorePath(path));
@@ -788,6 +792,7 @@ uint64_t LocalStore::queryValidPathId(DBState & state, const StorePath & path)
 
 bool LocalStore::isValidPath_(DBState & state, const StorePath & path)
 {
+    state.stmts->UpdateRegTime.use()(printStorePath(path)).exec();
     return state.stmts->QueryPathInfo.use()(printStorePath(path)).next();
 }
 

How on earth does this not update registrationTime on a package when I build it? Edit: AAaaaaaaa I'm running the Nixpkgs daemon. It's getting too late πŸ€”

01:58:34
@lillecarl:matrix.orglillecarl
[lillecarl@shitbox] in [☸ kubernetes-admin@shitbox (nix-csi)]~/C/lix [πŸŽ‹ main][!][πŸ¦€ v1.86.0][❄️  impure (lix-shell-env-env)][πŸ—€ loaded/allowed][🐚fish][asπŸ§™]
[03:00:38]❯ sudo -E ./build/lix/nix/nix path-info --store local /nix/store/0fc5496qwndd1m5lhxk58alv28ga0dn4-manifest.json --json | jq '.[0].registrationTime'
warning: $HOME ('/home/lillecarl') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
1761616839
[lillecarl@shitbox] in [☸ kubernetes-admin@shitbox (nix-csi)]~/C/lix [πŸŽ‹ main][!][πŸ¦€ v1.86.0][❄️  impure (lix-shell-env-env)][πŸ—€ loaded/allowed][🐚fish][asπŸ§™]
[03:00:39]❯ sudo -E ./build/lix/nix/nix path-info --store local /nix/store/0fc5496qwndd1m5lhxk58alv28ga0dn4-manifest.json --json | jq '.[0].registrationTime'
warning: $HOME ('/home/lillecarl') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
1761616840

That's more like it, thanks!

02:01:13
@shine:proqqul.netTaeer Bar-Yam joined the room.22:47:00
29 Oct 2025
@lillecarl:matrix.orglillecarl#maybe I was painting with a bit of a broad brush, when I implemented that update "so low" any command and his uncle will update regtime, can't query the store at all without touching πŸ˜„ I'm happy to see it working though10:53:16
30 Oct 2025
@yeti_:matrix.orgyeti_ joined the room.20:00:45
31 Oct 2025
@e-flex:matrix.orge-flex joined the room.10:44:58
2 Nov 2025
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud changed their display name from whispers to whispers (it/fae).17:58:04
4 Nov 2025
@whispers:catgirl.cloudwhispers (it/fae) joined the room.00:45:19
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud left the room.00:48:30
@yamabukiiro:matrix.orgyamabukiiro joined the room.03:27:54
@cafkafk:gitter.imcafkafk changed their profile picture.08:23:31
5 Nov 2025
@ulysseszhan:matrix.orgUlyssesZhan joined the room.04:57:23
@aleksi:pikaviestin.fialeksi joined the room.11:39:05
@k900:0upti.meK900So uh I just tried to yolo update to staging-next17:42:34
@k900:0upti.meK900And I think something is bork17:42:36
@k900:0upti.meK900Because my Lix does not17:42:40
@k900:0upti.meK900
113/139 lix:installcheck / functional-substitute-truncated-nar                      FAIL            0.60s   exit status 1
>>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_BUILD_ROOT=/build/source/build MALLOC_PERTURB_=209 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /nix/store/bwl0kc22rdai48lhf9jg4x4x240kmg84-python3-3.13.9-env/bin/python3 /build/source/meson/run-test.py substitute-truncated-nar.sh
 βœ€  
stdout:
[FAIL]
stderr:
++(common/vars-and-functions.sh:314) trap onError ERR
+(init.sh:6) test -n /build/nix-test/substitute-truncated-nar
+(init.sh:7) test -d /build/nix-test/substitute-truncated-nar
+(init.sh:8) chmod -R u+w /build/nix-test/substitute-truncated-nar
+(init.sh:10) killDaemon
+(common/vars-and-functions.sh:122) [[ '' == '' ]]
+(common/vars-and-functions.sh:123) return
+(init.sh:11) rm -rf /build/nix-test/substitute-truncated-nar
+(init.sh:13) mkdir /build/nix-test/substitute-truncated-nar
+(init.sh:15) mkdir /build/nix-test/substitute-truncated-nar/store
+(init.sh:16) mkdir /build/nix-test/substitute-truncated-nar/var
+(init.sh:17) mkdir -p /build/nix-test/substitute-truncated-nar/var/log/nix/drvs
+(init.sh:18) mkdir /build/nix-test/substitute-truncated-nar/var/nix
+(init.sh:19) mkdir /build/nix-test/substitute-truncated-nar/etc
+(init.sh:21) cat
++(init.sh:21) whoami
+(init.sh:35) cat
+(init.sh:42) nix-store --init
+(init.sh:45) test -e /build/nix-test/substitute-truncated-nar/var/nix/db/db.sqlite
+++(/build/source/build/tests/functional/common/vars-and-functions.sh:314) trap onError ERR
++(common.sh:8) [[ -n '' ]]
+(substitute-truncated-nar.sh:3) BINARY_CACHE=file:///build/nix-test/substitute-truncated-nar/binary-cache
++(substitute-truncated-nar.sh:14) build
++(substitute-truncated-nar.sh:6) nix-build --no-out-link --expr $'derivation {\n        name = "text";\n        system = builtins.currentSystem;\n        builder = "/bin/sh";\n        args = [ "-c" "echo some text to make the nar less empty > $out" ];\n    }'
this derivation will be built:
  /build/nix-test/substitute-truncated-nar/store/xv50b2m33ys1574a8xlkbbxxhkywjpfi-text.drv
building '/build/nix-test/substitute-truncated-nar/store/xv50b2m33ys1574a8xlkbbxxhkywjpfi-text.drv'...
+(substitute-truncated-nar.sh:14) path=/build/nix-test/substitute-truncated-nar/store/phq31ijvr3g0y2wdnq55cmrawaawlf03-text
+(substitute-truncated-nar.sh:15) nix copy --to file:///build/nix-test/substitute-truncated-nar/binary-cache /build/nix-test/substitute-truncated-nar/store/phq31ijvr3g0y2wdnq55cmrawaawlf03-text
warning: you don't have Internet access; disabling some network-dependent features
copying 1 paths...
copying path '/build/nix-test/substitute-truncated-nar/store/phq31ijvr3g0y2wdnq55cmrawaawlf03-text' to 'file:///build/nix-test/substitute-truncated-nar/binary-cache'...
+(substitute-truncated-nar.sh:16) nix-collect-garbage
+(substitute-truncated-nar.sh:18) nar=0c3y7p42issm0ydjilwvk0drv958p4p4d2d6c7y5ksmzmbf7rfhg.nar.zst
+(substitute-truncated-nar.sh:20) '[' -e /build/nix-test/substitute-truncated-nar/binary-cache/nar/0c3y7p42issm0ydjilwvk0drv958p4p4d2d6c7y5ksmzmbf7rfhg.nar.zst ']'
+(substitute-truncated-nar.sh:20) fail 'long nar missing?'
+(/build/source/build/tests/functional/common/vars-and-functions.sh:193) echo 'long nar missing?'
long nar missing?
+(/build/source/build/tests/functional/common/vars-and-functions.sh:194) exit 1
17:54:19
@k900:0upti.meK900This sure smells like curl17:54:23
@k900:0upti.meK900Ah no this is just https://git.lix.systems/lix-project/lix/issues/102717:56:13
@k900:0upti.meK900/me updates17:56:16
@kloenk:kloenk.eukloenk what is the current state of rust in lix? I see/know there is lix-doc. but is that something that wants to get removed (saw the consumer saying some TODO that I did not fully understand).
end question would be is it acceptable to write other features in rust or should as much as possible still be C++?
22:34:37
@k900:0upti.meK900The problem with writing features in Rust is mostly that there's no bindings to the C++ bits22:37:47
@k900:0upti.meK900And the C++ bits are increasingly relying on coroutines via kj which basically don't FFI22:38:23
@k900:0upti.meK900So you could write things in Rust, but those things need to either expose a sync C API surface or communicate over some sort of currently-not-existent RPC mechanism22:39:34
@kloenk:kloenk.eukloenkraito nerdsniped me to write a new log format (like the multiline I did years ago). Kinda don't have the time for that, but wonderd if I can just forward all the data to rust and do the actuall handling of all the printing in rust22:42:47
@k900:0upti.meK900Will have to build some sort of RPC layer for this22:44:29
@k900:0upti.meK900Probably22:44:40
@kloenk:kloenk.eukloenkFrom what I remember I think I could do most stuff with just a sync C abi. but also might have changed. but sounds like in general I can look into it (should I find the time for it :))22:45:39
6 Nov 2025
@raitobezarius:matrix.orgraitobezariusblocked on ability for rustc to tell us what we need to do wrt linkage to meson01:02:06

Show newer messages


Back to Room ListRoom Version: 10