Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL scrubs important environment variables #70005

Open
compnerd opened this issue Nov 22, 2023 · 0 comments
Open

REPL scrubs important environment variables #70005

compnerd opened this issue Nov 22, 2023 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. REPL Windows Platform: Windows

Comments

@compnerd
Copy link
Member

Description
The REPL scrubs TMP, TEMP, and USERPROFILE from the environment when it launches. This is problematic for Windows as these are important to certain API usage.

Steps to reproduce

swift repl
1> import Foundation
2> try "contents".write(toFile: "file.txt", atomically: true, encoding: .ascii)

Expected behavior
I expect this to be successful. However, this requires that the environment variables be set so that the Win32 APIs for computing the temporary directory function properly.

Environment

  • Swift compiler version info:

Swift version 5.11-dev (LLVM fe9a485647a386d, Swift 104d19bca0ea745)
Target: x86_64-unknown-windows-msvc

  • Xcode version info:
  • Deployment target: Windows 11 22H2
@compnerd compnerd added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels Windows Platform: Windows REPL and removed triage needed This issue needs more specific labels labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. REPL Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

1 participant