Preserve environment for script subprocesses - #73
Draft
jkramer5103 wants to merge 1 commit into
Draft
Conversation
jkramer5103
force-pushed
the
agent/preserve-subprocess-environment
branch
from
July 17, 2026 04:38
ab77f20 to
6d58875
Compare
Contributor
Author
|
Currently don't have a windows machine to test this issue, im pretty sure this fixes it, but I asked the person that submitted the issue to test it out, we'll see. |
maxuser0
reviewed
Jul 20, 2026
| @@ -0,0 +1,21 @@ | |||
| // SPDX-FileCopyrightText: © 2026 jkramer5103 <info@jkramertech.com> | |||
Owner
There was a problem hiding this comment.
See this recent commit about copyright attribution going forward:
Existing sources still have the old copyright notices, but I'll update those over time.
| @@ -0,0 +1,31 @@ | |||
| // SPDX-FileCopyrightText: © 2026 jkramer5103 <info@jkramertech.com> | |||
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.
What changed
ProcessBuilderso they inherit Minecraft's environmentPYTHONPATH,MINESCRIPT_COMMAND_PATH, and custom command environment values=Root cause
Runtime.exec(command, envp)treats a non-nullenvpas the subprocess's complete environment. Minescript passed only its custom variables, so standard Windows variables such asLOCALAPPDATAwere removed.The Windows Python Install Manager uses
LOCALAPPDATAwhile scanning unmanaged installations. When Minescript launched the defaultWindowsApps\\python3.exealias without that variable, Python Manager tried to construct a path fromNoneand printed:Python Manager catches that exception and continues, which is why scripts still worked while the warning appeared for every invocation.
Fixes #69.
Validation
./gradlew --configure-on-demand :common:test— passes:common:compileJava— passes as part of the test taskgit diff --check— passesThe repository's unrestricted Gradle configuration currently fails before task execution because ForgeGradle rejects the repository's Gradle 9.2 wrapper. Configuration-on-demand isolates and validates the affected
commonmodule.