12345678910111213141516171819202122232425262728293031323334353637383940(************************************************************************)(* * The Rocq Prover / The Rocq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)typet={name:string;dir:string;logpath:string;}letresolve:stringlist->tlist=funps->matchpswith[]->[]|_->letps=tryFindlib.package_deep_ancestors[]pswith|Findlib.No_such_package(p,_)->CErrors.user_errPp.(str"Failed to locate package "++strp)|Findlib.Package_loopp->CErrors.user_errPp.(str"Dependency loop on package: "++strp)inletqueryp=letp=letopenFl_package_baseintryFl_package_base.querypwith|No_such_package(p,info)->CErrors.user_errPp.(str"Failed to query package: "++strp)intryletlogpath=Fl_metascanner.lookup"rocqpath"[]p.package_defsinletdir=Filename.concat(p.Fl_package_base.package_dir)"rocq.d"inletname=p.Fl_package_base.package_nameinSome{name;dir;logpath}withNot_found->NoneinList.filter_mapqueryps