Skip to content
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

aquery_differ doesn't show difference in Environment variables #10391

Closed
keith opened this issue Dec 9, 2019 · 5 comments
Closed

aquery_differ doesn't show difference in Environment variables #10391

keith opened this issue Dec 9, 2019 · 5 comments
Labels
good first issue help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Performance Issues for Performance teams type: feature request

Comments

@keith
Copy link
Member

keith commented Dec 9, 2019

If you use aquery_differ to diff 2 aquery proto files and you pass both --attrs=inputs and --attrs=cmdline, if there is a difference in the Environment keys of actions it will not appear in the final diff

@meisterT meisterT added team-Performance Issues for Performance teams P2 We'll consider working on this in future. (Assignee optional) labels Dec 12, 2019
@meisterT meisterT added P3 We're not considering working on this, but happy to review a PR. (No assignee) help wanted Someone outside the Bazel team could own this and removed P2 We'll consider working on this in future. (Assignee optional) labels May 11, 2020
@sudsj
Copy link

sudsj commented Jun 11, 2020

Hi, I saw this is a good first issue, so I want to try fixing this issue. How should I go about doing this ?
I tried reading aquery_differ.py but I can't figure out where's the issue.

@joeleba
Copy link
Member

joeleba commented Nov 11, 2020

@keith could you please provide a minimal way to reproduce the issue?

@keith
Copy link
Member Author

keith commented Nov 16, 2020

In a tiny project with an empty WORKSPACE and:

# BUILD
cc_library(
    name = "foo",
    srcs = ["foo.c"],
)

# foo.c
void foo() {}

run:

bazel aquery foo --output=proto > /tmp/noenv.proto
bazel aquery --action_env=FOO=BAR foo --output=proto > /tmp/env.proto

Then in a bazel checkout run:

bazel run //tools/aquery_differ -- --before=/tmp/noenv.proto --after=/tmp/env.proto

In this case no difference is produced. But using -s you can see these differ with the env var:


$ bazel build foo -s
INFO: Analyzed target //:foo (3 packages loaded, 146 targets configured).
INFO: Found 1 target...
SUBCOMMAND: # //:foo [action 'Compiling foo.c', configuration: 63cc040ed2b86a512099924e698df6e0b9848625e6ca33d9556c5993dccbc2fb, execution platform: @local_config_platform//:host]
(cd /private/var/tmp/_bazel_ksmiley/1fb2af3fe9ab063484352bf1778d83fa/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=11.0 \
    PATH=/Users/ksmiley/Library/Caches/bazelisk/downloads/bazelbuild/bazel-3.7.0-darwin-x86_64/bin:.git/safe/../../.build/debug:/Users/ksmiley/.gem/bin:/Users/ksmiley/.pyenv/shims:/Users/ksmiley/.pyenv/bin:/Users/ksmiley/go/bin:/usr/local/opt/make/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/ksmiley/Library/Android/sdk/tools:/Users/ksmiley/Library/Android/sdk/platform-tools:/Users/ksmiley/.lyftkube-bin:/Users/ksmiley/dev/lyft/k8stools:/Users/ksmiley/dev/arcanist/bin:/Users/ksmiley/.bin:/Users/ksmiley/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin \
    XCODE_VERSION_OVERRIDE=12.2.0.12B45b \
  external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG -iquote . -iquote bazel-out/darwin-fastbuild/bin -MD -MF bazel-out/darwin-fastbuild/bin/_objs/foo/foo.d '-frandom-seed=bazel-out/darwin-fastbuild/bin/_objs/foo/foo.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=11.0' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c foo.c -o bazel-out/darwin-fastbuild/bin/_objs/foo/foo.o)
Target //:foo up-to-date:
  bazel-bin/libfoo.a
  bazel-bin/libfoo.so
INFO: Elapsed time: 0.371s, Critical Path: 0.12s
INFO: 2 processes: 1 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 2 total actions
$ bazel build foo -s --action_env=FOO=BAR
INFO: Analyzed target //:foo (3 packages loaded, 146 targets configured).
INFO: Found 1 target...
SUBCOMMAND: # //:foo [action 'Compiling foo.c', configuration: e68fb7c6d21d5b0d038e004ffd72b846caf21f744afb32b4726a6b396a76b67e, execution platform: @local_config_platform//:host]
(cd /private/var/tmp/_bazel_ksmiley/1fb2af3fe9ab063484352bf1778d83fa/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=11.0 \
    FOO=BAR \
    PATH=/Users/ksmiley/Library/Caches/bazelisk/downloads/bazelbuild/bazel-3.7.0-darwin-x86_64/bin:.git/safe/../../.build/debug:/Users/ksmiley/.gem/bin:/Users/ksmiley/.pyenv/shims:/Users/ksmiley/.pyenv/bin:/Users/ksmiley/go/bin:/usr/local/opt/make/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/ksmiley/Library/Android/sdk/tools:/Users/ksmiley/Library/Android/sdk/platform-tools:/Users/ksmiley/.lyftkube-bin:/Users/ksmiley/dev/lyft/k8stools:/Users/ksmiley/dev/arcanist/bin:/Users/ksmiley/.bin:/Users/ksmiley/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin \
    XCODE_VERSION_OVERRIDE=12.2.0.12B45b \
  external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG -iquote . -iquote bazel-out/darwin-fastbuild/bin -MD -MF bazel-out/darwin-fastbuild/bin/_objs/foo/foo.d '-frandom-seed=bazel-out/darwin-fastbuild/bin/_objs/foo/foo.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=11.0' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c foo.c -o bazel-out/darwin-fastbuild/bin/_objs/foo/foo.o)
Target //:foo up-to-date:
  bazel-bin/libfoo.a
  bazel-bin/libfoo.so
INFO: Elapsed time: 0.387s, Critical Path: 0.12s
INFO: 2 processes: 1 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 2 total actions

@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Apr 26, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Performance Issues for Performance teams type: feature request
Projects
None yet
Development

No branches or pull requests

5 participants
@keith @meisterT @joeleba @sudsj and others