!VRULIdgoKmKPzJZzjj:nixos.org

Nix Package Manager development

837 Members
For people hacking on Nix: https://github.com/NixOS/nix Nix maintainers can be reached here.180 Servers

Load older messages


SenderMessageTime
15 Aug 2025
@fzakaria:one.ems.hostfzakaria

Sergei Zimmerman (xokdvium): i finished https://github.com/NixOS/nix/pull/13757

John Ericson i kind of went a bit wild in that and used c++ to setup the test case... There's so little examples of how to setup a Store etc.. in a unit test.
I wanted to see what that's like rather than just a functional bash test.

05:22:12
@fzakaria:one.ems.hostfzakaria1 line fix, 200 line test05:22:52
@Ericson2314:matrix.orgJohn Ericsonthere is a GTest class in libstore test support that opens a store btw05:24:05
@Ericson2314:matrix.orgJohn Ericsonmaybe that will help?05:24:09
@Ericson2314:matrix.orgJohn Ericson* there is a GTest class in libstore-test-support that opens a store btw05:24:21
@Ericson2314:matrix.orgJohn Ericson I forget whether it is a dummy:// store 05:24:28
@Ericson2314:matrix.orgJohn Ericson(got to go to bed now, though)05:26:08
@fzakaria:one.ems.hostfzakariagnight! I think the Input has to actually write to the store ? so dummy:// isn't good enough (i think?)05:27:54
@fzakaria:one.ems.hostfzakaria I thought maybe there could be memory:// but I got it all working... the auto registering of things so you can just do "auto" was really confusing to learn 05:28:21
@Ericson2314:matrix.orgJohn EricsonI have a draft PR for that05:36:32
@Ericson2314:matrix.orgJohn Ericsonor maybe it's not even draft05:36:38
@Ericson2314:matrix.orgJohn Ericsonfeel free to go take it05:36:43
@Ericson2314:matrix.orgJohn Ericsonwe just needed a use-case for it, and now we have one05:36:50
@Ericson2314:matrix.orgJohn Ericson(it was always gonna be unit testing)05:37:02
@perpetrator1:matrix.orgmuneer changed their profile picture.10:32:21
@fzakaria:one.ems.hostfzakariai can take it up after; right now having the store be temporary directory for just fetching inputs feels okay -- but I want it.15:35:40
@fzakaria:one.ems.hostfzakariais there a way to use Nix as a C++ lib in a separate project?15:35:49
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @fzakaria:one.ems.host
is there a way to use Nix as a C++ lib in a separate project?
Pretty easy to do so. Just needs pkg-config integration in your build system. I assume you are going to use bazel?
15:44:21
@fzakaria:one.ems.hostfzakariaNo; i'm happy to use Meson, Cmake or w/e. (Bazel would be cool though) Having a nix derivation that builds it even cooler.15:48:42
@fzakaria:one.ems.hostfzakaria(I'm not familiar with pkg-config) One more question: How does one run a particular flake check only. I'm trying to validate a check that is failing15:49:12
@fzakaria:one.ems.hostfzakaria
nix build -f flake.nix checks.x86_64-linux.nix-fetchers-tests-run
error: attribute 'checks' in selection path 'checks.x86_64-linux.nix-fetchers-tests-run' not found
15:50:35
@dramforever:matrix.orgdramforever nix build .#checks.x86_64-linux.nix-fetchers-tests-run 15:51:50
@fzakaria:one.ems.hostfzakariaty15:51:56
@dramforever:matrix.orgdramforeverquote that if you shell doesn't like it15:52:08
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Both cmake and meson are pretty easy to set up. Recent enough cmake made this much easier with https://cmake.org/cmake/help/latest/module/FindPkgConfig.html15:54:20
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) You can also do nix build -f . checks.x86_64-linux.nix-fetchers-tests-run, since we are using flake-compat 15:55:14
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Or (nix-build)15:55:30
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)* Or nix-build15:55:36
@fzakaria:one.ems.hostfzakaria it assumes it was installed on the system ?
So Nix installed via the system will install the shared libraries and headers or is there a -dev version needed.
15:56:09
@fzakaria:one.ems.hostfzakaria (If i were to use Nix as a buildInput) 15:56:21

Show newer messages


Back to Room ListRoom Version: 6