Propagate SSL/proxy environment to pip and uv subprocesses#7012
Open
pdelagrave wants to merge 1 commit intomainfrom
Open
Propagate SSL/proxy environment to pip and uv subprocesses#7012pdelagrave wants to merge 1 commit intomainfrom
pdelagrave wants to merge 1 commit intomainfrom
Conversation
The environment map configured via PythonRewriteRpc.builder().environment() was applied to the RPC server process but not to the pip bootstrap subprocess (bootstrapOpenrewrite) or uv subprocesses (via UvExecutor). This caused pip install and uv commands to fail behind corporate proxies with SSL inspection, since they never received SSL_CERT_FILE, PIP_CERT, or proxy configuration. - Apply environment to the pip ProcessBuilder in bootstrapOpenrewrite() - Add environment parameter to UvExecutor.run() and thread it through DependencyWorkspace, UvLockRegeneration, SetupCfgParser, and RequirementsTxtParser via explicit method/constructor parameters - In PythonRewriteRpc, pass commandEnv to parseManifest() parsers and createSetupPyMarker() so all downstream subprocess calls inherit SSL/proxy configuration - Backward-compatible overloads with empty maps for all public APIs
818a677 to
e78d1e6
Compare
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.
Problem
The environment map configured via
PythonRewriteRpc.builder().environment()(containingSSL_CERT_FILE, proxy vars, etc.) was applied to the RPC server process but not to:bootstrapOpenrewrite()UvExecutor(used byDependencyWorkspace,UvLockRegeneration, etc.)This caused
pip install openrewriteand uv commands to fail behind corporate proxies with SSL inspection, because the subprocesses never receivedSSL_CERT_FILE,PIP_CERT, or proxy configuration.fixes: https://github.com/moderneinc/customer-requests/issues/1891
Solution
environmentmap to the pipProcessBuilderinbootstrapOpenrewrite()environmentparameter toUvExecutor.run()and thread it explicitly throughDependencyWorkspace,UvLockRegeneration,SetupCfgParser, andRequirementsTxtParservia method/constructor parametersPythonRewriteRpc, passcommandEnvtoparseManifest()parsers andcreateSetupPyMarker()so all downstream subprocess calls inherit SSL/proxy configurationCompanion CLI PR: https://github.com/moderneinc/moderne-cli/pull/3520