Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support reproducible builds #2358

Open
JanZerebecki opened this issue Aug 22, 2023 · 1 comment
Open

support reproducible builds #2358

JanZerebecki opened this issue Aug 22, 2023 · 1 comment

Comments

@JanZerebecki
Copy link

JanZerebecki commented Aug 22, 2023

Problem description

When building the same image twice the output is different. Fix this by making the kiwi output reproducible. See https://reproducible-builds.org/ from more info on the general idea.

Expected behaviour

Output of kiwi is reproducible.

Steps to reproduce the behaviour

Branch from the Factory with: osc branch --nodevelproject openSUSE:Factory/openSUSE-Tumbleweed-Yomi
Download image after it is done: osc getbinaries home:jzerebecki:branches:openSUSE:Factory/openSUSE-Tumbleweed-Yomi:livecd images/x86_64
Rebuild: osc rebuild home:jzerebecki:branches:openSUSE:Factory/openSUSE-Tumbleweed-Yomi:livecd images x86_64
Download again, build result is different.

> diff -sr binaries.kiwicd.1/openSUSE-Tumbleweed-Yomi.x86_64-1.0.0-livecd-Build21.1.iso binaries.kiwicd.2/openSUSE-Tumbleweed-Yomi.x86_64-1.0.0-livecd-Build21.2.iso
Binary files binaries.kiwicd.1/openSUSE-Tumbleweed-Yomi.x86_64-1.0.0-livecd-Build21.1.iso and binaries.kiwicd.2/openSUSE-Tumbleweed-Yomi.x86_64-1.0.0-livecd-Build21.2.iso differ

The following images show this:
iso: https://build.opensuse.org/package/show/openSUSE:Factory/openSUSE-Tumbleweed-Yomi livecd

Not tested, but possibly differently affected:
docker: https://build.opensuse.org/package/show/openSUSE:Factory/minimal-image
vmx oem btrfs xfs vhdx vmdk qcow2: https://build.opensuse.org/package/show/openSUSE:Factory/kiwi-templates-Minimal

Perhaps some PRs I made to make the product-builder reproducible are useful:
openSUSE/product-builder#26
openSUSE/product-builder#27
openSUSE/product-builder-plugins#16

OS and Software information

  • KIWI version: python3-kiwi-9.25.12-1.1
  • Operating system host version: obs Factory
  • Operating system target version: obs Factory
  • Open Build Service version (N/A if not using OBS): 2.11~alpha.20230822T165508.31116c20b
  • Koji version (N/A if not using Koji): N/A
@lslezak
Copy link

lslezak commented Jul 26, 2024

This not only affects the ability to verify the images but it also makes fine tuning the image size more difficult.

We build an installer Live ISO, the size of the built ISO file is around 700MB.

But the built size varies +/- 1MB, probably because some file timestamps or file order in the image can cause slightly better or worse compression.

So when I delete some not needed files from the image and the image gets 1MB smaller I do not know whether that was because of deleting those files or I was just lucky and the image was a bit more compressible and it saved 1MB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants