diff options
author | 2018-08-08 10:43:59 -0700 | |
---|---|---|
committer | 2018-08-08 10:45:57 -0700 | |
commit | f2a07a7336445b9b427c144c95663c2f2649a307 (patch) | |
tree | f4408c5b57fa270456deef047f512e6fb59ffa17 /src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | |
parent | 8ed7d9670e619b6c0d2ef35ace61ede1562b9d56 (diff) |
Improve error messaging for constraints violations.
1) Break up dense lines with clearer pretty-printing.
2) When a violation happens because of a select(), mention
both the target with the select (as before) *and*
the dep that the select() chose.
3) Integrate this messaging into --target_environment violations,
which currently provide no info about the root cause.
Examples:
-------------------------------------
select() + compatible_with violation:
-------------------------------------
Before:
ERROR: /workspace/testapp/BUILD:41:1: in cc_binary rule //testapp:top: the current command-line flags disqualify all supported environments because of incompatible select() paths:
environment: //constraints:p removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1)
After:
ERROR: /workspace/testapp/BUILD:41:1: in cc_binary rule //testapp:top: the current command line flags disqualify all supported environments because of incompatible select() paths:
environment: //constraints:p
removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1)
which has a select() that chooses dep: //testapp:glib
which lacks: //constraints:p.
-------------------------------------
select() + --target_environment=//constraints:p violation:
-------------------------------------
Before:
ERROR: This is a restricted-environment build.
- //testapp:top does not support required environment //constraints:p
After:
ERROR: This is a restricted-environment build.
//testapp:top does not support:
environment: //constraints:p
removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1)
which has a select() that chooses dep: //testapp:g
which lacks: //constraints:p
Fixes: #5795
PiperOrigin-RevId: 207910308
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java')
0 files changed, 0 insertions, 0 deletions