Create rustpython-host-env and move shared host abstractions out of rustpython-common#7582
Draft
Create rustpython-host-env and move shared host abstractions out of rustpython-common#7582
rustpython-host-env and move shared host abstractions out of rustpython-common#7582Conversation
Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/c7b357d7-d749-46c2-ab85-166ec68ea551 Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/c7b357d7-d749-46c2-ab85-166ec68ea551 Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create rustpython-host-env crate for better sandbox support
Create Apr 11, 2026
rustpython-host-env and move shared host abstractions out of rustpython-common
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.
This change starts the
host_envisolation plan by moving the shared OS-facing helpers out ofrustpython-commoninto a dedicatedrustpython-host-envcrate. The goal is to make host access explicit in crate dependencies and reduce accidental leakage of host-only code into sandbox-oriented builds.New
rustpython-host-envcratecrates/host_envto the workspacerustpython-host-envas the home for shared host abstractions with no Python runtime dependencyoscrt_fdfileutilswindowsmacrosMoved host-specific shared code out of
rustpython-commoncrates/common/src/intocrates/host_env/src/rustpython-commonnix,windows-sys, andwidestringfromrustpython-commonnow that those dependencies belong to the new host crateDependency graph updated
rustpython-host-envto workspace dependenciesrustpython-vmandrustpython-stdlibto depend onrustpython-host-envrustpython-vmasvm::host_envfor internal/external consumersImport migration in VM / stdlib / top-level consumers
rustpython_common::{os, crt_fd, fileutils, windows, suppress_iph}withrustpython_host_env(orcrate::host_env/vm::host_envwhere appropriate)Example of the migration pattern:
This keeps the behavioral surface unchanged while making host-environment coupling explicit at the crate boundary, which is the foundation for tighter sandbox enforcement in follow-up work.