$50 Packaging Bound: Aider

This seems to work for me:

nix run https://src.thehellings.com/greg/aider-flake/-/archive/main/aider-flake-main.zip

Although some “interactive /help” dependencies seem to be missing:

> /help how to start                                                                                                                                                           

To use interactive /help you need to install the help extras:

/nix/store/pfv4raslwhi3101k342752v65zxkwrxq-python3-3.11.9/bin/python3.11 -m pip install aider-chat[help] --extra-index-url https://download.pytorch.org/whl/cpu

This works for me. Although here, too, it seems aider[help] was not used:

> /help how to start                                                                                                                                                           

To use interactive /help you need to install the help extras:

/nix/store/747rhv8hh2w8kqwyni7jcfqzxpldxxcv-python3-3.11.9/bin/python3.11 -m pip install aider-chat[help] --extra-index-url https://download.pytorch.org/whl/cpu

Run pip install? y

I found yet another Aider flake, which seems to build on Python 3.12:

Added optional dependencies for help, browser & playwrigtht!

Ah, that should be git+https://src.thehellings.com/greg/aider-flake.

And that flake should include an existing overlay that anyone can use to test.

The version in nixpkgs is going to address the problems with running in Python 3.12. There was an issue with a dependent library that had support dropped in Python 3.12 that we have since worked around in those PRs.

I have updated the README.md file with the full URL and also added in the dependencies for the Help. At least, I think I got the help working.

1 Like

Okay! I added the flake to my local setup. aider starts but it croaks with:

  File "/nix/store/pfv4raslwhi3101k342752v65zxkwrxq-python3-3.11.9/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pfv4raslwhi3101k342752v65zxkwrxq-python3-3.11.9/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: /nix/store/hfp326qlbgbkhvlqg66ywdkyjaxfzzqh-python3.11-tree-sitter-languages-1.10.2/lib/python3.11/site-packages/tree_sitter_languages/languages.so: cannot open shared object file: No such file or directory

Is that while running the flake directly, or while consuming it as an overlay?

That’s using the flake in this commit.

1 Like

I’ll help test. I just added it to my system similar to your commit above.

I’m getting this error: tensorflow-2.13.0 not supported for interpreter python3.12 using rev eaa183087b3fe704ce9f8bdb956bb66a623467fa on main branch.

Also tested with the overlay method and got the tensorflow error. When I try to switch to python311 on nixos-unstable I get the following:
error: aider should use 'buildPythonPackage' or 'toPythonModule' if it is to be part of the Python packages set.

Correct, this won’t run on Python 3.12 until I or someone can get tensorflow to run on 3.12. I’m working my way through the completely missing dependencies at the moment before I tackle that. Tensorflow is a very non-trivial package to tackle.

2 Likes

Noticed your from Dallas! I’m also live in the area. Nice to know I’m not the only NixOS user in the deep south. :slight_smile:

1 Like

I have fixed this up. At least, it now works for me locally without that error message.

Odd. Can you try doing it again, with just a raw nix run "git+https://...." as elsewhere documented? It might be working better now, but I’m not completely sure. I’m down to only one more package that needs to get merged into nixpkgs before I can put the base aider package directly into the main repo.

Indeed! The nerd runs strong in the Dallas area, but I haven’t encountered any other NixOS users, yet, to my knowledge.

Same deal:

nix run git+https://src.thehellings.com/greg/aider-flake

Loaded /home/jevin/code/personal/typestream/.env
Aider v0.47.1
Models: claude-3-5-sonnet-20240620 with diff edit format, weak model claude-3-haiku-20240307
Git repo: .git with 325 files
Repo-map: using 1024 tokens
Use /help <question> for help, run "aider --help" to see cmd line args
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> /help I just added a front end to the server, how does it look?                                                                                                

Traceback (most recent call last):
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/bin/.aider-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/main.py", line 590, in main
    coder.run()
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 617, in run
    new_user_message = self.run_loop()
                       ^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 653, in run_loop
    return self.commands.run(inp)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/commands.py", line 195, in run
    return self.do_run(matching_commands[0][1:], rest_inp)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/commands.py", line 170, in do_run
    return cmd_method(args)
           ^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/commands.py", line 786, in cmd_help
    assistant_msg = coder.run(user_msg)
                    ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 621, in run
    list(self.send_new_user_message(new_user_message))
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 847, in send_new_user_message
    messages = self.format_messages()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 794, in format_messages
    messages += self.get_files_messages()
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 541, in get_files_messages
    repo_content = self.get_repo_map()
                   ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/coders/base_coder.py", line 513, in get_repo_map
    repo_content = self.repo_map.get_repo_map(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/repomap.py", line 87, in get_repo_map
    files_listing = self.get_ranked_tags_map(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/repomap.py", line 386, in get_ranked_tags_map
    ranked_tags = self.get_ranked_tags(
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/repomap.py", line 273, in get_ranked_tags
    tags = list(self.get_tags(fname, rel_fname))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/repomap.py", line 150, in get_tags
    data = list(self.get_tags_raw(fname, rel_fname))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/aa9ghxpybkr4cz9r63w4ji21vbw6pi9v-python3.11-aider-0.47.1/lib/python3.11/site-packages/aider/repomap.py", line 162, in get_tags_raw
    language = get_language(lang)
               ^^^^^^^^^^^^^^^^^^
  File "tree_sitter_languages/core.pyx", line 14, in tree_sitter_languages.core.get_language
  File "/nix/store/abv99ph5xl54mp6inghc9wiism1yrp9s-python3.11-tree-sitter-0.21.1/lib/python3.11/site-packages/tree_sitter/__init__.py", line 132, in __init__
    self.lib = cdll.LoadLibrary(path_or_ptr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pfv4raslwhi3101k342752v65zxkwrxq-python3-3.11.9/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pfv4raslwhi3101k342752v65zxkwrxq-python3-3.11.9/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: /nix/store/hfp326qlbgbkhvlqg66ywdkyjaxfzzqh-python3.11-tree-sitter-languages-1.10.2/lib/python3.11/site-packages/tree_sitter_languages/languages.so: cannot open shared object file: No such file or directory

Reporting back here for a successful test, was able to install aider on my machine via python311, the overlay method, and your recent changes!

I’m also able to install it now, but getting the same error as @jevy when I try to use it. OSError: /nix/store/hfp326qlbgbkhvlqg66ywdkyjaxfzzqh-python3.11-tree-sitter-languages-1.10.2/lib/python3.11/site-packages/tree_sitter_languages/languages.so: cannot open shared object file: No such file or directory