NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.09k stars 14.14k forks source link

Build failure: python3Packages.sqlalchemy-migrate #296480

Closed Green-D-683 closed 5 months ago

Green-D-683 commented 7 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build python with sqlalchemy-migrate

Build log

[user@system:~]$ nix shell nixpkgs#python3Packages.sqlalchemy-migrate --impure
error: builder for '/nix/store/840597qwjbdlm343631l2icbfhpkq6r9-python3.11-sqlalchemy-migrate-0.13.0.drv' failed with exit code 1;
       last 10 log lines:
       >     from migrate.changeset.schema import *
       >   File "/build/sqlalchemy-migrate-0.13.0/migrate/changeset/schema.py", line 20, in <module>
       >     from migrate.changeset.databases.visitor import (get_engine_visitor,
       >   File "/build/sqlalchemy-migrate-0.13.0/migrate/changeset/databases/visitor.py", line 7, in <module>
       >     from migrate.changeset.databases import (sqlite,
       >   File "/build/sqlalchemy-migrate-0.13.0/migrate/changeset/databases/sqlite.py", line 13, in <module>
       >     from sqlalchemy.databases import sqlite as sa_base
       > ModuleNotFoundError: No module named 'sqlalchemy.databases'
       > Non-zero exit code (2) from test listing.
       > error: testr failed (3)
       For full logs, run 'nix log /nix/store/840597qwjbdlm343631l2icbfhpkq6r9-python3.11-sqlalchemy-migrate-0.13.0.drv'.

Additional context

The sqlalchemy-migrate library is built using a legacy version of sqlalchemy, maintained as sqlalchemy_1_4. The build input needs to be changed to this, at a minimum, for the library to build.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix shell nixpkgs#nix-info --command nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.6, NixOS, 24.05 (Uakari), 24.05.20240314.d691274`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.05, nixpkgs-unstable"`
 - nixpkgs: `/nix/store/9mf8fkjw3vw1gm4s6j5fqlwrv5wf2knf-source`

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

matj1 commented 5 months ago

Notify maintainers

@SuperSandro2000
@makefu

SuperSandro2000 commented 5 months ago

How did you construct the overlay that downgrades sqlalchemy? Did you properly overwrite src?

Green-D-683 commented 5 months ago

How did you construct the overlay that downgrades sqlalchemy? Did you properly overwrite src?

I can't remember exactly, I was able to get it to build using .override, but I think I was having trouble getting any overlay to actually apply to my nix flake. I'm in exam season at Uni at the moment, so it's probably not something I'll be able to take a decent look at again until summer. There might be something in my NixOS-Config repo to give you an idea what I was doing. No guarantees though, it's a bit of a mess, and cleaning it up is also a summer job at this point.

SuperSandro2000 commented 5 months ago

Try using pythonPackagesExtensions https://github.com/NixOS/nixpkgs/blob/3eaeaeb6b1e08a016380c279f8846e0bd8808916/nixos/modules/config/no-x-libs.nix#L74-L79 and that is an example of an overlay https://github.com/NixOS/nixpkgs/blob/3eaeaeb6b1e08a016380c279f8846e0bd8808916/pkgs/applications/office/paperless-ngx/default.nix#L40-L53