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

macvim is missing links such as xxd, which vim normally provides #182408

Closed
4 tasks done
5HT2 opened this issue Aug 25, 2024 · 3 comments · Fixed by #182410
Closed
4 tasks done

macvim is missing links such as xxd, which vim normally provides #182408

5HT2 opened this issue Aug 25, 2024 · 3 comments · Fixed by #182410
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@5HT2
Copy link

5HT2 commented Aug 25, 2024

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

HOMEBREW_VERSION: 4.3.17-138-g36a0e53
ORIGIN: https://github.com/Homebrew/brew
HEAD: 36a0e539e4317dc0ed070004d7f83f5507c16332
Last commit: 2 hours ago
Core tap HEAD: 2e8f9483559b88adae72b533af482fbef2ddb57f
Core tap last commit: 5 days ago
Core tap JSON: 25 Aug 01:36 UTC
Core cask tap HEAD: 428ee3bec877d6aa7e1366348632a3d56d599731
Core cask tap last commit: 5 days ago
Core cask tap JSON: 25 Aug 01:36 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 14.6.1-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false
# With vim linked

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  macvim

# With macvim linked

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  vim

# With macvim linked and vim uninstalled

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)?

Use xxd. For xxd reasons.

What happened (include all command output)?

The command output itself was as expected, but it lacked coloring.

I confirmed the following:

$ which xxd
/usr/bin/xxd

$ brew unlink macvim && brew link macvim
Unlinking /opt/homebrew/Cellar/macvim/9.1.0... 13 symlinks removed.
Linking /opt/homebrew/Cellar/macvim/9.1.0... 13 symlinks created.

$ which xxd
/usr/bin/xxd

$ ls /opt/homebrew/bin/ -latr
Sat Aug 24 21:42:01 2024 gview ⇒ ../Cellar/macvim/9.1.0/bin/gview
Sat Aug 24 21:42:01 2024 gvim ⇒ ../Cellar/macvim/9.1.0/bin/gvim
Sat Aug 24 21:42:01 2024 gvimdiff ⇒ ../Cellar/macvim/9.1.0/bin/gvimdiff
Sat Aug 24 21:42:01 2024 gvimex ⇒ ../Cellar/macvim/9.1.0/bin/gvimex
Sat Aug 24 21:42:01 2024 mview ⇒ ../Cellar/macvim/9.1.0/bin/mview
Sat Aug 24 21:42:01 2024 mvim ⇒ ../Cellar/macvim/9.1.0/bin/mvim
Sat Aug 24 21:42:01 2024 mvimdiff ⇒ ../Cellar/macvim/9.1.0/bin/mvimdiff
Sat Aug 24 21:42:01 2024 mvimex ⇒ ../Cellar/macvim/9.1.0/bin/mvimex
Sat Aug 24 21:42:01 2024 vi ⇒ ../Cellar/macvim/9.1.0/bin/vi
Sat Aug 24 21:42:01 2024 view ⇒ ../Cellar/macvim/9.1.0/bin/view
Sat Aug 24 21:42:01 2024 vim ⇒ ../Cellar/macvim/9.1.0/bin/vim
Sat Aug 24 21:42:01 2024 vimdiff ⇒ ../Cellar/macvim/9.1.0/bin/vimdiff
Sat Aug 24 21:42:01 2024 vimex ⇒ ../Cellar/macvim/9.1.0/bin/vimex

$ locate xxd | rg "homebrew.*vim.*bin/xxd"
/opt/homebrew/Cellar/macvim/9.1.0/MacVim.app/Contents/bin/xxd
/opt/homebrew/Cellar/vim/9.1.0600/bin/xxd

$ brew unlink vim
Unlinking /opt/homebrew/Cellar/vim/9.1.0600... 0 symlinks removed.

$ brew unlink macvim
Unlinking /opt/homebrew/Cellar/macvim/9.1.0... 13 symlinks removed.

$ brew link vim
Linking /opt/homebrew/Cellar/vim/9.1.0600... 187 symlinks created.

$ ls /opt/homebrew/bin/ -latr
Sat Aug 24 21:46:08 2024 ex ⇒ ../Cellar/vim/9.1.0600/bin/ex
Sat Aug 24 21:46:08 2024 rview ⇒ ../Cellar/vim/9.1.0600/bin/rview
Sat Aug 24 21:46:08 2024 rvim ⇒ ../Cellar/vim/9.1.0600/bin/rvim
Sat Aug 24 21:46:08 2024 vi ⇒ ../Cellar/vim/9.1.0600/bin/vi
Sat Aug 24 21:46:08 2024 view ⇒ ../Cellar/vim/9.1.0600/bin/view
Sat Aug 24 21:46:08 2024 vim ⇒ ../Cellar/vim/9.1.0600/bin/vim
Sat Aug 24 21:46:08 2024 vimdiff ⇒ ../Cellar/vim/9.1.0600/bin/vimdiff
Sat Aug 24 21:46:08 2024 vimtutor ⇒ ../Cellar/vim/9.1.0600/bin/vimtutor
Sat Aug 24 21:46:08 2024 xxd ⇒ ../Cellar/vim/9.1.0600/bin/xxd

$ realpath $(which xxd)
/opt/homebrew/Cellar/vim/9.1.0600/bin/xxd

$ ls -l $(which xxd)
Sat Aug 24 21:46:08 2024 /opt/homebrew/bin/xxd ⇒ ../Cellar/vim/9.1.0600/bin/xxd

What did you expect to happen?

I expected /opt/homebrew/Cellar/macvim/9.1.0/MacVim.app/Contents/bin/xxd to be linked, similar to how /opt/homebrew/Cellar/vim/9.1.0600/bin/xxd is linked.

This appears to be related to how brew chooses to hardcode which binaries it links, whereas it seems to just link vim binaries non-discriminately.

Relevant:

system "make"
# Parallel install could miss some symlinks
# https://github.com/vim/vim/issues/1031
ENV.deparallelize
# If stripping the binaries is enabled, vim will segfault with
# statically-linked interpreters like ruby
# https://github.com/vim/vim/issues/114
system "make", "install", "prefix=#{prefix}", "STRIP=#{which "true"}"
bin.install_symlink "vim" => "vi"

system "make"
prefix.install "src/MacVim/build/Release/MacVim.app"
bin.install_symlink prefix/"MacVim.app/Contents/bin/mvim"
# Create MacVim vimdiff, view, ex equivalents
executables = %w[mvimdiff mview mvimex gvim gvimdiff gview gvimex]
executables += %w[vi vim vimdiff view vimex]
executables.each { |e| bin.install_symlink "mvim" => e }

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

I have already included this above.
@5HT2 5HT2 added the bug Reproducible Homebrew/homebrew-core bug label Aug 25, 2024
@5HT2
Copy link
Author

5HT2 commented Aug 25, 2024

I am sorry about the formatting issue regarding the brew doctor output, I have now fixed this.

@gromgit
Copy link
Member

gromgit commented Aug 25, 2024

This appears to be related to how brew chooses to hardcode which binaries it links, whereas it seems to just link vim binaries non-discriminately.

No, it's all in how the respective source builds work:

  • vim builds dump all their binaries into the usual Cellar/.../bin directory, right where brew expects to find them for linking to its master bin directory
  • macvim builds dump all their binaries into a MacVim.app hierarchy, from which everything needed has to be manually symlinked into the usual Cellar/.../bin directory, right where brew expects to find them for linking to its master bin directory

The person who created the macvim formula just wasn't interested in xxd, is all. That's easily fixed, though.

gromgit added a commit to gromgit/homebrew-core that referenced this issue Aug 25, 2024
@ychin
Copy link
Contributor

ychin commented Oct 23, 2024

The person who created the macvim formula just wasn't interested in xxd, is all. That's easily fixed, though.

(Late to this thread) Actually, I (MacVim maintainer) only found out relatively recently that MacVim was not properly bundling xxd and fixed that in macvim-dev/macvim#1430. So it kind of makes sense why previously the formula didn't include xxd because it was not installed properly into the app bundle.

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.

3 participants