Support more targets
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Domínio
- build-system, databases
Direção de pesquisa
Comece lendo a configuração Zig existente e os Makefiles e scripts geradores do PostgreSQL mencionados na issue, especialmente genbki.pl, gen_keywordlist.pl, PerfectHash.pm e generate-errcodes.pl. Determine a configuração dependente do alvo e as dependências dos headers em tempo de build; em seguida, verifique se os headers não versionados são gerados e se versões e alvos adicionais do PostgreSQL são compilados com sucesso.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Current state
For now only recent linux on amd64 and macos on intel and apple silicon are supported.
It is done by dirty hacks: configuration is half hard-coded and a few generated headers are provided pre-generated.
Benefit of change
Not hard-coding configuration and generated headers would allow finally allow cross-compiling libpq on many more targets, and also make building the server code much easier.
Note that each PostgreSQL version has a different list of variable to provide for its configuration, so not hard-coding it would allow building more versions with less effort.
What should be done to get there
1. Generate configuration from the target
ALIGNOF_ TYPE
For now i've used @alignOf.
For cross-compiling we need to switch to std.Target.cTypeAlignment. Problem: it was called c_type_alignment up to zig 0.13.
I'll wait for 0.14 to release before doing that change.
SIZEOF_ TYPE
Same thing: i'll change from @sizeOf to std.Target.cTypeByteSize upon 0.14 release
HAVE_ FUNCTION
A mix of options for optional dependencies and writing a big switch.
There is also a need to know which GLIBC version is targeted.
In the case of a version explicitely queried, it will appear in std.Build.ResolvedTarget's query, but in the other case, I don't know how to proceed yet, help would be welcomed
HAVE_ HEADER
Idem
DLSUFFIX
Not needed to set correctly as it it not used when building statically I guess
BLCKSZ ENABLE_THREAD_SAFETY ...
I haven't spent time understanding that, leaving it hard-coded until it breaks something
2. Generate headers at build-time
Certain headers are generated by perl scripts.
They are not a function of the target OS and arch, but may change for each PostgreSQL version, so it is more about supporting different PostgreSQL versions and building the server code than about cross-compilation.
include/catalog/pg_tablespace_d.h
Generated by src/backend/catalog/genbki.pl, see src/include/catalog/Makefile.
Not sure exactly what it does and what it depends on.
include/kwlist_d.h
Generated by src/tools/gen_keywordlist.pl, using module src/tools/PerfectHash.pm (see src/common/Makefile).
include/utils/errcodes.h
Generated by src/backend/utils/generate-errcodes.pl using src/backend/utils/errcodes.txt
TODO list
-
ALIGNOF_TYPE -
SIZEOF_TYPE -
include/catalog/pg_tablespace_d.h -
include/kwlist_d.h -
include/utils/errcodes.h
- Linguagem predominante
- C
- Estrelas
- 16
- Forks
- 4
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
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
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Issues semelhantes
-
enhancement ui
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
ChupathingyCE/chupathingyce#485 ·
Mantenedores costumam responder em até 1 dia
-
Need to correct all URLsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
JustAResearcher/gpu-unlock-ada#98 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
FujiNetWIFI/fujinet-firmware#2216 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 2 dias