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

Homebrew-bundle update breaks activation script #19

Closed
stackptr opened this issue Apr 2, 2024 · 6 comments · Fixed by #21
Closed

Homebrew-bundle update breaks activation script #19

stackptr opened this issue Apr 2, 2024 · 6 comments · Fixed by #21

Comments

@stackptr
Copy link

stackptr commented Apr 2, 2024

When updating the homebrew-bundle flake input to include Homebrew/homebrew-bundle#1335, the homebrew activation script breaks:

building the system configuration...
setting up Homebrew (/opt/homebrew)...
user defaults...
setting up user launchd services...
Homebrew bundle...
Error: Your Homebrew is too outdated for `brew bundle`. Please run `brew update`!

Not clear if this change impacts users of homebrew via nix-darwin, but I'm putting this issue here since I supply the flake input to nix-homebrew.taps, e.g.:

inputs = {
  ...
  nix-darwin.url = "github:LnL7/nix-darwin";
  nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
  homebrew-bundle = {
    url = "github:homebrew/homebrew-bundle";
    flake = false;
  };
  homebrew-core = {
    url = "github:homebrew/homebrew-core";
    flake = false;
  };
  homebrew-cask = {
    url = "github:homebrew/homebrew-cask";
    flake = false;
  };
};

 nix-homebrew.taps = {
  "homebrew/homebrew-bundle" = homebrew-bundle;
  "homebrew/homebrew-core" = homebrew-core;
  "homebrew/homebrew-cask" = homebrew-cask;
};
@stackptr stackptr changed the title Homebrew bundle Homebrew-bundle update breaks activation script Apr 2, 2024
stackptr added a commit to stackptr/rc that referenced this issue Apr 2, 2024
Does not update `Homebrew/homebrew-bundle` input due to: zhaofengli/nix-homebrew#19
@bart-sofomo
Copy link

I've just run into that issue - any way to fix that or we have to wait for some new version?

@sbarrios93
Copy link

I've just run into that issue - any way to fix that or we have to wait for some new version?

You need to rollback the flake.lock for the homebrew inputs.

@mjarosie
Copy link

mjarosie commented Apr 3, 2024

I've just run into that issue - any way to fix that or we have to wait for some new version?

You need to rollback the flake.lock for the homebrew inputs.

How can that be done exactly? Would I just point at some specific commit by modifying nodes.homebrew-bundle.locked.rev in flake.lock?

BTW for context: I'm just trying to set nix-homebrew up and arrived at the error above after explicitly adding homebrew/bundle tap to address this error that I was getting: #9

@mjarosie
Copy link

mjarosie commented Apr 3, 2024

I'm trying to understand the issue - where exactly is the homebrew version specified? What would need to be updated to make the error go away? homebrew/bundle checks for the homebrew version to be above 4.2.15 and I've just installed brew via nix-homebrew today for the first time.

Output of brew --version:

Homebrew >=4.1.0 (shallow or no git repository)
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Homebrew/homebrew-core (no Git repository)
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Homebrew/homebrew-cask (no Git repository)

Output of brew config:

HOMEBREW_VERSION: >=4.1.0 (shallow or no git repository)
ORIGIN: (none)
HEAD: (none)
Last commit: never
Core tap HEAD: (none)
Core tap last commit: never
Core tap branch: (none)
Core cask tap origin: 
Core cask tap HEAD: (none)
Core cask tap last commit: never
Core cask tap branch: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew/Library/.homebrew-is-managed-by-nix
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nano
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_INSTALL_FROM_API: set
Homebrew Ruby: 3.1.4 => /nix/store/65r5y4k0lhwgvbv76sdxbb8gldhq3v1g-ruby-3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.44.0 => /nix/store/v164ksb5p2cp4hr18nadn1i7zln9p23h-git-2.44.0/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.4.1-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

zhaofengli added a commit that referenced this issue Apr 3, 2024
homebrew-bundle now depends on $HOMEBREW_VERSION, which is set by
`brew.sh` using the output of `git describe`. We don't have a git
repo, so let's embed the version directly.

Fixes #19.
zhaofengli added a commit that referenced this issue Apr 3, 2024
homebrew-bundle now depends on $HOMEBREW_VERSION, which is set by
`brew.sh` using the output of `git describe`. We don't have a git
repo, so let's embed the version directly.

Fixes #19.
@zhaofengli
Copy link
Owner

Thanks for the report! #21 should fix this issue.

zhaofengli added a commit that referenced this issue Apr 3, 2024
homebrew-bundle now depends on $HOMEBREW_VERSION, which is set by
`brew.sh` using the output of `git describe`. We don't have a git
repo, so let's embed the version directly.

Fixes #19.
@mjarosie
Copy link

mjarosie commented Apr 4, 2024

Thanks, after removing my flake.lock and reactivating the environment I'm not getting the error anymore. Current output of brew --version is:

Homebrew 4.2.16
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Homebrew/homebrew-core (no Git repository)
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Homebrew/homebrew-cask (no Git repository)

micnncim added a commit to micnncim/nix-config that referenced this issue Apr 5, 2024
Especially fixes
zhaofengli/nix-homebrew#19.

Signed-off-by: micnncim <micnncim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants