You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bazel-...@googlegroups.com
Hi,
I'm writing some genrules that access scripts that rely on System environment variables. I can't find anything in the docs on how to allow (or pass) genrules access to the system environment variables.
Is this supported? If so how do I do it?
Thanks
Indigo
Han-Wen Nienhuys
unread,
Apr 22, 2015, 4:10:20 AM4/22/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Indigo Orton, bazel-...@googlegroups.com
The environment of rules is standardized to increase reproducibilty.
One way of addressing this is to set environment variables explicitly, eg.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bazel-...@googlegroups.com, indigo...@gmail.com
Thanks Han-Wen, that works for a few of the variables (e.g. sdk-location variables), however it doesn't help for things like CMake variables.
As much as I hate it, I currently use CMake to compile my JNI library (it is the easiest way I've found with generated code, and I was using CMake before so it wasn't hard to bring into Bazel). When I try to configure from the CMakeLists.txt I get errors regarding CMake compiler flags/variables (specifically "CMAKE_C_COMPILER_ENV_VAR" and "CMAKE_CXX_COMPILER_ENV_VAR"). When I run the same commands outside of the genrule it all works fine, so it is the environment.
Is there a better way to do jni compilation (aside from an Android.mk and storing all jni sources in a jni folder in an Android project)? Will imagine this will be supported in the mid year release? What can I do until then?
Ulf Adams
unread,
Apr 22, 2015, 3:48:02 PM4/22/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Indigo Orton, bazel-...@googlegroups.com
Well, cc_library and friends are intended to compile C++ code. If you want to build for Android, it shouldn't be too tricky to write a corresponding CROSSTOOL file. Is this 'only' an Android app or do you also have other code in your repo?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bazel-...@googlegroups.com, indigo...@gmail.com
Lots of other code. We have backend, web, Android and iOS (Android and iOS share the C++ code). I'll look into building a CROSSTOOL, but it would be nice to have someway of bringing these kind of environment variables.