commit | 7a66ae3fcbf3c3507badd645622ac0f7e984059d | [log] [tgz] |
---|---|---|
author | Michael Bolin <mbolin@fb.com> | Thu Oct 10 11:33:21 2013 -0700 |
committer | Michael Bolin <mbolin@fb.com> | Fri Oct 11 11:27:48 2013 -0700 |
tree | b991c26159959f5fa50fd930c8bb0905c2ea6375 | |
parent | db4e2a925ac3a3892104af6e47406189f9da39ea [diff] |
Limit a genrule's runtime environment variables to those that appear in the command string. Summary: We are seeing problems in the wild where we are exceeding exec's ARG_MAX limit with genrules that have extremely long lists of environment variables. ($DEPS is the biggest offender, and will ultimately be deleted.) This is intended as a quick fix. The long-term fix is to interpolate the env variables in place in the command string as we do for `$(location)` and `$(exe)`. This will also simplify Windows support where env variables appear as `$OUT` in the `bash` argument, but `%OUT%` in the `cmd_exe` argument. Care must be taken to escape the interpolated variables correctly. Admittedly, this will introduce a regression for genrules that are using environment variables in the scripts that they run, but do not reference them in the command string. A notice will be sent out. Test Plan: Sandcastle builds. Ran `buck build fb4a messenger instagram` with this diff. Everything built successfully, which is good, as this exercises most of the genrules in the codebase. This is evidence that there are few, if any, genrules in fbandroid that use environment variables that are not referenced explicitly in the command string.
Buck is an Android build tool. To see what Buck can do for you, check out the documentation at http://facebook.github.io/buck/.
To build Buck, run the following:
git clone git@github.com:facebook/buck.git cd buck ant ./bin/buck --help
Apache License 2.0