mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +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
|
||||
'vector))))))
|
||||
|
||||
;; Skip known broken systems and their dependents
|
||||
(dolist (system *broken-systems*)
|
||||
(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(deps))
|
||||
) delete from quicklisp_system where name in (select name from broken)"
|
||||
system))
|
||||
;; Weed out circular dependencies from the package graph.
|
||||
(sqlite:with-transaction db
|
||||
(sql-query "create temp table will_delete (root,name)")
|
||||
(loop for (system) in (sql-query "select name from quicklisp_system") do
|
||||
(when (sql-query
|
||||
"with recursive dep(root, name) as (
|
||||
select s.name, d.value
|
||||
from quicklisp_system s
|
||||
cross join json_each(s.deps) d
|
||||
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
|
||||
;; Should these be temp tables, that then get queried by
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue