-
Notifications
You must be signed in to change notification settings - Fork 264
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
Pass environment variable to compiler #1023
Comments
We try heavily not to use environment variables since that seriously limits
cache sharing.
Why does this need to be an environment variable?
Is this value constant but the only supported input mechanism is via env
variable?
|
Yeah it is constant in a way that it should not be changed between builds. It just controls macro expansion. Example of such macro and fix that will actually work with |
We had this in our
Could you try and see if you can access it? Also- please expect delays due to corona and limited capacity |
It is not about time when tests are run, it is about time when tests are compiled. And currently there is no way of providing any env variable so that it would be visible by compiler |
The line I gave you was an example. In bazel compilation and tests are both actions. |
to be clear- AFAICT rules_scala is WAI. |
Closing since it sounds this is a usage problem. |
I wasn't able to find a way to pass environment variable to compiler on build or test.
Neither
--action_env
has any effect, nor there is any parameter inscala_library
/scala_binary
/scala_test
that can be used for that matter.Motivation: there are some macros that are configured through environment variables which need to be set on compile time, specifically scalactic. Probably it should be fixed in scalactic itself, but with 3.1.x it seems easier to fix it in rules_scala than try to migrate from older versions and there may be other plugins with same behavior anyway.
As I could understand code in rules_scala it looks not so hard to fix (but I may be wrong since I'm not really familiar with the codebase) by just passing additional argument from
scala_*
(say namedcompiler_env
all the way to invocation of compiler. As for--action_env
it may even be better but I don't really know how it works and more specifically why it doesn't.The text was updated successfully, but these errors were encountered: