-
Notifications
You must be signed in to change notification settings - Fork 316
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
Add support for setting Environment Variables via Run Configuration #2042
Comments
Also running into this and would love to see support for this through Intellij. |
As a slightly grim workaround, you can use |
@ns476 That's still way better than launching intellij from the CLI with env vars set, which is what I was doing. Thanks! |
@ns476 your approach works for me but unfortunately can't debug with it
|
@alice-ks I have an idea to implement this by re-using the EnvironmentVariablesState component that is used by the Python run config, but making it global by applying it in ScopedBlazeProcessHandler using Does this sound like a reasonable approach? I can submit a PR if it is. Especially since --run_under doesn't work in various scenarios (eg debug) |
@JamyDev just curious whether this progressed. Environment variables are a common way to supply runtime parameters to services running in k8s, so this would be very useful! |
@trinque We have this in our internal fork, so I guess I could PR it. But I never got an answer from the maintainers so kind of lost track of it :)) |
If it's not too much trouble, I'd greatly appreciate it! Plugin maintainers, can we get @JamyDev some love on this potential PR? Not being able to set environment variables is making for brittle work-arounds on our end. @JamyDev if you need help getting that PR over the finish line, I'm happy to help however I can, including contributing code. |
Very cool! I built and tested locally and saw the new environment variable field was present for a py_binary rule, but the field is not showing up for a java_binary rule yet. I'll dig in and see if I can understand why. |
@trinque I can see it show up for my test: Not sure why it says "Generic Handler" though |
Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-maintainer". Please reach out to the triage team ( |
I see this is marked as stale. Would still like this feature 🙏 But the run under trick did actually work, so that's great 🎉. I've been searching for that answer for years. |
Also interested in this being baked into the IntelliJ UI like most other Run/Debug configurations. |
+1, repeatedly adding the same environment variables to each config really makes it to tedious to use bazel with intellij. |
Looking forward to this one :) |
@ahmedyarub it's already available in the latest version |
What about #5885? |
This may be a naive request since I have no knowledge Intellij's Plugin API, but would it be possible to add a field in Bazel run configurations to be able to set ad-hoc environment variables for a given executable?
For example, the Java run configurations have this field available allowing for environment variables to be set per run configuration:
Intellij docs capture the ability:
https://www.jetbrains.com/help/idea/run-debug-configuration-application.html
At the moment my current workaround is to add an
export VAR=value
to my shell dotfile, which is error-prone and difficult to manage 😭The text was updated successfully, but these errors were encountered: