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

fix: keep the case when getting the executable #2528

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented Nov 21, 2024

For comparison purposes we were always lower-casing the executable name. However, we also returned the lowercase version and exposed executables as lowercase which doesn't match user expectations.

With this PR we are instead returning the original case.

I cannot judge if this affects current exposed binaries. However, I assume we would just keep the lower-case exposed binary as written in the global manifest and only change newly installed tools.

fixes #2478

@wolfv wolfv requested a review from Hofer-Julian November 21, 2024 07:27
@baszalmstra
Copy link
Contributor

If I remember correctly we did this in purpose. On windows the casing doesnt matter and we ran into issues were the specified name did not match the actual file.

Perhaps we should just limit normalizing the casing on oses that are case insensitive (mac and windows)?

tracing::debug!("Could not find 'PATHEXT' variable, using a default list");
[
".COM", ".EXE", ".BAT", ".CMD", ".VBS", ".VBE", ".JS", ".JSE", ".WSF", ".WSH", ".MSC",
".CPL",
".com", ".exe", ".bat", ".cmd", ".vbs", ".vbe", ".js", ".jse", ".wsf", ".wsh", ".msc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PATHEXT variable also uses uppercase so I would keep it that way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because the strings were followed by a to_lowercase, but sure, I can keep it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this keeps current behavior, let's leave it as is

@Hofer-Julian
Copy link
Contributor

Perhaps we should just limit normalizing the casing on oses that are case insensitive (mac and windows)?

Sounds like a good idea to me. Ideally we would normalize depending on the filesystem, not OS. But for now I think switching behaviour depending on OS is fine.

@wolfv
Copy link
Member Author

wolfv commented Nov 21, 2024

@baszalmstra I can't come up with a scenario where this would fail. The original .exe files would have had the same casing anyways.

@wolfv
Copy link
Member Author

wolfv commented Nov 21, 2024

I highly doubt it was intentional. This is the original PR introducing this: https://github.com/prefix-dev/pixi/pull/2136/files

Also note: there is no test that fails now. Let's just keep the original casing.

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't come up with a scenario where this would fail.

Let's bring this in then.

Note, that macos-arm tests are timing out, but this is unrelated to this PR.

@Hofer-Julian Hofer-Julian merged commit fd47c13 into prefix-dev:main Nov 21, 2024
40 of 41 checks passed
@wolfv wolfv deleted the case-sensitive-exe-from-path branch November 21, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom exposed executable for global environments are no longer case sensitive
3 participants