Support more targets
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Domaine
- build-system, databases
Piste de recherche
Commencez par lire la configuration Zig existante ainsi que les Makefiles et scripts générateurs de PostgreSQL nommés dans l’issue, en particulier genbki.pl, gen_keywordlist.pl, PerfectHash.pm et generate-errcodes.pl. Déterminez la configuration dépendante de la cible et les dépendances des en-têtes au moment de la compilation, puis vérifiez que les en-têtes non suivis dans le dépôt sont générés et que des versions et des cibles PostgreSQL supplémentaires se compilent correctement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- C
- Étoiles
- 16
- Forks
- 4
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Issues similaires
-
Add c++23 mapping to nvccOuvertefeature request
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
FujiNetWIFI/fujinet-firmware#1730 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
[openssl] update to 3.6.5Ouvertecategory:port-update
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 2 jours