Ticket #4487 (closed defect: wontfix)
mcdiff fails on macOS because of wrong diff support
Reported by: | frin | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | mcdiff | Version: | 4.8.29 |
Keywords: | macos | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
- What version of Midnight Commander is used?
GNU Midnight Commander 4.8.29
Built with GLib 2.76.3
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.11.0
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems:
cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types:
char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
- What steps will reproduce the problem?
Make two files and run from terminal: mcdiff file1 file2
- What is the expected output?
mcdiff should run and print a diff
- What do you see instead?
I get an error "Two files are needed to compare" and the following output:
diff: unrecognized option `--old-group-format=%df%(f=l?:,%dl)d%dE
... and a lot of unformatted help output
I've seen some old post from 2017 (here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219277 ) referring to FreeBSD that it uses different version of diff and that's why it's failing. Since macOS's diff is FreeBSD based I guess it's the same issue here.
This is the output of diff version:
diff --version Apple diff (based on FreeBSD diff)
Output from mc -F:
Home directory: /Users/frin
Profile root directory: /Users/frin
[System data]
Config directory: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/etc/mc/
Data directory: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/share/mc/
File extension handlers: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/libexec/mc/ext.d/
VFS plugins and scripts: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/libexec/mc/
extfs.d: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/libexec/mc/extfs.d/
fish: /opt/homebrew/Cellar/midnight-commander/4.8.29_2/libexec/mc/fish/
[User data]
Config directory: /Users/frin/.config/mc/
Data directory: /Users/frin/.local/share/mc/
skins: /Users/frin/.local/share/mc/skins/
extfs.d: /Users/frin/.local/share/mc/extfs.d/
fish: /Users/frin/.local/share/mc/fish/
mcedit macros: /Users/frin/.local/share/mc/mc.macros
mcedit external macros: /Users/frin/.local/share/mc/mcedit/macros.d/macro.*
Cache directory: /Users/frin/.cache/mc/
mc --configure-options output:
'--disable-debug' '--disable-dependency-tracking' '--disable-silent-rules' '--prefix=/opt/homebrew/Cellar/midnight-commander/4.8.29_2' '--without-x' '--with-screen=slang' '--enable-vfs-sftp' 'CC=clang' 'PKG_CONFIG_PATH=/opt/homebrew/opt/pcre2/lib/pkgconfig:/opt/homebrew/opt/glib/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig:/opt/homebrew/opt/libssh2/lib/pkgconfig:/opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/s-lang/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/13'
Running macOS Ventura 13.3.1 on Mac Studio (M1 Max), running mc inside either iTerm2 or Apple's own Terminal app. The diff being used is /usr/bin/diff. Midnight Commander is installed via brew. Let me know if you ned any further information.
Unfortunately, there is not much we can do about it. I asked if BSD people can extend their diff on the tracker, but your best chance is to use GNU diff: https://formulae.brew.sh/formula/diffutils . I reported it to Homebrew, let's see what do they think about it.
https://github.com/Homebrew/homebrew-core/issues/178759