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

ensure theme builds are reproducible (bsc #1124165) #35

Merged
merged 2 commits into from Feb 5, 2019
Merged

Conversation

wfeldt
Copy link
Member

@wfeldt wfeldt commented Feb 5, 2019

Themes contains two cpio archives. Ensure they are identical in each
build.


message: src/main.bin src/gfxboot.cfg help-boot/.ready po/.ready fonts/.ready
@rm -rf message.dir
@mkdir message.dir
perl -p -e 's/^(layout=.*)/$$1,boot/' src/gfxboot.cfg >message.dir/gfxboot.cfg
perl -p -e 's/^(layout=.*)/$$1,boot/' src/gfxboot.cfg >message
Copy link
Member

Choose a reason for hiding this comment

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

Was this intentional? What is the reasoning?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good spotting; that's of course nonsense.

Themes contains two cpio archives. Ensure they are identical in each
build.
@lamby
Copy link

lamby commented May 27, 2022

I can confirm that this has normalised the mtime of the files. However, the issue that remains is that the order of the files within the themes files is inherited from the underlying filesystem. So we can end up with diffs like:

│ │ │ │ ├── file list
│ │ │ │ │ @@ -1,2 +1,2 @@
│ │ │ │ │ --rw-r--r--   1        0        0    42790 2020-10-22 13:49:24.000000 init
│ │ │ │ │  -rw-r--r--   1        0        0       11 2020-10-22 13:49:24.000000 font.fnt
│ │ │ │ │ +-rw-r--r--   1        0        0    42790 2020-10-22 13:49:24.000000 init

Untested patch:

diff --git a/themes/openSUSE/Makefile b/themes/openSUSE/Makefile
index 9272d1f..b74a840 100644
--- a/themes/openSUSE/Makefile
+++ b/themes/openSUSE/Makefile
@@ -57,7 +57,7 @@ ifdef DEFAULT_LANG
 	@echo $(DEFAULT_LANG) >bootlogo.dir/lang
 endif
 	@sh -c 'cd bootlogo.dir; chmod +t * ; chmod -t init languages ; touch -r ../src/main.bc *'
-	@sh -c 'cd bootlogo.dir; echo * | sed -e "s/ /\n/g" | cpio --quiet --reproducible --owner=+0:+0 -o >../bootlogo'
+	@sh -c 'cd bootlogo.dir; echo * | sed -e "s/ /\n/g" | LC_ALL=C sort | cpio --quiet --reproducible --owner=+0:+0 -o >../bootlogo'
 
 message: src/main.bin src/gfxboot.cfg help-boot/.ready po/.ready fonts/.ready
 	@rm -rf message.dir
@@ -73,7 +73,7 @@ ifdef DEFAULT_LANG
 	@echo $(DEFAULT_LANG) >>message.dir/languages
 endif
 	@sh -c 'cd message.dir; touch -r ../src/main.bc *'
-	@sh -c 'cd message.dir; echo * | sed -e "s/ /\n/g" | cpio --quiet --reproducible --owner=+0:+0 -o >../message'
+	@sh -c 'cd message.dir; echo * | sed -e "s/ /\n/g" | LC_ALL=C sort | cpio --quiet --reproducible --owner=+0:+0 -o >../message'
 
 clean:
 	@for i in $(SUBDIRS) ; do [ ! -f $$i/Makefile ] ||  make -C $$i clean || break ; done

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.

None yet

3 participants