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

Runtime envdef handles case-insensitive environment variable names on Windows. #3553

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Oct 22, 2024

TaskDX-3030 Handle/merge PATH case insensitively on Windows

@mitchell-as
Copy link
Contributor Author

mitchell-as commented Oct 22, 2024

Test failures are known issues and unrelated to this PR.

We read the case-insensitive version as needed, but replace it with our case-sensitive version (e.g. "Path" -> "PATH").
@mitchell-as mitchell-as requested a review from Naatan October 22, 2024 21:04
@mitchell-as mitchell-as marked this pull request as ready for review October 22, 2024 21:04
Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

In addition to the comments, can we make sure there is a test case covering this mechanic (specifically: PATH and Path on Windows).

pkg/runtime/internal/envdef/environment.go Show resolved Hide resolved
Comment on lines 397 to 401
if pev.Name != osName {
// On Windows, delete the case-insensitive version. Our case-sensitive version has already
// processed the value of the case-insensitive version.
delete(res, osName)
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if pev.Name != osName {
// On Windows, delete the case-insensitive version. Our case-sensitive version has already
// processed the value of the case-insensitive version.
delete(res, osName)
}
if pev.Name != osName {
// Delete the redundant value that ours could conflict with
// Eg. this would delete "Path" while preserving our "PATH"
delete(res, osName)
}

@mitchell-as mitchell-as force-pushed the mitchell/dx-3030 branch 3 times, most recently from 26bd059 to fee33f5 Compare October 23, 2024 18:54
@mitchell-as mitchell-as merged commit a86d14d into version/0-47-0-RC1 Oct 23, 2024
8 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-3030 branch October 23, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants