Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: dooit #330380

Closed
ArtemChandragupta opened this issue Jul 27, 2024 · 4 comments · Fixed by #330518
Closed

Build failure: dooit #330380

ArtemChandragupta opened this issue Jul 27, 2024 · 4 comments · Fixed by #330518
Labels
0.kind: build failure A package fails to build

Comments

@ArtemChandragupta
Copy link

Steps To Reproduce

Steps to reproduce the behavior:

  1. build dooit

Build log

> Building NixOS configuration
error:
       … while calling the 'head' builtin

         at /nix/store/xblysc3prg1zqsi59fr36nj6wdiqryzp-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/xblysc3prg1zqsi59fr36nj6wdiqryzp-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: tree-sitter0_21-0.21.3 not supported for interpreter python3.12

Additional context

I use nixos-unstable. NixVim and Helix with tree-sitter are not the cause of an issue, I can do a rebuild with them, error occurs then I add dooit.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

- system: `"x86_64-linux"`
 - host os: `Linux 6.10.0, NixOS, 24.11 (Vicuna), 24.11.20240725.5ad6a14`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/xblysc3prg1zqsi59fr36nj6wdiqryzp-source`

Add a 👍 reaction to issues you find important.

@ArtemChandragupta ArtemChandragupta added the 0.kind: build failure A package fails to build label Jul 27, 2024
@ghpzin
Copy link
Contributor

ghpzin commented Jul 27, 2024

If you do not ping listed maintainers for dooit package (ie in Notify maintainers) they are not going to see this issue.

Ping:
@khaneliman @wesleyjrz

Log with full chain:

error:
       … while evaluating derivation 'dooit-2.2.0'
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'dooit-2.2.0'
       … while evaluating derivation 'python3.12-textual-0.72.0'
       … while evaluating attribute 'nativeBuildInputs' of derivation 'python3.12-textual-0.72.0'
       … while evaluating derivation 'python3.12-tree-sitter-languages-1.10.2'
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'python3.12-tree-sitter-languages-1.10.2'
       error: tree-sitter0_21-0.21.3 not supported for interpreter python3.12

I assume from this fix for autotools-language-server (tree-sitter0_21 was added with it in #316901):
#326135
the intended way to fix it is to use python311 for dooit and not fix tree-sitter0_21 build for python 3.12.

diff --git a/pkgs/by-name/do/dooit/package.nix b/pkgs/by-name/do/dooit/package.nix
index ea549fff7196..bdc54b3f5dee 100644
--- a/pkgs/by-name/do/dooit/package.nix
+++ b/pkgs/by-name/do/dooit/package.nix
@@ -1,11 +1,14 @@
 { lib
 , fetchFromGitHub
 , dooit
-, python3
+, python311
 , testers
 , nix-update-script
 }:

+let
+  python3 = python311;
+in
 python3.pkgs.buildPythonApplication rec {
   pname = "dooit";
   version = "2.2.0";

@ArtemChandragupta
Copy link
Author

Oh, sorry, I made a mistake with the formatting when I mentioned the package maintainer, I left it in the comment

@khaneliman
Copy link
Contributor

If you do not ping listed maintainers for dooit package (ie in Notify maintainers) they are not going to see this issue.

Ping: @khaneliman @wesleyjrz

Log with full chain:

error:
       … while evaluating derivation 'dooit-2.2.0'
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'dooit-2.2.0'
       … while evaluating derivation 'python3.12-textual-0.72.0'
       … while evaluating attribute 'nativeBuildInputs' of derivation 'python3.12-textual-0.72.0'
       … while evaluating derivation 'python3.12-tree-sitter-languages-1.10.2'
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'python3.12-tree-sitter-languages-1.10.2'
       error: tree-sitter0_21-0.21.3 not supported for interpreter python3.12

I assume from this fix for autotools-language-server (tree-sitter0_21 was added with it in #316901): #326135 the intended way to fix it is to use python311 for dooit and not fix tree-sitter0_21 build for python 3.12.

diff --git a/pkgs/by-name/do/dooit/package.nix b/pkgs/by-name/do/dooit/package.nix
index ea549fff7196..bdc54b3f5dee 100644
--- a/pkgs/by-name/do/dooit/package.nix
+++ b/pkgs/by-name/do/dooit/package.nix
@@ -1,11 +1,14 @@
 { lib
 , fetchFromGitHub
 , dooit
-, python3
+, python311
 , testers
 , nix-update-script
 }:

+let
+  python3 = python311;
+in
 python3.pkgs.buildPythonApplication rec {
   pname = "dooit";
   version = "2.2.0";
``

Sorry, I forgot to come back to this... I was trying to see if I could fix textual/tree-sitter-languages/tree-sitter0_21 chain with python312. We can pin to 311 in the meantime.

@ghpzin
Copy link
Contributor

ghpzin commented Jul 27, 2024

That one seems to be relatively simple too
(fabaff had upstream pr - tree-sitter/py-tree-sitter#214 replacing distutils with setuptools).
So something like this makes it build with python 3.12:

tree-sitter0_21 patch
diff --git a/pkgs/development/python-modules/tree-sitter0_21/default.nix b/pkgs/development/python-modules
index 665f7d6b56ce..76eaee6b0cba 100644
--- a/pkgs/development/python-modules/tree-sitter0_21/default.nix
+++ b/pkgs/development/python-modules/tree-sitter0_21/default.nix
@@ -4,8 +4,8 @@
   fetchFromGitHub,
   pytestCheckHook,
   pythonOlder,
-  pythonAtLeast,
   setuptools,
+  fetchpatch2,
 }:

 buildPythonPackage rec {
@@ -13,8 +13,7 @@ buildPythonPackage rec {
   version = "0.21.3";
   pyproject = true;

-  # https://github.com/tree-sitter/py-tree-sitter/issues/209
-  disabled = pythonAtLeast "3.12" || pythonOlder "3.7";
+  disabled = pythonOlder "3.7";

   src = fetchFromGitHub {
     owner = "tree-sitter";
@@ -24,10 +23,20 @@ buildPythonPackage rec {
     fetchSubmodules = true;
   };

+  # https://github.com/tree-sitter/py-tree-sitter/pull/214
+  patches = [
+    (fetchpatch2 {
+      url = "https://github.com/tree-sitter/py-tree-sitter/commit/80d3cae493c4a47e49cc1d2ebab0a8eaf7617825.patch?full_index=1";
+      hash = "sha256-RqZGdUwfX04ICHZNvPbWZiuNI15RPlJkVfW17k6V7iA=";
+    })
+  ];
+
   build-system = [ setuptools ];

   nativeCheckInputs = [ pytestCheckHook ];

+  dependencies = [ setuptools ];
+
   pythonImportsCheck = [ "tree_sitter" ];

   preCheck = ''

It was not accepted upstream, but they fully changed these parts around v0.23 so there is no distutils used anymore.
I am not sure if tree-sitter0_21 needs to be in this pinned state building with only python 3.11 for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants