uapi,posix: initial POSIX support for UAPI#99
Open
PThierry wants to merge 19 commits into
Open
Conversation
adding send_signal(), get_handle(), get_random() and get_cycle()
adding emulation test with sample apps as meson test suite
adding emulator requirements to requirements.txt
There was a problem hiding this comment.
Pull request overview
Adds initial POSIX/Linux x86_64 support for the sentry-uapi crate by forwarding syscall requests to a local emulator daemon over gRPC, and introduces a Python-based emulator implementation plus end-to-end tests and CI wiring.
Changes:
- Added a POSIX syscall backend (
uapi/src/posix.rs) that forwards syscalls/exchange operations via gRPC to a local emulator daemon. - Added a new Python
camelot.sentry-emulatortool (daemon, protocol helpers, CLI) with unit + integration/e2e tests and Meson integration. - Added sample Rust tasks/apps to exercise the emulator flow, plus a GitHub Actions workflow to run the emulator suite.
Reviewed changes
Copilot reviewed 37 out of 42 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
uapi/src/posix.rs |
New POSIX syscall backend forwarding syscalls/exchange over gRPC. |
uapi/src/lib.rs |
Switches syscall implementation selection between POSIX vs non-POSIX targets; adjusts no_std handling. |
uapi/src/exchange.rs |
Hooks exchange area copy operations to sync with the emulator daemon on Linux/x86_64. |
uapi/src/arch/mod.rs |
Removes the x86_64 arch backend module from the build. |
uapi/Cargo.toml |
Adds Linux/x86_64-only deps (tonic, tokio, prost) for POSIX mode. |
uapi/Cargo.lock |
Updates lockfile for new Rust dependencies. |
tools/sentry-emulator/tox.ini |
Adds tox envs for tests, mypy, build, and emulator-marked tests. |
tools/sentry-emulator/tests/conftest.py |
Ensures local source-tree imports for pytest. |
tools/sentry-emulator/tests/test_server.py |
Integration tests for gRPC server lifecycle and syscall behaviors. |
tools/sentry-emulator/tests/test_protocol.py |
Unit tests for request deserialization/validation. |
tools/sentry-emulator/tests/test_emulator.py |
E2E test launching emulator with sample Rust apps. |
tools/sentry-emulator/tests/test_cli.py |
CLI validation tests for port and --start parsing/errors. |
tools/sentry-emulator/src/camelot/__init__.py |
Introduces the camelot Python namespace package. |
tools/sentry-emulator/src/camelot/sentry_emulator/__init__.py |
Exposes public Python API and version handling. |
tools/sentry-emulator/src/camelot/sentry_emulator/__main__.py |
Enables python -m camelot.sentry_emulator entrypoint. |
tools/sentry-emulator/src/camelot/sentry_emulator/cli.py |
CLI parser and daemon startup logic. |
tools/sentry-emulator/src/camelot/sentry_emulator/dispatcher.py |
In-memory syscall bookkeeping for tests/diagnostics. |
tools/sentry-emulator/src/camelot/sentry_emulator/protocol.py |
Request normalization + protocol validation. |
tools/sentry-emulator/src/camelot/sentry_emulator/server.py |
Public server API shim re-exporting daemon/types. |
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/__init__.py |
Package marker for gRPC generated code. |
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/emulator_pb2.py |
Generated protobuf messages for emulator RPC. |
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/emulator_pb2_grpc.py |
Generated gRPC client/server bindings. |
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/__init__.py |
Internal module exports for emulator server components. |
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/constants.py |
Shared constants for status codes, exchange size, signal/event encoding. |
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/models.py |
Startup specs and runtime context models + --start parsing. |
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/daemon.py |
gRPC daemon lifecycle, context mgmt, alarms, exchange buffers, signal queueing. |
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/servicer.py |
gRPC Dispatch handler implementing syscall behaviors. |
tools/sentry-emulator/sample-rust-app/Cargo.toml |
Adds sample Rust tasks/apps crate for emulator e2e validation. |
tools/sentry-emulator/sample-rust-app/Cargo.lock |
Lockfile for the sample Rust app dependencies. |
tools/sentry-emulator/sample-rust-app/src/lib.rs |
Sample task logic covering signals, alarm, random, cycle, and logging. |
tools/sentry-emulator/sample-rust-app/src/bin/sample-app-one.rs |
Sender app binary entrypoint for e2e. |
tools/sentry-emulator/sample-rust-app/src/bin/sample-app-two.rs |
Receiver app binary entrypoint for e2e. |
tools/sentry-emulator/README.md |
Documents emulator features, usage, and sample tasks. |
tools/sentry-emulator/pyproject.toml |
Python packaging, deps, scripts, pytest/mypy config. |
tools/sentry-emulator/proto/emulator.proto |
Protobuf service/message definitions for emulator Dispatch. |
tools/sentry-emulator/meson.build |
Meson targets for building the Python wheel and sample Rust apps. |
tools/sentry-emulator/.gitignore |
Ignores Python and build artifacts plus sample Rust targets. |
tools/meson.build |
Adds Meson option-driven emulator subdir and an e2e Meson test. |
meson.options |
Adds with_emulator option toggle. |
requirements.txt |
Adds Python build + gRPC/protobuf dependencies for CI/tooling. |
REUSE.toml |
Adds additional REUSE annotations for local build/analysis artifacts. |
.github/workflows/emulation.yml |
New CI workflow to build and run emulator e2e tests under Meson. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adding emulator-backed sleep() support
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.
UAPI crate for x86_64 sentry kernel emulation
By now, are excluded from this PR: HW-related manipulations, app capabilities (no restriction to start with) and SHM.