It seems that genrule's bazel-out/volatile-status.txt and bazel-out/stable-status.txt retain all variables produced by workspace_status_command.
However, cc_library's build-info-volatile.h retains only:
#define BUILD_TIMESTAMP 1477468904621
#define BUILD_SCM_REVISION "0"
#define BUILD_SCM_STATUS ""
and build-info-nonvolatile.h retains only:
#define BUILD_EMBED_LABEL ""
#define BUILD_HOST "localhost"
#define BUILD_USER "me"
ignoring everything else.
It seems that
genrule'sbazel-out/volatile-status.txtandbazel-out/stable-status.txtretain all variables produced byworkspace_status_command.However,
cc_library'sbuild-info-volatile.hretains only:and
build-info-nonvolatile.hretains only:ignoring everything else.