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: threema-desktop #329108

Closed
eyJhb opened this issue Jul 22, 2024 · 2 comments · Fixed by #335883
Closed

Build failure: threema-desktop #329108

eyJhb opened this issue Jul 22, 2024 · 2 comments · Fixed by #335883
Labels
0.kind: build failure A package fails to build

Comments

@eyJhb
Copy link
Member

eyJhb commented Jul 22, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. Try to build threema-desktop on latest nixos-unstable

Build log

npm error gyp info spawn args [
npm error gyp info spawn args   '/build/source/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args   'binding.gyp',
npm error gyp info spawn args   '-f',
npm error gyp info spawn args   'make',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/build/source/node_modules/node-sass/build/config.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/build/source/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/nix/store/qbkjakl3bbnhjs4jb7c5w1g88jkn1psi-nodejs-20.14.0-source/common.gypi',
npm error gyp info spawn args   '-Dlibrary=shared_library',
npm error gyp info spawn args   '-Dvisibility=default',
npm error gyp info spawn args   '-Dnode_root_dir=/nix/store/qbkjakl3bbnhjs4jb7c5w1g88jkn1psi-nodejs-20.14.0-source',
npm error gyp info spawn args   '-Dnode_gyp_dir=/build/source/node_modules/node-gyp',
npm error gyp info spawn args   '-Dnode_lib_file=/nix/store/qbkjakl3bbnhjs4jb7c5w1g88jkn1psi-nodejs-20.14.0-source/$(Configuration)/node.lib',
npm error gyp info spawn args   '-Dmodule_root_dir=/build/source/node_modules/node-sass',
npm error gyp info spawn args   '-Dnode_engine=v8',
npm error gyp info spawn args   '--depth=.',
npm error gyp info spawn args   '--no-parallel',
npm error gyp info spawn args   '--generator-output',
npm error gyp info spawn args   'build',
npm error gyp info spawn args   '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error   File "/build/source/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm error     import gyp  # noqa: E402
npm error     ^^^^^^^^^^
npm error   File "/build/source/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm error     import gyp.input
npm error   File "/build/source/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm error     from distutils.version import StrictVersion
npm error ModuleNotFoundError: No module named 'distutils'
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack     at ChildProcess.onCpExit (/build/source/node_modules/node-gyp/lib/configure.js:259:16)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Linux 6.6.41
npm error gyp ERR! command "/nix/store/ilkfhnqz4xczrliqjva8770x2svbfznd-nodejs-20.14.0/bin/node" "/build/source/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd /build/source/node_modules/node-sass
npm error gyp ERR! node -v v20.14.0
npm error gyp ERR! node-gyp -v v8.4.1
npm error gyp ERR! not ok
npm error Build failed with error code: 1

npm error Log files were not written due to an error writing to the directory: /nix/store/5iga7spdfrmd5kasix9gvigmfmmx2hx3-threema-web-2.5.3-npm-deps/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
error: builder for '/nix/store/n72xrbgxqx89a75kg9n1r8fnz5d45g40-threema-web-2.5.3.drv' failed with exit code 1;
       last 10 log lines:
       > npm error gyp ERR! System Linux 6.6.41
       > npm error gyp ERR! command "/nix/store/ilkfhnqz4xczrliqjva8770x2svbfznd-nodejs-20.14.0/bin/node" "/build/source/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
       > npm error gyp ERR! cwd /build/source/node_modules/node-sass
       > npm error gyp ERR! node -v v20.14.0
       > npm error gyp ERR! node-gyp -v v8.4.1
       > npm error gyp ERR! not ok
       > npm error Build failed with error code: 1
       >
       > npm error Log files were not written due to an error writing to the directory: /nix/store/5iga7spdfrmd5kasix9gvigmfmmx2hx3-threema-web-2.5.3-npm-deps/_logs
       > npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
       For full logs, run 'nix log /nix/store/n72xrbgxqx89a75kg9n1r8fnz5d45g40-threema-web-2.5.3.drv'.
error: 1 dependencies of derivation '/nix/store/0zf1f2y52s6dgd0raglyyw8rb5flglgp-threema-desktop-consumer-1.2.41.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bfym84qfqg0g5q4il1ppni2qjn6bk70m-threema-desktop-1.2.41.drv' failed to build

Additional context

Issues happens as python3 switched from 3.11 to python 3.12, where disutils doesn't seem to be available.
Look at the PR here for more context, and other packages with similar issues #320924 .

Currently I've solved it locally just by using Python 3.11 instead of 3.12, using the following override.

  threema-desktop-override = pkgs.threema-desktop.override (oldAttrs: {
    python3 = pkgs.python311;
  });

Ideally we should get threema-web to update their gyp version? Or we could do it ourself? OR we have something something nodePackages.node-gyp, which we should maybe use? Unsure.

Notify maintainers

@eyJhb eyJhb added the 0.kind: build failure A package fails to build label Jul 22, 2024
@WolfangAukang
Copy link
Contributor

I am not maintaining any packages on Nixpkgs anymore, but another solution to this would be adding setuptools, like on #325909

@eyJhb
Copy link
Member Author

eyJhb commented Jul 22, 2024

Sorry, I thought I had checked if you were maintainer for it still. Wasn't meant to bother you :)

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.

2 participants