Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Issue with `system_lua` option regarding header location

Aberta
#233 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
c, lua
Domínio
build-system

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
Zig
Estrelas
530
Forks
74
Merge médio
6d 15h
PRs com merge (30d)
1

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de natecraddock/ziglua

Todas as issues de natecraddock/ziglua

Issues semelhantes

Mais issues de Build System

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.