!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

330 Members
https://github.com/nix-community/poetry2nix62 Servers

Load older messages


SenderMessageTime
14 Aug 2022
@k900:0upti.meK900Generally yes 14:51:00
@ethanabrooks:matrix.orgEthan Brooks

Where can I store these patch files? I'm getting

error: getting status of '/nix/store/8qyfa22w7ci343lx8dy1jkpd4pvxqxl6-source/tensorstore.patch': No such file or directory
14:56:00
@k900:0upti.meK900You need to add it to git 14:56:12
@k900:0upti.meK900For it to work 14:56:14
@ethanabrooks:matrix.orgEthan BrooksPerfect! That worked. Thank you.14:56:35
@ethanabrooks:matrix.orgEthan Brooks I am not 100% sure this is a nix issue but tensorstore/bazelisk.py seems to be trying to download bazel right here: https://github.com/google/tensorstore/blob/fd14f04c33620645da94667c4fa860b258417dcf/bazelisk.py#L449 15:08:28
@ethanabrooks:matrix.orgEthan Brooks

We then get this error:

Downloading https://releases.bazel.build/5.0.0/release/bazel-5.0.0-linux-x86_64...
Traceback (most recent call last):
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/urllib/request.py", line 1346, in d>
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 1285, in requ>
    self._send_request(method, url, body, headers, encode_chunked)
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 1331, in _sen>
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 1280, in endh>
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 1040, in _sen>
    self.send(msg)
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 1447, in conn>
    super().connect()
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/http/client.py", line 946, in conne>
    self.sock = self._create_connection(
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/socket.py", line 823, in create_con>
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/nix/store/9xnq0r2a14s9qc5c27ppzq1p7j8wqx22-python3-3.9.13/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
15:09:10
@k900:0upti.meK900That is normal, the build sandbox has no network15:09:18
@ethanabrooks:matrix.orgEthan BrooksRight ok that makes sense15:09:27
@ethanabrooks:matrix.orgEthan BrooksSo in that case, would it be best to write a patch that uses the nix bazel instead of downloading a new one?15:09:55
@k900:0upti.meK900Can you tell it to use an existing copy of bazel somehow?15:10:03
@ethanabrooks:matrix.orgEthan BrooksLet me play around with it. Should be possible. Thanks.15:10:25
@k900:0upti.meK900We have a bazel in nixpkgs15:10:49
@ethanabrooks:matrix.orgEthan Brooks If I were to write a patch that points to that bazel instead, how would I get the /nix/store/.../bazel path? 15:11:32
@k900:0upti.meK900 ${bazel}/bin/bazel 15:11:59
@k900:0upti.meK900But you can't do that in the patch 15:12:05
@k900:0upti.meK900 Usually you want to patch it to a placeholder like @bazel@ and then substituteInPlace to set it to the actual value 15:12:44
@ethanabrooks:matrix.orgEthan BrooksWhat phase would you recommend for that?15:15:22
@ethanabrooks:matrix.orgEthan Brooks postPatch? 15:15:31
@k900:0upti.meK900Yes15:19:28
@ethanabrooks:matrix.orgEthan BrooksRedacted or Malformed Event15:21:10
@ethanabrooks:matrix.orgEthan Brooks *

This is what I have but it is not performing the replacement correctly:

            postPatch = ''
              export BAZELISK_HOME=$TMPDIR
              substituteInPlace bazelisk.py  --replace '@bazel@' ${pkgs.bazel}
            '';
15:21:25
@ethanabrooks:matrix.orgEthan BrooksRedacted or Malformed Event15:21:27
@ethanabrooks:matrix.orgEthan BrooksOk I think we fixed that error!15:22:37
@ethanabrooks:matrix.orgEthan Brooks

We are now getting:

ERROR: The project you're trying to build requires Bazel 5.0.0 (specified in /build/tensorstore-0.1.22/.bazelversion), but it wasn't found in /nix/store/lkwzv0kxhw915i7j0cdrcvj8r3rficl6-bazel-3.7.2/bin.
15:22:57
@ethanabrooks:matrix.orgEthan BrooksI can look into this a bit15:23:00
@ethanabrooks:matrix.orgEthan Brooks I was able to get past a few more errors, but started running into weird issues with bazel and perl. However I think I may not actually need the tensorstore package after all. 15:59:02
@ethanabrooks:matrix.orgEthan Brooks What I really wanted was the flax library which can work without tensorstore though it disables one minor feature. 15:59:28
@ethanabrooks:matrix.orgEthan Brooks Poetry thinks thinks that tensorstore is a dependency of flax but I was wondering if there was a correct way, via poetry2nix to tell it to ignore tensorstore. Should I patch poetry.lock? 16:00:30
@ethanabrooks:matrix.orgEthan Brooks I will work on a pull request for tensorstore, just need to learn a little more about bazel. Thanks for all your help @K900. 19:30:56

Show newer messages


Back to Room ListRoom Version: 6