Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
CI でのビルド時 (GitHub Actions, AppVeyor) に
*.pdb
の生成を無効化する。リリース時の Reproducible build のチェックもこれに準じるため、バイナリ配布用のビルドも DebugType=None で行われる。
背景
.NET アプリケーションで
*.pdb
を含めて Reproducible build を実現させる場合は、ビルドを実行する環境のruntime-version
を含めて一致させる必要がある。これは Portable PDB の仕様によりruntime-version
の値が*.pdb
に埋め込まれているためである。参照: https://github.com/dotnet/runtime/blob/v8.0.0/docs/design/specs/PortablePdb-Metadata.md#compilation-options-c-and-vb-compilers
しかし、.NET Framework の場合は CI 環境(Windows Server 2022)と開発者の PC(Windows 11)で
runtime-version
を完全に一致させることが難しい場合があり、現時点 (2023/11/28) においても GitHub Actions では4.8.9186.0
である一方で @upsilon の使用する開発環境では4.8.9181.0
とバージョンに差異がある状態が続いている。このようなバージョンの差異は今後の Windows Update によって解消する場合もあれば、逆に CI 環境の方が古い場合には Windows Update の履歴から特定のアップデートをアンインストールすることで一致する場合もあるが、いずれにせよ OS のアップデートと紐付く .NET Framework ランタイムの性質上バージョンが一致する環境を準備することは容易とは言えない。
そのため、今後のビルドでは
DebugType=None
でデバッグ情報の生成を行わないことでruntime-version
が完全に一致しなくとも Reproducible build を実現できるようにする。