Support more targets
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
まず、既存のZig設定と、issueで挙げられているPostgreSQLのMakefileおよびジェネレータースクリプト、特にgenbki.pl、gen_keywordlist.pl、PerfectHash.pm、generate-errcodes.plを読みます。ターゲットに依存する設定とビルド時のヘッダー依存関係を特定し、未チェックのヘッダーが生成されることと、追加のPostgreSQLバージョンおよびターゲットが正常にビルドされることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C
- スター
- 16
- フォーク
- 4
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
johnsonjh/emu2-cpm86#68 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Zenmap CrashオープンZenmap
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
fastfetch-cli/fastfetch#2619 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
Template: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
betaflight/betaflight#15759 ·
メンテナーはふだん 1 日以内に返信