fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic - #14986
Merged
Legend-Master merged 2 commits intoFeb 23, 2026
Conversation
…o generate_context! is deterministic
Contributor
Package Changes Through 233138dThere are 4 changes which include tauri-cli with patch, @tauri-apps/cli with patch, tauri-utils with patch, tauri-bundler with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Contributor
|
Nice catch, could you also add some comments about the reason for this and a todo about changing it them to |
montyc1999
force-pushed
the
fix-nondeterministic-csp-context
branch
from
February 23, 2026 13:16
40083ae to
233138d
Compare
Contributor
Author
|
@Legend-Master sure, added. How's that? |
chippers
pushed a commit
to chippers/tauri
that referenced
this pull request
Mar 3, 2026
…o `generate_context!` is deterministic (tauri-apps#14986) * fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic * add comments explaining rationale, and todo for removing the hack in v3
razein97
pushed a commit
to razein97/tauri
that referenced
this pull request
Apr 30, 2026
…o `generate_context!` is deterministic (tauri-apps#14986) * fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic * add comments explaining rationale, and todo for removing the hack in v3
razein97
pushed a commit
to razein97/tauri
that referenced
this pull request
Apr 30, 2026
…o `generate_context!` is deterministic (tauri-apps#14986) * fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic * add comments explaining rationale, and todo for removing the hack in v3
razein97
pushed a commit
to razein97/tauri
that referenced
this pull request
Apr 30, 2026
…o `generate_context!` is deterministic (tauri-apps#14986) * fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic * add comments explaining rationale, and todo for removing the hack in v3
VityaSchel
added a commit
to VityaSchel/tauri
that referenced
this pull request
Jul 25, 2026
generate_context! emitted the embedded asset map and the CSP script/style hashes in filesystem walk order (varies across machines) and HashMap iteration order (varies per process), and serializing the processed config wrote the csp/headers/plugins maps in HashMap iteration order. Both broke reproducible builds: the same source built on two machines produced different binaries and a different tauri.conf.json in the generated Android project. Iterate all of them sorted, complementing tauri-apps#14986 which sorted the same config maps on the ToTokens path. closes tauri-apps#14978
Legend-Master
added a commit
that referenced
this pull request
Aug 5, 2026
…tic (#15777) * fix: make embedded assets codegen and config serialization deterministic generate_context! emitted the embedded asset map and the CSP script/style hashes in filesystem walk order (varies across machines) and HashMap iteration order (varies per process), and serializing the processed config wrote the csp/headers/plugins maps in HashMap iteration order. Both broke reproducible builds: the same source built on two machines produced different binaries and a different tauri.conf.json in the generated Android project. Iterate all of them sorted, complementing #14986 which sorted the same config maps on the ToTokens path. closes #14978 * Use `BTreeMap` for embedded assets and inline script hashes * remove outdated comment * Convert to BTreeMap instead of sort to vec --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> Co-authored-by: Tony <legendmastertony@gmail.com>
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.
Fixes #14978
It would be nicer to convert these HashMaps to BTreeMaps, but that would be a breaking change.