mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
lisp-modules: detect circular dependencies during quicklisp import
Quicklisp's October 2024 release had such a problem between the new packages qvm and cl-quil. It caused an issue with the "nixpkgs-review" tool because the Nix interpreter was stopping with an error due to too much recursion.
This commit is contained in:
parent
3b33901cff
commit
b43c292077
1 changed files with 28 additions and 10 deletions
|
@ -120,16 +120,34 @@
|
||||||
asds
|
asds
|
||||||
'vector))))))
|
'vector))))))
|
||||||
|
|
||||||
;; Skip known broken systems and their dependents
|
;; Weed out circular dependencies from the package graph.
|
||||||
(dolist (system *broken-systems*)
|
(sqlite:with-transaction db
|
||||||
(sql-query
|
(sql-query "create temp table will_delete (root,name)")
|
||||||
"with recursive broken(name) as (
|
(loop for (system) in (sql-query "select name from quicklisp_system") do
|
||||||
select ?
|
(when (sql-query
|
||||||
union
|
"with recursive dep(root, name) as (
|
||||||
select s.name from quicklisp_system s, broken b
|
select s.name, d.value
|
||||||
where b.name in (select value from json_each(deps))
|
from quicklisp_system s
|
||||||
) delete from quicklisp_system where name in (select name from broken)"
|
cross join json_each(s.deps) d
|
||||||
system))
|
where s.name = ?
|
||||||
|
union
|
||||||
|
select dep.root, d.value
|
||||||
|
from quicklisp_system s, dep
|
||||||
|
cross join json_each(s.deps) d
|
||||||
|
where s.name = dep.name
|
||||||
|
) select 1 from dep where name = root"
|
||||||
|
system)
|
||||||
|
(sql-query
|
||||||
|
"with recursive broken(name) as (
|
||||||
|
select ?
|
||||||
|
union
|
||||||
|
select s.name from quicklisp_system s, broken b
|
||||||
|
where b.name in (select value from json_each(s.deps))
|
||||||
|
) insert into will_delete select ?, name from broken"
|
||||||
|
system system)))
|
||||||
|
(loop for (root name) in (sql-query "select root, name from will_delete") do
|
||||||
|
(warn "Circular dependency in '~a': Omitting '~a'" root name)
|
||||||
|
(sql-query "delete from quicklisp_system where name = ?" name)))
|
||||||
|
|
||||||
(sqlite:with-transaction db
|
(sqlite:with-transaction db
|
||||||
;; Should these be temp tables, that then get queried by
|
;; Should these be temp tables, that then get queried by
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue