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

deepin-desktop-schemas: non-deterministic overrides #5117

Closed
bmwiedemann opened this issue Aug 4, 2023 · 8 comments · Fixed by linuxdeepin/deepin-desktop-schemas#98
Closed

Comments

@bmwiedemann
Copy link

SUMMARY | 问题概要

While working on reproducible builds for openSUSE, I found that
building our deepin-desktop-schemas twice produced diffs in 4 override files

SOFTWARE/OS VERSIONS | 软件/系统版本信息

deepin-desktop-schemas-5.10.11
openSUSE-Tumbleweed-20230801

PRE-REQUIREMENT | 预置条件

No response

STEPS TO REPRODUCE | 复现步骤

build it twice

OBSERVED RESULT | 观察到的结果

4 files differed:

  • /usr/share/deepin-desktop-schemas/desktop-override
  • /usr/share/deepin-desktop-schemas/personal-override
  • /usr/share/deepin-desktop-schemas/pro-override
  • /usr/share/deepin-desktop-schemas/server-override
+++ new//usr/share/deepin-desktop-schemas/desktop-override      2022-08-27 00:00:00.000000000 +0000
@@ -2,9 +2,9 @@
 openapi-url='https://openapi.deepin.com'

 [com.deepin.service.sync]
-sync-url='https://sync.deepinid.deepin.com/api/v1'
 client-id='163296859db7ff8d72010e715ac06bdf6a2a6f87'
 redirect-uri='https://sync.deepinid.deepin.com/oauth/callback'
+sync-url='https://sync.deepinid.deepin.com/api/v1'

 [com.deepin.service.push]

EXPECTED RESULT | 期望的结果

It should be possible to get bit-identical outputs in two builds.
Please sort entries during processing.

ADDITIONAL INFORMATION | 额外补充

My guess is that keyfile dictionaries don't have deterministic ordering in output at
https://github.com/linuxdeepin/deepin-desktop-schemas/blob/master/tools/override/main.go#L156

@Decodetalkers
Copy link

Thanks for bug report, Now the key is sorted first, can you try this pr? if it works, I think we can merge it

@Decodetalkers
Copy link

if there is still problems, please open it

@bmwiedemann
Copy link
Author

I applied 98.patch on 5.10.11 but still get various diffs in .override files:

 [com.deepin.wrap.pantheon.desktop.gala.animations]
+enable-animations=true
+open-duration=350
 snap-duration=250
 close-duration=300
 menu-duration=150
 minimize-duration=200
 workspace-switch-duration=300
-enable-animations=true
-open-duration=350


 [com.deepin.dde.power]
-line-power-sleep-delay=0
-battery-sleep-delay=0
 ambient-light-adjust-brightness=false
 screen-black-lock=false
+line-power-sleep-delay=0
+battery-sleep-delay=0

@Decodetalkers
Copy link

Decodetalkers commented Aug 20, 2023

com.deepin.wrap.pantheon.desktop.gala.animations

which file are you looking into? you should try the lastest tag, and look into result folder. the keys should have been sorted

[org.gnome.gedit.preferences.encodings]
candidate-encodings=['UTF-8','GB18030','GB2312','GBK','gbk','BIG5','big5','CURRENT','UTF-16']

[com.deepin.wrap.pantheon.desktop.gala.animations]
close-duration=300
enable-animations=true
menu-duration=150
minimize-duration=200
open-duration=350
snap-duration=250
workspace-switch-duration=300

@bmwiedemann
Copy link
Author

The first diff is from /usr/share/glib-2.0/schemas/90_deepin_base.gschema.override
and then 2nd one from /usr/share/glib-2.0/schemas/91_deepin_product.gschema.override

Is there another patch that I would need to pick?
Adding linuxdeepin/deepin-desktop-schemas@b068818 does not seem to help either.

@Decodetalkers
Copy link

I don't know what happened, can you try clone the repo , and run make , to see the the target under result folders? the keys are sorted by string, the shouldn't be random

@bmwiedemann
Copy link
Author

Ah, I just remembered that we build the override tool separately, so I ran an unpatched one.

@bmwiedemann
Copy link
Author

So when testing correctly, it is indeed fixed with the 98.patch. 👍

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 a pull request may close this issue.

2 participants