releng: use JSON env-state and serialize allowed_prebuilds deterministically#20
Open
james-coder wants to merge 2 commits into
Open
releng: use JSON env-state and serialize allowed_prebuilds deterministically#20james-coder wants to merge 2 commits into
james-coder wants to merge 2 commits into
Conversation
Introduce releng/env_state.py for typed JSON serialization/deserialization of build environment state used by configure/make wrappers. meson_configure now writes frida-env.json, and meson_make loads this validated JSON state (reconfiguring when missing) instead of pickle.loads. This removes unsafe deserialization in the build helper path.
The build environment state now stores allowed_prebuilds as JSON. During configure, this value may be provided as a set, which is not JSON serializable and caused setup to abort with: Object of type set is not JSON serializable Normalize allowed_prebuilds before json.dumps by converting non-list values to a sorted list. This preserves deterministic ordering and keeps serialized state stable across runs. Validation: - python3 -m py_compile releng/env_state.py - ./configure succeeds after toolchain bootstrap - make succeeds in default configuration
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.
Summary
allowed_prebuildswhen it is provided as a setallowed_prebuildsvalues to a sorted list before writingProblem
During
./configure, build setup can fail with:This happens when
allowed_prebuildsis not already a list.Why this shape
The serialization fix depends on the JSON env-state implementation, so this PR includes both commits in one focused branch.
Validation
python3 -m py_compile releng/env_state.py./configuresucceedsmakesucceeds in default local build