Closed paris-ci closed 2 years ago
With an old brew, run
How old? Need a version or Git revision here.
I'm not sure, but I updated it 12 hours ago. I'd say it'll fail as long as it auto updates.
Can't reproduce this without a sense of how old the old version was, sorry.
Can't reproduce this without a sense of how old the old version was, sorry.
I think you don't understand, no matter how old the version is, you just need the auto-update.
I re-ran it now, with the current brew version but with older packages, and I still get the same bug
mv "$HOME"/.Brewfile "$HOME"/.Brewfile.old || true
brew bundle dump --describe --all --global
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 4 taps (homebrew/cask-versions, homebrew/command-not-found, homebrew/core and homebrew/cask).
==> New Formulae
page
You have 27 outdated formulae and 4 outdated casks installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
Error: No such file or directory - brew
So if you see
==> Auto-updated Homebrew!
You know that it will fail.
==> Auto-updated Homebrew!
You know that it will fail.
I see this: it doesn't fail.
This looks specific to your environment. I'd look at the output of
env | grep -E '^HOMEBREW_'
and unset anything that isn't documented in man brew
. It might help to set it before/after (maybe both) the command that fails in your script.
This looks specific to your environment. I'd look at the output of
env | grep -E '^HOMEBREW_'
and unset anything that isn't documented in
man brew
. It might help to set it before/after (maybe both) the command that fails in your script.
env | grep -E '^HOMEBREW_'
HOMEBREW_PREFIX=/opt/homebrew HOMEBREW_CELLAR=/opt/homebrew/Cellar HOMEBREW_REPOSITORY=/opt/homebrew
Seems fine to me...
I ran the same command with debug and verbose, maybe it can help?
Try this patch and see if it helps:
diff --git a/lib/bundle/brew_services.rb b/lib/bundle/brew_services.rb
index c5db96c..272f5bd 100644
--- a/lib/bundle/brew_services.rb
+++ b/lib/bundle/brew_services.rb
@@ -31,7 +31,7 @@ module Bundle
def started_services
@started_services ||= if Bundle.services_installed?
states_to_skip = %w[stopped none]
- `brew services list`.lines.map do |line|
+ Utils.safe_popen_read(HOMEBREW_BREW_FILE, "services", "list").lines.map do |line|
name, state, _plist = line.split(/\s+/)
next if states_to_skip.include? state
Apply it to $(brew --repository homebrew/bundle)
.
Do
git -C "$(brew --repository homebrew/bundle)" restore .
when you're done to avoid future potential issues with brew update
.
Thanks for the patch.
I applied and ran it, it seems like it works just fine.
Great, opened https://github.com/Homebrew/homebrew-bundle/pull/1111.
brew config
outputbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I have a backup script that I can run that dumps my databases to disk and generate a brew bundle file before actually backing up the disk.
The script looks like this :
Unfortunately, when I run it for the first time in the morning, the following happens:
What happened (include all command output)?
==> Backup script loaded with hb arguments () — Prebackups to /Users/XXXX/backups ==> Ensuring backup path (/Users/arthur/backups) exists ==> Running temporary backups ===> MySQL Backup mysqldump: [Warning] Using a password on the command line interface can be insecure. ===> PostgreSQL Backup ===> Brewfile update Running
brew update --auto-update
... ==> Auto-updated Homebrew! Updated 4 taps (homebrew/command-not-found, homebrew/core, homebrew/cask and homebrew/cask-drivers). ==> New Casks calibrite-ccprofilerYou have 13 outdated formulae and 4 outdated casks installed. You can upgrade them with brew upgrade or list them with brew outdated.
Error: No such file or directory - brew
What did you expect to happen?
I expected the "$HOME"/.Brewfile to be created and the software not to fail. This is the previous behavior.
Step-by-step reproduction instructions (by running
brew
commands)You should get the following output
Running the command a second time works just fine.