!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

306 Members
https://github.com/nix-community/poetry2nix56 Servers

Load older messages


SenderMessageTime
21 Mar 2024
@vengmark2:matrix.org@vengmark2:matrix.orgIt probably does something completely different, but as a developer this whole syntax is incredibly confusing.03:12:29
@charles:computer.surgeryCharlesthat is different03:12:47
@vengmark2:matrix.org@vengmark2:matrix.org Nothing should need to take two references to something else. 03:12:55
@charles:computer.surgeryCharlesthat's a different instance of the same nixpkgs03:13:01
@vengmark2:matrix.org@vengmark2:matrix.orgThat's bad DX03:13:15
@charles:computer.surgeryCharles the difference being that overlays you apply to your own pkgs would not be observable by poetry2nix (or any other flake input) 03:13:28
@charles:computer.surgeryCharlesi don't care, i'm just telling you how it is03:13:33
@vengmark2:matrix.org@vengmark2:matrix.orgThanks for the info03:14:26
@angryant:envs.netAngryAnt
In reply to @latenighticecream:matrix.org
@AngryAnt So i found out that those libraries come from a different python package (https://pypi.org/project/drjit/) which is not available as a nix package. Does this mean I need to create a derivation for this (e.g. using buildPythonPackage) and then put this into the override or can I somehow refer to it using poetry2nix directly?
As l0b0 pointed out, the python packages do not need manual packaging - poetry2nix takes care of that. The only parts you need to manually provide are non-python dependencies, such as the library files which fail to resolve for you.
09:37:01
@latenighticecream:matrix.orglatenighticecream
In reply to@angryant:envs.net
In reply to @latenighticecream:matrix.org
@AngryAnt So i found out that those libraries come from a different python package (https://pypi.org/project/drjit/) which is not available as a nix package. Does this mean I need to create a derivation for this (e.g. using buildPythonPackage) and then put this into the override or can I somehow refer to it using poetry2nix directly?
As l0b0 pointed out, the python packages do not need manual packaging - poetry2nix takes care of that. The only parts you need to manually provide are non-python dependencies, such as the library files which fail to resolve for you.
These library files come from the drjit python package though which does get installed properly. So I am wondering then why it cannot find them. Do I need to add the explicit directory/.so files somehow to an env variable like LD_LIBRARY_PATH?
14:31:48
@angryant:envs.netAngryAnt Ah yes with that package already bringing in the binaries, you should have a look where those binaries end up in the store and add the path to the containing folder to LD_LIBRARY_PATH in your patch for the python package which fails to load them. mitsuba I believe? 15:01:53
@latenighticecream:matrix.orglatenighticecream
In reply to@angryant:envs.net
Ah yes with that package already bringing in the binaries, you should have a look where those binaries end up in the store and add the path to the containing folder to LD_LIBRARY_PATH in your patch for the python package which fails to load them. mitsuba I believe?
ok! Is there a way to specify the ld_library_path env variable inside the override (similar to how buildInputs is specified)?
15:42:25
@angryant:envs.netAngryAntYou should be able to set it quite literally. Though it's been a while since I've done so for a package derivation an not just a shell.15:44:48
@latenighticecream:matrix.orglatenighticecreamAlright, I will try it out later!15:51:02
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.18:03:28
@latenighticecream:matrix.orglatenighticecream I did it (i think)! Setting the LD_LIBRARY_PATH did nothing. But what fixed it for me was to use nativeBuildInputs instead of buildInputs inside the override.. onto the next error :) 18:37:02
@grahamc:nixos.org@grahamc:nixos.org left the room.20:10:04
22 Mar 2024
@mrene:matrix.org@mrene:matrix.org joined the room.00:45:14
23 Mar 2024
@leonardp:matrix.orgleonardp joined the room.15:57:09
@leonardp:matrix.orgleonardphi16:12:19
@leonardp:matrix.orgleonardp i was just trying out the template but ran into: error: stack overflow (possible infinite recursion) 16:13:51
@leonardp:matrix.orgleonardpi've seen some issues on github that point to a similar problem i guess but i couldn't figure out how to work around this16:14:30
@leonardp:matrix.orgleonardpis there a workaround? am i doing something wrong? is the template broken? i am very confused16:16:33
@leonardp:matrix.orgleonardpokaay18:33:55
@leonardp:matrix.orgleonardpafter staring at it for a while i figured it out18:34:07
@leonardp:matrix.orgleonardpalso reading this issue more carefully helped: https://github.com/nix-community/poetry2nix/issues/147118:34:46
@leonardp:matrix.orgleonardp The template project passes the flake self to projectDir, which seems weird to me. 18:34:58
@leonardp:matrix.orgleonardp replacing self with ./. fixed the issue 18:35:25
@reckenrode:matrix.org@reckenrode:matrix.orgRedacted or Malformed Event20:05:25
24 Mar 2024
@latenighticecream:matrix.orglatenighticecream Hey, I'm back with mitsuba problems. My devshell builds fine but when I try to import the module in python, I get this (actually very nice) warning:
WARNING:root:The `mitsuba` package relies on `drjit`
and needs it to be installed at a specific location. 
Currently, `drjit` is located at 
"/nix/store/d0a6r1bz06sd6p5y7cy7dkai9qi8n79w-python3.10-drjit-0.4.4/lib/python3.10/site-packages/drjit"
when it is expected to be at
"/nix/store/9i58bxc70ya01jgq1x1k7843jgv5mjvw-python3.10-mitsuba-3.5.0/lib/python3.10/site-packages/drjit".
This can happen when both packages are not installed in the same Python environment.
You will very likely experience linking issues if you do not fix this.
Which later produces the error:
ImportError: The 'mitsuba' native modules could not be imported.
You're likely trying to use Mitsuba within a Python binary
(/nix/store/0raqv2didf2vabgx1rq6s2qrl9jwp004-python3-3.10.13-env/bin/python3.10)
that is different from the one for which the native module was compiled (/opt/python/cp310-cp310/bin/python).
So drjit is supposed to be over at the mitsuba derivation but it of course has its own. Is there any way to fix this?
Maybe the second output is not even related to this problem?
This is my current override:
overrides = poetry2nix.overrides.withDefaults (final: prev: {

  mitsuba = prev.mitsuba.overridePythonAttrs (old: {
    nativeBuildInputs = (old.buildInputs or [ ]) ++ [ final.drjit ];
    buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libllvm ];
  });
...
10:21:42

Show newer messages


Back to Room ListRoom Version: 6