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: Enviroment Variables are not correctly inherited from system on … #6164

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

tpasternak
Copy link
Contributor

…MacOS

Use CONSOLE ParentEnvironmentType instead of SYSTEM

CONSOLE is the default value initialized in GeneralCommandLineso it was used before. Now, if we want to inherit the system envs we use SYSTEM, so in both cases it differs from what was there before. This PR just brings the old behavior in case a user wants to inherit enviroment from the system.

https://github.com/JetBrains/intellij-community/blob/9838665ba816fc8ce06e4071aa5a906a35fbb22e/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L85C1-L86C1

fixes #6163

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: <please reference the issue number or url here>

Description of this change

…MacOS

Use CONSOLE ParentEnvironmentType instead of SYSTEM

CONSOLE is the default value initialized in GeneralCommandLineso it was used before. Now, if we want to inherit the system envs we use SYSTEM,
so in both cases it differs from what was there before. This PR just brings the old behavior in case a user wants to inherit enviroment from the system.

https://github.com/JetBrains/intellij-community/blob/9838665ba816fc8ce06e4071aa5a906a35fbb22e/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L85C1-L86C1

fixes bazelbuild#6163
@tpasternak tpasternak marked this pull request as ready for review February 27, 2024 20:31
@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Feb 27, 2024
Copy link
Collaborator

@blorente blorente left a comment

Choose a reason for hiding this comment

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

Thanks for the swift change!

@tpasternak
Copy link
Contributor Author

tpasternak commented Feb 27, 2024

Oh, does it mean the ParentEnvironmentType.SYSTEM was not intentional? That was my only concern

@blorente

@tpasternak
Copy link
Contributor Author

ok if so, I think we can merge and publish a hotfix @mai93

@blorente
Copy link
Collaborator

I would like it to be SYSTEM if the user ticks the "inherit" box, but I agree that right now there's a bug and the this gets people unblocked. I'm happy to iterate on making it work properly later.

@blorente
Copy link
Collaborator

Ideally, we'd toggle between SYSTEM and CONSOLE, depending on whether the toggle was clicked or not.

@blorente
Copy link
Collaborator

Let's merge and hot fix, I'll iterate in the morning

@tpasternak tpasternak merged commit 2fd70a8 into bazelbuild:master Feb 27, 2024
10 checks passed
@tpasternak tpasternak deleted the fix-console-env branch February 27, 2024 21:44
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Feb 27, 2024
mai93 pushed a commit that referenced this pull request Feb 27, 2024
…MacOS (#6164)

Use CONSOLE ParentEnvironmentType instead of SYSTEM

CONSOLE is the default value initialized in GeneralCommandLineso it was used before. Now, if we want to inherit the system envs we use SYSTEM,
so in both cases it differs from what was there before. This PR just brings the old behavior in case a user wants to inherit enviroment from the system.

https://github.com/JetBrains/intellij-community/blob/9838665ba816fc8ce06e4071aa5a906a35fbb22e/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L85C1-L86C1

fixes #6163
mai93 pushed a commit that referenced this pull request Feb 27, 2024
…MacOS (#6164)

Use CONSOLE ParentEnvironmentType instead of SYSTEM

CONSOLE is the default value initialized in GeneralCommandLineso it was used before. Now, if we want to inherit the system envs we use SYSTEM,
so in both cases it differs from what was there before. This PR just brings the old behavior in case a user wants to inherit enviroment from the system.

https://github.com/JetBrains/intellij-community/blob/9838665ba816fc8ce06e4071aa5a906a35fbb22e/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L85C1-L86C1

fixes #6163
@dsimonov-canva
Copy link

Sorry, folks, just a question from an outsider here: The issue that was addressed in this PR has made the plugin completely unusable for many developers in my company. Have you considered covering it with some form of tests to ensure it's not reintroduced in the future?

@tpasternak
Copy link
Contributor Author

Yep definitely we should :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Env vars are lost in bazel run configurations
4 participants