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

[release/6.0] Implement Environment.GetEnvironmentVariables for Apple platforms using official API for iOS/tvOS/MacCatalyst #58254

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

akoeplinger
Copy link
Member

Backport of #58161 to release/6.0 branch

Customer Impact

After calling Environment.GetEnvironmentVariables() if you tried to retrieve a single environment variable (e.g. HOME) you'd get an empty result. The reason is that Environment.GetEnvironmentVariables() retrieves and then caches a dictionary of all available environment variables which are then also used for Environment.GetEnvironmentVariable(string variable). The problem was that we used to return an empty array for the environment variables in the runtime for iOS/tvOS (which worked fine in mono/mono since we didn't have this caching in the managed layer).

#58161 fixes this by properly implementing a way to get all available environment variables.

Testing

Manual testing on iOS arm64 device. Verified single environment variables can be accessed even after calling Environment.GetEnvironmentVariables() and that the API returns all the env vars.

Risk

Low. We return environment variables now where we used to return an empty dictionary.

Fixes #58156

…ng official API (dotnet#58161)

Move environment handling from Mono runtime to System.Native

Fixes dotnet#58156

Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Adeel Mujahid <[email protected]>
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@lambdageek lambdageek added the Servicing-consider Issue for next servicing release review label Aug 27, 2021
@akoeplinger akoeplinger removed the Servicing-consider Issue for next servicing release review label Aug 27, 2021
@akoeplinger
Copy link
Member Author

@lambdageek backports to RC2 only need M2 approval (i.e. Marek), so we don't need the Servicing-consider label.

@akoeplinger akoeplinger merged commit 4cf2af2 into dotnet:release/6.0 Aug 27, 2021
@akoeplinger akoeplinger deleted the backport-apple-env branch August 27, 2021 14:22
@ghost ghost locked as resolved and limited conversation to collaborators Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants