Skip to content

case sensitivity of Path environment variable on windows #446

Closed
@cobbal

Description

@cobbal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions