lua: iterate over elements deterministically#58
Merged
Conversation
Owner
|
I can replicate the non-deterministic output (at least the output of Can you confirm if this patch does? diff --git a/waywall/lua/api.lua b/waywall/lua/api.lua
index 95664bf..fd15145 100644
--- a/waywall/lua/api.lua
+++ b/waywall/lua/api.lua
@@ -36,11 +36,10 @@ local function event_handler(name)
end
end
-local events = {
- ["load"] = event_handler("load"),
- ["resolution"] = event_handler("resolution"),
- ["state"] = event_handler("state"),
-}
+local events = {}
+events.load = event_handler("load")
+events.resolution = event_handler("resolution")
+events.state = event_handler("state")
local M = {}
|
Contributor
Author
|
edit: your patch helps for one of two issues and my original sorting patch did indeed not help. I force-pushed a better version now. |
Contributor
Author
|
or there is only a different diff left: --- old /usr/bin/waywall (objdump)
+++ new /usr/bin/waywall (objdump)
@@ -15231,8 +15231,8 @@
3cfc0 72720000 16007000 00040302 00072cba rr....p.......,.
3cfd0 01022d00 01003900 00002d02 02003503 ..-...9...-...5.
3cfe0 01004200 03022e00 00004b00 01000a80 ..B.......K.....
- 3cff0 0bc000c0 01000306 78030a09 73697a65 ........x...size
- 3d000 03010679 030a0974 65787401 01010101 ...y...text.....
+ 3cff0 0bc000c0 01000309 73697a65 03010679 ........size...y
+ 3d000 030a0678 030a0974 65787401 01010101 ...x...text.....
3d010 01026175 746f6765 6e5f7465 78740077 ..autogen_text.w
3d020 61797761 6c6c0061 75746f67 656e5f6e aywall.autogen_n
3d030 6f746963 650000c6 0a030011 001d0045 otice..........Efrom variations in lua/init.h |
to behave in a deterministic way. See https://reproducible-builds.org/ for why this is good. Co-Authored-By: tesselslate
tesselslate
approved these changes
May 5, 2026
Owner
|
Thanks for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
lua: iterate over elements deterministically
to allow for reproducible builds.
See https://reproducible-builds.org/ for why this is good.
Without this patch,
/usr/bin/waywallhad variations in the order of strings "load", "state"This patch was done while working on reproducible builds for openSUSE.
Note: I don't know lua well and only tested that it builds and binary/string diffs look sane.