Skip to content

Attempted an update to python 3.11 #13

Description

@exitrip

Moving my notes here from openXC7-snap #4 as the following has nothing to do with the snap.

After losing to the 60GB Vivado monster on my WSL drive yesterday, I decided to take a hardware engineer's crack at updating toolchain-nix to 3.11 with the power of search and replace. I had to also clone your fork of nextpnr-xilinx and add 311 to a pyVer line in nextpnr-xilinx's Cmakelist.

Lo! the devshell builds and a trivial "Blink" make job runs until fasm2frames cannot import antlr nor textx. Antlr is only mentioned in the yosys-synlig nix and textx in the fasm/default.nix. I assume the issue is package availability or something similar.

Let me know if you want me to push my local branches with the changes, though they're trivial. I don't know enough about this nix packager to wrestle Antlr4 or textx not being properly installed in the devshell's python, especially considering the prior work in #7

I wager the authors are familiar with the following:

Info: Running post-routing legalisation...
fasm2frames --part xc7a50tfgg484-1 --db-root /nix/store/jj1fx2xzn6a647z98bwqc8y3c7n7rwh6-nextpnr-xilinx-0.7.0/share/nextpnr/external/prjxray-db/artix7 blinky.fasm > blinky.frames
/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/__init__.py:30: RuntimeWarning: Unable to import fast Antlr4 parser implementation.
  ImportError: cannot import name 'antlr_to_tuple' from partially initialized module 'fasm.parser' (most likely due to a circular import) (/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/__init__.py)

  Falling back to the much slower pure Python textX based parser
  implementation.

  Getting the faster antlr parser can normally be done by installing the
  required dependencies and then reinstalling the fasm package with:
    pip uninstall
    pip install -v fasm

  warn(
Traceback (most recent call last):
  File "/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/__init__.py", line 26, in <module>
    from fasm.parser.antlr import \
  File "/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/antlr.py", line 22, in <module>
    from fasm.parser import antlr_to_tuple
ImportError: cannot import name 'antlr_to_tuple' from partially initialized module 'fasm.parser' (most likely due to a circular import) (/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/3vy9l9878b66aaqi6j0dm1xafy9x2n1i-prjxray-76401bd93e493fd5ff4c2af4751d12105b0f4f6d/bin/fasm2frames", line 14, in <module>
    import fasm
  File "/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/__init__.py", line 25, in <module>
    from fasm.parser import parse_fasm_filename, parse_fasm_string
  File "/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/__init__.py", line 42, in <module>
    from fasm.parser.textx import \
  File "/nix/store/w7607ki06jzhn1wc8901kwpb2q1n1acw-python3.11-fasm/lib/python3.11/site-packages/fasm/parser/textx.py", line 21, in <module>
    import textx
ModuleNotFoundError: No module named 'textx'
make: *** [../openXC7.mk:43: blinky.frames] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions