ocaml/dune

add `forbidden_linkall` as an optional field in executable(s) stanza

开放

#12,748 创建于 2025年11月19日

 (6 条评论) (0 个反应) (0 位负责人)OCaml (478 个派生)github user discovery
help wanted

仓库指标

星标
 (1,882 个星标)
PR 合并指标
 (平均合并 1天 20小时) (30 天内合并 345 个 PR)

描述

In the same style as forbidden_libraries, it'd be useful to have forbidden_linkall to guarantee an executable is not compiled with linkall.

It turns out dune can add the linkall option if some libraries (notably dune-site, but I don't know if there are others) are in the dependency graph (even transitively). Because of this, the linkall flag can creep up into an executable when a new dependency is added or when a dependency is updated (e.g., camomile<2 and camomile≥2).

Expected behaviour

With a stanza

(executable
 (forbidden_linkall)
 …)

is evaluated. The build fails if the executable would be compiled with linkall.

贡献者指南