-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[bazel] Add --config=shell for easier debugging #79350
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
Conversation
🔗 Helpful links
✅ No Failures (24 Pending)As of commit 4dbe368 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Current failure is a flake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds awesome!
tools/bazel_tools/shellwrap.sh
Outdated
# OR | ||
# bazel run --config=shell //:target | ||
|
||
shell="/bin/bash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be single quotes or unquoted. Only use double quotes if you want something expanded within the string.
tools/bazel_tools/shellwrap.sh
Outdated
# OR | ||
# bazel run --config=shell //:target | ||
|
||
shell="/bin/bash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should shell default to user's shell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using a shell specific --noprofile
and --rcfile
.
zsh for example doesn't have the --noprofile
(I think it has but under different name).
tools/bazel_tools/shellwrap.sh
Outdated
export PYTORCH_SHELL_COMMAND=$* | ||
echo "alias run=\"$*\"" > "$rcfile" | ||
echo "PS1='\s-\v\$ '" >> "$rcfile" | ||
echo "cat" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these three lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's my debug output :P removed
@pytorchbot merge |
@pytorchbot successfully started a merge job. Check the current status here |
Merge failed due to This PR is too stale; the last push date was more than 3 days ago. Please rebase and try again. |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
Successfully rebased |
7830385
to
4dbe368
Compare
@pytorchbot merge |
@pytorchbot help |
❌ 🤖 pytorchbot command failed:
Try |
@pytorchbot successfully started a merge job. Check the current status here |
Hey @vors. |
Summary: Bazel quality of life improvement. This change adds a new option `--config=shell` which allows you to drop-in the shell right before the `bazel run` command is executed. For example you will have ability to examine bazel sandbox this way, run things under gdb instead of a normal run and so on. Example usage: ``` bazel run --config=shell //:init_test ``` Pull Request resolved: #79350 Approved by: https://github.com/dagitses Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/972a209284c0f0795738a4b872c6c693cce0b619 Reviewed By: atalman Differential Revision: D37455718 Pulled By: atalman fbshipit-source-id: 4e212326c24100fad7556ecb0d7854bdc97d4a09
Bazel quality of life improvement.
This change adds a new option
--config=shell
which allows you to drop-in the shell right before thebazel run
command is executed. For example you will have ability to examine bazel sandbox this way, run things under gdb instead of a normal run and so on.Example usage: