ITADN

case sensitivity of `Path` environment variable on windows

#446Closedcobbal 创建于 2023-11-25
C
cobbalcommented
Trying to run swift from emacs on windows (niche use case, I know) I was running into an error about swift not being able to find "swift-test.exe". Checking environment variables, I think I've tracked this down to a combination of emacs using unconventional capitalization, and a case sensitivity inside of SPM. When run from cmd.exe, the environment variable is `Path=C:\...`, but from emacs it's `PATH=C:\...` From https://github.com/apple/swift-tools-support-core/blob/4d539ff4c3d75394a78e17f68b675ad82434dd71/Sources/TSCBasic/ProcessEnv.swift#L55-L62 it looks like swift is looking for the "Path" one and not doing the typical-on-windows case insensitive lookup. This brings me finally to a question: Is this a swift bug and/or an emacs bug? As far as I understand, while "Path" is the official casing, environment variables are expected to be treated insensitively on windows (which works a bit unfortunately with swift's representation as `[String: String]`) I can create a PR to fix this, and I may file a bug against emacs as well, but I wanted to check first, since my windows experience is pretty limited.
关闭于 2023-12-19 2 条评论