Skip to content

releng: use JSON env-state and serialize allowed_prebuilds deterministically#20

Open
james-coder wants to merge 2 commits into
frida:mainfrom
james-coder:pr/build-env-state-json
Open

releng: use JSON env-state and serialize allowed_prebuilds deterministically#20
james-coder wants to merge 2 commits into
frida:mainfrom
james-coder:pr/build-env-state-json

Conversation

@james-coder

@james-coder james-coder commented Mar 6, 2026

Copy link
Copy Markdown

Summary

  • replace pickle-based build env-state persistence with JSON + schema validation
  • fix JSON serialization for allowed_prebuilds when it is provided as a set
  • normalize non-list allowed_prebuilds values to a sorted list before writing

Problem

During ./configure, build setup can fail with:

Object of type set is not JSON serializable

This happens when allowed_prebuilds is 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
  • ./configure succeeds
  • make succeeds in default local build

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
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.

1 participant