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

jj VCS cannot find correct libgit2 #177686

Closed
4 tasks done
nicholasjng opened this issue Jul 18, 2024 · 10 comments · Fixed by #177765
Closed
4 tasks done

jj VCS cannot find correct libgit2 #177686

nicholasjng opened this issue Jul 18, 2024 · 10 comments · Fixed by #177765
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@nicholasjng
Copy link
Contributor

brew gist-logs <formula> link OR brew config AND brew doctor output

~
➜ brew gist-logs jj
Error: No logs.

~
➜ brew config
HOMEBREW_VERSION: 4.3.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1c98a33a376e5b35ebc801d0f7d6ba7b9eb118ac
Last commit: 10 days ago
Core tap JSON: 18 Jul 05:25 UTC
Core cask tap JSON: 18 Jul 05:25 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: hx
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.3.3 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.45.2 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false

~
➜ brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Tried to follow the jujutsu VCS tutorial yesterday, got a dyld error about it being unable to locate the correct libgit2 version. It seems that it explicitly searches for [email protected], but the formula depends on libgit2 as of this writing:

➜ brew info jj
==> jj: stable 0.19.0 (bottled), HEAD
Git-compatible distributed version control system
https://github.com/martinvonz/jj
Installed
/opt/homebrew/Cellar/jj/0.19.0 (14 files, 15.8MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-07-18 at 07:27:35
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/j/jj.rb
License: Apache-2.0
==> Dependencies
Build: pkg-config ✔, rust ✔
Required: libgit2 ✔, openssl@3 ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 647 (30 days), 1,846 (90 days), 4,397 (365 days)
install-on-request: 648 (30 days), 1,846 (90 days), 4,397 (365 days)
build-error: 14 (30 days)

When I list libgit2's lib folder, it shows me the versioned dylib for libgit2 v1.8.1:

~
➜ ls /opt/homebrew/opt/libgit2/lib
libgit2.1.8.1.dylib libgit2.1.8.dylib   libgit2.a           libgit2.dylib       pkgconfig

So this seems to be a version mismatch of libgit2 for the jj formula.

What happened (include all command output)?

~
➜ jj --version
dyld[73987]: Library not loaded: /opt/homebrew/opt/libgit2/lib/libgit2.1.7.dylib
  Referenced from: <E8960ED2-AAE3-34EB-9B6F-057F96828A15> /opt/homebrew/Cellar/jj/0.19.0/bin/jj
  Reason: tried: '/opt/homebrew/opt/libgit2/lib/libgit2.1.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libgit2/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/opt/libgit2/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file)
zsh: abort      jj

What did you expect to happen?

jj just printing me the version.

Step-by-step reproduction instructions (by running brew commands)

brew install jj
jj --version
@nicholasjng nicholasjng added the bug Reproducible Homebrew/homebrew-core bug label Jul 18, 2024
@igorepst
Copy link

Sam thing happens for bat after the recent update

bat --version
dyld[73308]: Library not loaded: /opt/homebrew/opt/[email protected]/lib/libgit2.1.7.dylib
Referenced from: <968B81E5-4BAB-323C-8FD5-1BFB54F3052D> /opt/homebrew/Cellar/bat/0.24.0_1/bin/bat
Reason: tried: '/opt/homebrew/opt/[email protected]/lib/libgit2.1.7.dylib' (no such file), 
'/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/[email protected]/lib/libgit2.1.7.dylib' (no such file), 
'/opt/homebrew/opt/[email protected]/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no 
such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file), 
'/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file)

@darthShadow
Copy link
Contributor

Similar issue with gping too.

Had to run brew missing to find the correct missing dependencies, which turned out to be [email protected]. Installing that fixed the error.

@nicholasjng
Copy link
Contributor Author

Had to run brew missing to find the correct missing dependencies, which turned out to be [email protected]. Installing that fixed the error.

Just for further information, brew doctor suggested this too, but that did not fix it for me. From what I can see, the reason here is the dyld only considers brew --prefix libgit2 and /opt/homebrew/Cellar/libgit2/1.8.1/ as a library search path, but not brew --prefix [email protected].

@darthShadow
Copy link
Contributor

Yeah, I think jj just got missed in the libgit2 bump recently: #166767

It looks like the latest version still dependends on 1.7.2 (https://github.com/martinvonz/jj/blob/74c275ed10a7b45e1638fb00e53e29bc6286e8ba/Cargo.lock#L1828), so an explicity dependency to that version should have been added just like bat or gping.

@carlocab
Copy link
Member

jj needs to be switched to [email protected] and a revision bump -- please feel free to open a PR doing so.

The others (e.g. bat and gping) should be fixed by

brew install [email protected]

To be clear: manually installing [email protected] is, of course, a workaround. We hope to have it fixed properly soon.

@cho-m
Copy link
Member

cho-m commented Jul 18, 2024

In case of jj and git-interactive-rebase-tool, it looks like dependent tests were skipped in PR. I don't think we had any CI labels to do this so not sure what happened there. May need to watch out in case this is a bug in our CI workflow.

@alex
Copy link
Contributor

alex commented Jul 18, 2024

I think cargo-outdated likely needs to be switched to [email protected], is anything needed besides that switch in a PR?

@carlocab
Copy link
Member

I think cargo-outdated likely needs to be switched to [email protected], is anything needed besides that switch in a PR?

Just a revision bump as well, but that should be it!

@yarenty

This comment was marked as resolved.

@carlocab
Copy link
Member

carlocab commented Sep 5, 2024

for impatient:

brew install [email protected]

ln -s /usr/local/Cellar/[email protected]/1.7.2/lib/libgit2.1.7.2.dylib  /usr/local/opt/libgit2/lib/libgit2.1.7.dylib

There shouldn't be any need to do this. You just need to brew update && brew upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants