Skip to content

Reproducible Builds: Sort protoList before marshal - #605

Merged
Loyalsoldier merged 1 commit into
v2fly:masterfrom
kpcyrd:reproducible-protobuf
Aug 16, 2021
Merged

Reproducible Builds: Sort protoList before marshal#605
Loyalsoldier merged 1 commit into
v2fly:masterfrom
kpcyrd:reproducible-protobuf

Conversation

@kpcyrd

@kpcyrd kpcyrd commented Aug 15, 2021

Copy link
Copy Markdown
Contributor

hi!

This patch sorts the results before they're marshaled and written to disk. This seems to be sufficient to make dlc.dat reproducible, meaning building from the same git commit generates a file with an identical sha256sum.

This change makes the v2ray-domain-list-community Arch Linux package reproducible on our reproducible builds system.

Before

% go run main.go
Use domain lists in ./data
dlc.dat has been generated successfully.
% sha256sum dlc.dat
e29639d1ac64774086a9fa7ab60f1b1acdbcf558d9724b9e430495fdb68e4624  dlc.dat
% go run main.go   
Use domain lists in ./data
dlc.dat has been generated successfully.
% sha256sum dlc.dat
18d2560fc752e9ef82545188a15fa5ea36815f2a0082582483169f68adcff704  dlc.dat
% 

After

% go run main.go   
Use domain lists in ./data
dlc.dat has been generated successfully.
% sha256sum dlc.dat
dcea8ef9b4ba59c8355b194b072a81b9ca55db7df608b7849f7b6c7db4730ff6  dlc.dat
% go run main.go   
Use domain lists in ./data
dlc.dat has been generated successfully.
% sha256sum dlc.dat
dcea8ef9b4ba59c8355b194b072a81b9ca55db7df608b7849f7b6c7db4730ff6  dlc.dat
% 

@Loyalsoldier Loyalsoldier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution 🎉

@Loyalsoldier
Loyalsoldier merged commit 6ccee88 into v2fly:master Aug 16, 2021
@kpcyrd
kpcyrd deleted the reproducible-protobuf branch August 16, 2021 09:40
github-actions Bot added a commit to YW5vbnltb3Vz/domain-list-community that referenced this pull request Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants