NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.15k stars 14.18k forks source link

gcc-arm-embedded unusable without python3.9 #352389

Closed mfiumara closed 2 weeks ago

mfiumara commented 2 weeks ago

Describe the bug

I cannot use gcc-arm-embedded without installing python3.9. It seems python3.9 path is hardcoded in the recipe, whereas I have other python requirements.

Steps To Reproduce

Steps to reproduce the behavior: Build this shell.nix:

{ pkgs ? import <nixpkgs> {} }:                                                                                                                                                                                      

let                                                                                                                                                                                                                  
  gcc_arm = pkgs.gcc-arm-embedded-13;
in
pkgs.mkShell {
  nativeBuildInputs = with pkgs.buildPackages; [ 
    gcc_arm
  ];

Open the nix-shell, then try to run arm-none-eabi-gdb:

arm-none-eabi-gdb

This will fail with the following output:

Fatal Python error: init_import_size: Failed to import the site module                                                                                                                                               
Python runtime state: initialized                                                                                                                                                                                    
Traceback (most recent call last):                                                                                                                                                                                   
  File "/nix/store/2xij13by2fj9mzi16bagf3yb7rim4ify-python3-3.9.20/lib/python3.9/site.py", line 73, in <module>                                                                                                      
    import os                                                                                                                                                                                                        
  File "/nix/store/2xij13by2fj9mzi16bagf3yb7rim4ify-python3-3.9.20/lib/python3.9/os.py", line 29, in <module>                                                                                                        
    from _collections_abc import _check_methods                                                                                                                                                                      
  File "/nix/store/2xij13by2fj9mzi16bagf3yb7rim4ify-python3-3.9.20/lib/python3.9/_collections_abc.py", line 12, in <module>                                                                                          
    GenericAlias = type(list[int])                                                                                                                                                                                   
TypeError: 'type' object is not subscriptable

Expected behavior

GDB should work without relying on python? I think we should be able to use gdb without python scripting support with the flag --without-python-support.

Notify maintainers

@mweinelt

Metadata

nix-shell -p nix-info --run "nix-info -m"
Creating virtual environment...
Python environment activated:
Python 3.11.9
/home/mattiaf/repos/agurotech-firmware/.venv/bin/west
West version: v0.11.0
Virtual environment: /home/mattiaf/repos/agurotech-firmware/zephyrproject/applications/firmware/.venv
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.58, NixOS, 24.05 (Uakari), 24.05.6043.64b80bfb316b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - channels(root): `"home-manager-24.05.tar.gz, nixos-24.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

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

mfiumara commented 2 weeks ago

BTW this issue is not present when installing gcc-arm-embedded-10: This does not have a python dependency.

mweinelt commented 2 weeks ago

Duplicate of https://github.com/NixOS/nixpkgs/issues/303651