Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Issue with `system_lua` option regarding header location

未关闭
#233 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, lua
领域
build-system

调研方向

Start in build.zig, where the system_lua option and the additional_system_headers handling feed the translate-c step, and read the comment above the addSystemIncludePath() call. Reproduce by pointing system_lua at a distro layout such as /usr/include/luajit-2.1. The issue offers two API directions, an additional_headers option or a ?LazyPath for system_lua, but the maintainer has not chosen one, so agree on the API before writing code. Done means system Lua headers in subdirectories resolve without the -isystem/-I conflict warning.

由索引模型根据 Issue 内容生成。

描述

If you set system_lua to true, you may be given an error that it cannot find the Lua headers defined in build/include/*.h, because most distributions/operating systems will put the header files inside a subdirectory, e.g. /usr/include/luajit-2.1.

To fix this, I tried adding the LuaJIT include path using ziglua's additional_system_headers option, but that gave me a quite strange error:

error: warning: add "/usr/include/luajit-2.1" to header searchlist '-isystem' conflicts with '-I'

The fix for this is to add it as a regular include path with addIncludePath() instead of addSystemIncludePath(), but that may break other usecases (e.g. the one mentioned in the comment right above that call in the code).

So personally, I see two (good) options here:

  • Adding an additional_headers option, in the same vein as additional_system_headers;
  • Letting system_lua take a ?LazyPath type, where null means compiling the selected Lua version, and any LazyPath means adding the given path as an include path for translate-c.
主要语言
Zig
星标
530
派生
74
平均合并
6 天 15 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

natecraddock/ziglua 的其他 Issue

查看 natecraddock/ziglua 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。