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

Properly kill the buck2 daemon #5863

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Oct 4, 2024

Fix the buck2 kill command. Because of scoping issues, in some cases we only ran " kill" because the local value of $BUCK2 was empty.

This should help avoid failures like

  Error validating working directory
  Caused by:
      0: Failed to stat `/home/ubuntu/cmodi/executorch/buck-out/v2`
      1: ENOENT: No such file or directory

which are typically fixed by running buck2 kill.

Add "COMMAND_ECHO" to the kill command to show what we're running.

Also, make the function consistently use executorch_root as the working directory. We should always run buck2 from the ET repo.

Test Plan:

rm -rf buck-out
(rm -rf cmake-out \
    && mkdir cmake-out \
    && cd cmake-out \
    && cmake ..)

Output showed that the local variable works:

-- Resolved buck2 as /Users/***/local/executorch/cmake-out/buck2-bin/buck2-99773fe6f7963a72ae5f7b737c02836e.
-- Killing buck2 daemon
'/Users/***/local/executorch/cmake-out/buck2-bin/buck2-99773fe6f7963a72ae5f7b737c02836e kill'

And that the parent variable still works:

-- ******** Summary ********
...
--   BUCK2                         : /Users/***/local/executorch/cmake-out/buck2-bin/buck2-99773fe6f7963a72ae5f7b737c02836e

Summary:
Fix the `buck2 kill` command. Because of scoping issues, in some cases we only ran "` kill`" because the local value of `$BUCK2` was empty.

This should help avoid failures like

```
  Error validating working directory
  Caused by:
      0: Failed to stat `/home/ubuntu/cmodi/executorch/buck-out/v2`
      1: ENOENT: No such file or directory
```

which are typically fixed by running `buck2 kill`.

Add "COMMAND_ECHO" to the kill command to show what we're running.

Also, make the function consistently use `executorch_root` as the working directory. We should always run buck2 from the ET repo.

Reviewed By: byjlw

Differential Revision: D62676219

fbshipit-source-id: 28f032a05d2c66dc21b30c783617eb1a77e28e64
Copy link

pytorch-bot bot commented Oct 4, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5863

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 7257958 with merge base eecf74f (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2024
@dbort
Copy link
Contributor Author

dbort commented Oct 4, 2024

Manual cherry-pick of #5373 from 70aee72. pytorchbot didn't work on it.

Copy link
Contributor

@dvorjackz dvorjackz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very helpful 🙏🏻

@dvorjackz dvorjackz merged commit 58d72fd into pytorch:release/0.4 Oct 4, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants