NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

Build failure: GNS3, problem with python #299447

Closed Kahlenden closed 7 months ago

Kahlenden commented 7 months ago

Steps To Reproduce

Steps to reproduce the behavior:

users.users.myuser = {
        packages = with pkgs; [ 
        gns3-gui 
        ];
};
environment.systemPackages = with pkgs; [
        gns3-server
];

Build log

error: builder for '/nix/store/86jsc2db9z9gaw6myvdz7cz7am8ak993-gns3-server-2.2.46.drv' failed with exit code 1;
       last 10 log lines:
       >   /nix/store/7wz6hm9i8wljz0hgwz1wqmn2zlbgavrq-python3-3.11.8/lib/python3.11/pathlib.py:871: RuntimeWarning: coroutine 'AsyncioBytesIO.close' was never awaited
       >     self = cls._from_parts(args)
       >   Enable tracemalloc to get traceback where the object was allocated.
       >   See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
       >
       > -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
       > =========================== short test summary info ============================
       > FAILED tests/compute/qemu/test_qemu_manager.py::test_create_image_with_not_supported_characters_by_filesystem - UnicodeEncodeError: 'error' codec can't encode characters in position 1-1: ...
       > = 1 failed, 901 passed, 1 skipped, 1 deselected, 449 warnings, 3 rerun in 126.80s (0:02:06) =
       > /nix/store/c8dj731bkcdzhgrpawhc8qvdgls4xfjv-stdenv-linux/setup: line 1578: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/86jsc2db9z9gaw6myvdz7cz7am8ak993-gns3-server-2.2.46.drv'.
error: 1 dependencies of derivation '/nix/store/d92qqfwmprjws5nlx7rlxfgbd8hwqgqx-gns3-server-2.2.46_fish-completions.drv' failed to build

Additional context

after switching between commits in nixpkgs, this commit is what caused the problem https://github.com/NixOS/nixpkgs/commit/b3bced21a8acebb9e8777c5af8de851c49d8637e my temporary fix for now is reverting back a commit, to 093051473fd84cce950f574e77754353a5731463

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.6.22, NixOS, 24.05 (Uakari), 24.05.20240321.0930514`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/rplv9glv7gy3a10kwqdkhmfsfjp63wmy-source`

Add a :+1: reaction to issues you find important.

nixos-discourse commented 7 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/gns3-build-failed/42256/3

anthonyroussel commented 7 months ago

Hello, thanks for reporting this issue! :)

After investigation, I think the reason of our failing gns3-server build is the upgrade of pytest to 8.x: https://github.com/nixos/nixpkgs/commit/92c34d01035c

diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix
index ae792037e453..f9939000f744 100644
--- a/pkgs/applications/networking/gns3/server.nix
+++ b/pkgs/applications/networking/gns3/server.nix
@@ -66,7 +66,7 @@ python3.pkgs.buildPythonApplication {
   checkInputs = with python3.pkgs; [
     pytest-aiohttp
     pytest-rerunfailures
-    pytestCheckHook
+    (pytestCheckHook.override { pytest = pytest_7; })
   ];

   pytestFlagsArray = [

Looks like a resolution is to downgrade pytest to 7.x for gns3-server so that the build passes.

We can set the version while waiting for a patch upstream. I'll create a PR with this temporary fix.

anthonyroussel commented 7 months ago

The PR is here: https://github.com/NixOS/nixpkgs/pull/299853

anthonyroussel commented 7 months ago

Build pass: https://hydra.nixos.org/build/255496086