Repository navigation
Clarification on MIT license vs. underlying AtomUI (LGPL-3.0) compliance when publishing with Native AOT / 关于在 Native AOT 发布场景下 MIT 协议与底层 AtomUI (LGPL-3.0) 合规边界说明 #25
Description
Hi there! First off, huge thanks for open-sourcing TKCode.Arc. After playing around with the Gallery and reading through the design docs, I'm really impressed—it's rare to see an Avalonia library nail this kind of clean Linear/Vercel aesthetic, subtle hairline borders, and smooth ArcMotion spring physics. StreamMark is also super well-executed.
While evaluating the library, I noticed a licensing detail in the dependency tree and wanted to ask for some clarification:
The repo itself is MIT-licensed, while THIRD-PARTY-NOTICES.md notes the dependency on AtomUI under LGPL-3.0. Looking at the NuGet dependency graph, aside from a few standalone packages like Fonts and Terminal, the main TKCode.Arc package and foundational packages like Core and Icons all directly depend on AtomUI.
Under standard .NET JIT deployment, referencing an unmodified AtomUI NuGet package outputs separate .dll files, which naturally satisfies the dynamic linking requirement in LGPL-3.0 Section 4.d.1. However, if a closed-source application uses .NET Native AOT (PublishAot=true) to compile into a single native binary, it hits a compliance deadlock:
- Static linking & inlining limits: The ILC compiler performs whole-program trimming, cross-assembly inlining (triggering LGPL-3.0 Section 3), and static linking into a single executable, meaning end users can no longer swap out the LGPL library (see GNU FAQ: static vs. dynamic linking).
- Standard LGPL AOT workarounds don't work for UI libraries:
- Shipping relinkable
.objfiles or IL assemblies alongside the binary per Section 4.d.0 exposes the closed-source application to trivial decompilation, defeating a primary purpose of Native AOT. - Compiling the LGPL library into a standalone native shared library via
[UnmanagedCallersOnly]per Section 4.d.1 isn't architecturally viable for UI controls. Since controls inherit fromAvaloniaObjectand must share the same managed GC heap and visual tree as the host app, we can't pass managed C# object references across a C ABI boundary. - Additionally, deploying to platforms with mandatory code signing restrictions triggers the anti-tivoization clause in LGPL-3.0 Section 4.e (referencing GPL-3.0 Section 6).
- Shipping relinkable
Could you help clarify a few points around this?
- Compliance for closed-source Native AOT builds: If a closed-source project uses
TKCode.Arcand publishes a single-file binary withPublishAot=true(without shipping.obj/ IL relinking artifacts), does that violate the underlyingAtomUILGPL-3.0 license? Would that scenario require purchasing a commercial license fromAtomUI, or is there any static linking exception planned? - Decoupling foundational packages: Is
TKCode.Arcintended to permanently build on top ofAtomUIas its foundation, or are there any plans to decouple foundational packages likeTKCode.Arc.CoreandIconsso they can run on pure Avalonia under pure MIT terms? - README license note: Since the top-level
MITbadge might give developers the impression that the library can be freely statically linked in closed-source Native AOT builds, would it make sense to add a brief note in theREADME.mdLicense section mentioning the transitiveAtomUI (LGPL-3.0)obligations?
Thanks again for bringing such a polished UI library to the Avalonia ecosystem!
作者好!首先非常感谢开源 TKCode.Arc。在体验了 Gallery 并阅读设计文档后觉得非常惊艳——目前在 Avalonia 生态里,很少见到能把干净的 Linear/Vercel 极简美学、细腻的微边框质感以及丝滑的 ArcMotion 弹簧物理动效结合得这么到位的组件库,StreamMark 的完成度也非常高。
在评估该库的过程中,我留意到依赖树上的一个开源协议细节,想向你请教并确认一下:
仓库本身采用 MIT 协议,同时在 THIRD-PARTY-NOTICES.md 中注明了依赖采用 LGPL-3.0 协议 的 AtomUI。查看 NuGet 依赖关系图可以发现,除 Fonts、Terminal 等少数独立包外,TKCode.Arc 主包以及 Core、Icons 等基础包均直接依赖了 AtomUI。
在标准的 .NET JIT 部署模式下,引用未修改的 AtomUI NuGet 包会输出独立的 .dll 文件,这天然满足 LGPL-3.0 第 4.d.1 条的动态链接要求。但如果闭源应用采用 .NET Native AOT (PublishAot=true) 编译为单一原生二进制文件,就会遇到合规死锁:
- 静态链接与内联限制: ILC 编译器会执行全局裁剪、跨程序集内联(触发 LGPL-3.0 第 3 条)并静态链接为单个可执行文件,这意味着终端用户无法再自行替换其中的 LGPL 库(参见 GNU FAQ:静态链接与动态链接的区别)。
- 常规的 LGPL AOT 绕行方案对 UI 库不适用:
- 若按 第 4.d.0 条随二进制文件附带可重链接的
.obj文件或 IL 程序集,会导致闭源应用极易被反编译,失去了使用 Native AOT 的核心意义之一。 - 若按 第 4.d.1 条通过
[UnmanagedCallersOnly]将 LGPL 库编译为独立的原生动态库,在 UI 控件架构上并不可行。因为控件继承自AvaloniaObject,必须与宿主程序共享同一个托管 GC 堆和视觉树,我们无法跨越 C ABI 边界传递托管的 C# 对象引用。 - 此外,若部署到具有强制代码签名限制的平台,还会触发 LGPL-3.0 第 4.e 条(引用 GPL-3.0 第 6 条)中的反硬件锁定(Anti-Tivoization)条款。
- 若按 第 4.d.0 条随二进制文件附带可重链接的
能否帮忙澄清以下几个问题:
- 闭源 Native AOT 构建的合规性: 如果闭源项目使用
TKCode.Arc并通过PublishAot=true发布单文件二进制程序(且不附带.obj/ IL 等重链接产物),这是否违反了底层AtomUI的 LGPL-3.0 协议?这种场景下是否需要向AtomUI购买商业授权,或者后续是否有提供静态链接豁免(Static Linking Exception)的计划? - 基础包解耦规划:
TKCode.Arc的定位是长期构建在AtomUI底座之上,还是未来有计划将TKCode.Arc.Core和Icons等基础包解耦,使其能在纯原生 Avalonia 上以纯粹的 MIT 协议运行? - README 协议说明建议: 鉴于仓库顶部的
MIT徽章可能会让开发者误以为该库可以在闭源 Native AOT 构建中自由地静态链接,是否在README.md的 License 章节补充一句简短说明,提示底层AtomUI (LGPL-3.0)的传递性协议约束会更合适?
再次感谢为 Avalonia 生态带来如此精良的 UI 组件库!
Activity
239573049 commentedon Oct 28, 2026
Thanks a lot for the kind words and for such a careful write-up — this is exactly the kind of issue we want raised early.
Short answer: we are starting our own foundation package to replace AtomUI, so TKCode.Arc can run on pure Avalonia under MIT terms.
PublishAot=truebuild without relinking artifacts is not a scenario we can say is clearly compliant. Until the replacement lands, if you ship closed-source software, please either use the regular JIT deployment (AtomUI stays a separate, replaceable.dll) or check with the AtomUI authors about their licensing options. We don't control AtomUI's license, so a static linking exception isn't something we can grant.TKCode.Arc.Core,Icons, the mainTKCode.Arcpackage and the rest will move onto it, depending only on Avalonia. The goal is that no package in the dependency graph carries an LGPL obligation. We'll keep the public API as stable as we can and note any breaking changes in the changelog.We'll keep this issue open and post progress here.
非常感谢你的认可,也感谢这么细致的分析,这类问题越早提出越好。
简短回答:我们正式开启自研基础包计划,用自己的基础包替换掉 AtomUI,让 TKCode.Arc 只依赖原生 Avalonia,整体以 MIT 协议提供。
PublishAot=true发布单文件且不附带重链接产物,我们无法说这是明确合规的。在替换完成之前,如果你发布闭源软件,建议使用常规 JIT 部署(AtomUI 保持为独立、可替换的.dll),或者向 AtomUI 作者咨询授权方式。AtomUI 的协议不由我们决定,所以静态链接豁免不是我们能提供的。TKCode.Arc.Core、Icons、TKCode.Arc主包等都会迁移到这个基础包上,只依赖 Avalonia。目标是整个依赖图中不再有任何 LGPL 约束。我们会尽量保持公开 API 稳定,破坏性变更会写进 Changelog。这个 issue 先保持打开,后续进展会在这里同步。
LeoYang06 commentedon Oct 28, 2026
Thank you for your detailed explanation. The reason I asked you earlier about the AtomUI commercial license and static linking exemption was that I saw
https://github.com/AtomUICommunity/TKCodeand mistakenly assumed you might have a conflict of interest withAtomUI😄. If you're already planning to migrate to a self-developed foundational package, that would be fantastic!感谢你的详细说明,前面之所以向你询问
AtomUI商业授权和静态链接豁免,是我看到https://github.com/AtomUICommunity/TKCode误认为你和AtomUI可能存在利益相关😄。如果已经计划迁移到自研基础包那就太棒了!feat(foundation): TKCode.Arc.Foundation, an MIT base package for toke…
feat!: replace AtomUI with TKCode.Arc.Foundation
docs: describe the AtomUI-free setup and add the 0.3 to 0.4 migration…