Repository navigation
fixes for --no-buckd - #280
Closed
martinpitt wants to merge 4 commits into
Closed
martinpitt wants to merge 4 commits into
martinpitt wants to merge 4 commits into
Conversation
A verb that needs a ready Buck without handing the process over to it has no entry point: everything from the cache shim to the config refresh lived inline in `buck_command()`. Move the preparation into `setup_buck()`. Signed-off-by: Martin Pitt <martin@amutable.com>
A service started as `buck run <target> &` keeps a Buck client alive for its whole runtime. With `--no-buckd` the client is also the daemon. No later Buck command may coexist with that, as it will kill the previous one. The actual command that runs does not actually *need* the buck client nor daemon: every piece is a plain buck-out artifact. Also, a signal to the job will hit the buck client instead of the target command. Introduce `tine exec` for such long-lived background services, which avoids both issues: it asks Buck for the run command line with `--emit-shell` and execs it, so the process owns its pid and Buck is gone once the build is. Signed-off-by: Martin Pitt <martin@amutable.com>
`tine box` is one case of a long-lived/indefinite target process which held a Buck client open for the whole box session. Reimplement it using the new `exec` mechanism. Same command, same arguments, but the box owns its pid and Buck exits after the build. Signed-off-by: Martin Pitt <martin@amutable.com>
The backgrounded `buck run` kept a Buck client as the server's pid for the whole group, which broke running with `--no-buckd`. Move it to our new `exec` mechanism. Signed-off-by: Martin Pitt <martin@amutable.com>
martinpitt
marked this pull request as draft
October 9, 2026 08:10
Member
Author
|
facebook/buck2#1551 updated. With that, we don't need this any more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am currently experimenting with
--no-buckdmode. This is currently broken, and buck itself needs some fixes for that which we need to pull into our fork if we want to go ahead with this: facebook/buck2#1551This series fixes a conceptual problem with long-running processes through
buck run, see the individual commits for details. We don't really need that if we decide to keep daemon mode, but OTOH this is relatively small and conceptually nice anyway.With this series, I can patch ci.sh to always use daemon-less mode, I had a
watch pgrep -af [b]uck2drunning in parallel:This needs the patched buck from the above PR. I built that locally and told tine to use it:
(note that this breaks the
remote-cachetest group, as that wants to write its owntine.local.toml).I had claude research how much it would cost to use daemon-less mode by default, and how much we can lose in both tine and our buck2 fork. My main motivation is to drop the inotify shenanigans, which are a gift that keeps on giving. The detailed plan: plan-tine-daemonless.md
TL/DR:
--no-buckdwould use by default.bin/tine buildinvocations break. What the daemon does is to serialize these requests, with daemonless they'd step on each other, so tine needs to do the locking itself (flock on buck-out).tine.pywould not be a net shrinkage: we can lose a few dozen lines of daemon management, but the flock stuff brings back about an equal amount.Verdict/personal recommendation: this PR is cheap enough that we should land it to make
--no-buckdfunctional for people who use it explicitly. Going the full way is not the big win that we hoped for, but might still be worth it to avoid the trouble we ran into yesterday with Rodrigo. Let's discuss it, but not do it in a whim.