!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

314 Members
https://github.com/nix-community/poetry2nix59 Servers

Load older messages


SenderMessageTime
6 Nov 2023
@matthewcroughan:defenestrate.itmatthewcroughan * poetry2nix still reduces the amount of code required to build something, massively 18:06:05
@matthewcroughan:defenestrate.itmatthewcroughanBut in this case, all you have to do is generate a Cargo.lock, and give it to Nix.18:06:28
@matthewcroughan:defenestrate.itmatthewcroughanWhen you use pip, etc, you're just delaying the inevitable undebuggable, boring, uninteresting pipeline issues that only exist because people aren't defining their dependencies clearly18:07:20
@matthewcroughan:defenestrate.itmatthewcroughanand when you run into such an issue, you'll just have to wipe it and start over, because you can't share that with anyone, the issue would be unique to your personal environment.18:07:42
@pareto-optimal-dev:matrix.orgpareto-optimal-dev
In reply to @matthewcroughan:defenestrate.it
But in this case, all you have to do is generate a Cargo.lock, and give it to Nix.
Which isn't too hard, and is manageable to figure out... the issue comes when it is "how do I generate a cargo.lock and tell poetry2nix about it". At least it's those kinds of integration issues that usually take time for me.
18:08:33
@matthewcroughan:defenestrate.itmatthewcroughanSo the difference is being able to reproduce something because it was defined correctly in the first place, vs pure experimentation and unreproducible environments that you cannot share with anyone 18:09:14
@matthewcroughan:defenestrate.itmatthewcroughan
In reply to @pareto-optimal-dev:matrix.org
Which isn't too hard, and is manageable to figure out... the issue comes when it is "how do I generate a cargo.lock and tell poetry2nix about it". At least it's those kinds of integration issues that usually take time for me.
Not hard, just have to learn Nix
18:09:29
@matthewcroughan:defenestrate.itmatthewcroughanAnd also the build system for Rust.18:09:42
@matthewcroughan:defenestrate.itmatthewcroughanIf you don't like that, you need to complain upstream and ask why they used Rust and Python together.18:09:56
@matthewcroughan:defenestrate.itmatthewcroughanAlternatively write your own code, or stop using their code.18:10:07
@matthewcroughan:defenestrate.itmatthewcroughanDo you see now how this has nothing to do with Nix, just software in general?18:10:29
@pareto-optimal-dev:matrix.orgpareto-optimal-dev
In reply to @matthewcroughan:defenestrate.it
Not hard, just have to learn Nix
Well, I know Nix the language, and I know how to use Nix for Haskell... it's just hard to transfer that knowledge. I guess though learning the build system is a big part of the complexity too.
18:10:46
@matthewcroughan:defenestrate.itmatthewcroughanSome software has fundamental complexity that will not be resolved or masked by any tool if you actually want to reproduce it 18:11:38
@matthewcroughan:defenestrate.itmatthewcroughanThe only alternative to reproducing something, is to give someone something you built, an artifact, and that's not correct.18:11:51
@pareto-optimal-dev:matrix.orgpareto-optimal-devI don't think we disagree about anything really?18:12:15
@matthewcroughan:defenestrate.itmatthewcroughanSo if you want to reproduce something, it's going to be hard. Nix lowers the barrier to entry, but it's a scientific endeavour, which requires research, development, time, effort 18:12:33
@matthewcroughan:defenestrate.itmatthewcroughanOnce you have a derivation, nobody can take that away from you, but it can take days, months, years, depends.18:13:28
@matthewcroughan:defenestrate.itmatthewcroughanhttps://sourcegraph.com/search?q=context:global+lang:Nix+AND+maturin&patternType=standard&sm=118:14:19
@matthewcroughan:defenestrate.itmatthewcroughanHere's what I did when I couldn't figure out how the maturin hook worked 18:14:28
@matthewcroughan:defenestrate.itmatthewcroughanI went to sourcegraph, and looked through code that already existed that solved the same problem, then copy pasted it 18:14:42
@matthewcroughan:defenestrate.itmatthewcroughanBut that person probably spent hours on it 18:14:58
@pareto-optimal-dev:matrix.orgpareto-optimal-dev
In reply to @matthewcroughan:defenestrate.it
https://sourcegraph.com/search?q=context:global+lang:Nix+AND+maturin&patternType=standard&sm=1
Thanks. I do use sourcegraph for that. If using flakes, I find it useful to also specify path:flake.nix. Yeah, they probably spent a while.
18:15:43
@matthewcroughan:defenestrate.itmatthewcroughanI just built tiktoken anyway 18:16:01
@matthewcroughan:defenestrate.itmatthewcroughan
                tiktoken = super.tiktoken.overridePythonAttrs
                  (
                    old: {
                      postPatch = ''
                        ln -s ${./nix/tiktoken/Cargo.lock} Cargo.lock
                       '';
                      cargoDeps = pkgs.rustPlatform.importCargoLock {
                        lockFile = ./nix/tiktoken/Cargo.lock;
                      };
                      nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
                        pkgs.rustPlatform.cargoSetupHook
                        pkgs.rustPlatform.maturinBuildHook
                      ];
                    }
                  );

18:16:23
@matthewcroughan:defenestrate.itmatthewcroughanpoetry2nix cannot just package things of this complexity for you, yet 18:16:41
@matthewcroughan:defenestrate.itmatthewcroughansuddenly, people start using rust and python together, and they start making new tools to deal with that and build that, it cannot be expected of poetry2nix to automatically deal with this new emerging class of usage18:17:28
@matthewcroughan:defenestrate.itmatthewcroughan Is there even enough input information in the src to do it? 18:17:56
@matthewcroughan:defenestrate.itmatthewcroughanAnother annoying thing seems to be that the Cargo.lock is available if you get it from pypi, but not from github 18:19:39
@pareto-optimal-dev:matrix.orgpareto-optimal-dev
In reply to @matthewcroughan:defenestrate.it
Another annoying thing seems to be that the Cargo.lock is available if you get it from pypi, but not from github
In the issue above they were less resistant to adding it to pypi releases.
18:20:09
@pareto-optimal-dev:matrix.orgpareto-optimal-dev
In reply to @matthewcroughan:defenestrate.it
                tiktoken = super.tiktoken.overridePythonAttrs
                  (
                    old: {
                      postPatch = ''
                        ln -s ${./nix/tiktoken/Cargo.lock} Cargo.lock
                       '';
                      cargoDeps = pkgs.rustPlatform.importCargoLock {
                        lockFile = ./nix/tiktoken/Cargo.lock;
                      };
                      nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
                        pkgs.rustPlatform.cargoSetupHook
                        pkgs.rustPlatform.maturinBuildHook
                      ];
                    }
                  );

Do you generate /nix/tiktoken/Cargo.lock yourself?
18:21:07

Show newer messages


Back to Room ListRoom Version: 6