depends: llvm-ranlib (etc): "No such file or directory" on Intel macOS 15.0 #30978

issue Sjors opened this issue on September 26, 2024
  1. Sjors commented at 12:52 PM on September 26, 2024: member

    Tried on Intel macOS 15.0 (Xcode 16.0) and 13.7 (Xcode 15.2):

    $ cd depends
    $ make
    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    Fetching libevent-2.1.12-stable.tar.gz from ...
    

    It does seem to finish building dependencies, but I haven't tested if they actually work.

    I do have /usr/bin/{ranlib,strip,nm,objdump,dsymutil}.

  2. itornaza commented at 4:46 PM on September 26, 2024: contributor

    I replicated the same on Apple silicon (Apple M2 Max) and the same setup (macos 15.0 and Xcode 16.0). Also checked that /usr/bin/{ranlib,strip,nm,objdump,dsymutil} are present on my system. The compilation process successfully completes.

    Also, when I try make download-osx, I get the following related ouput

    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    
  3. itornaza commented at 5:51 PM on September 27, 2024: contributor

    Following the macOS Build Guide I am using the llvm installed from brew and in my .zshrc I have an export to override the default macos llvm export PATH="$(brew --prefix)/opt/llvm/bin:$PATH".

    Using the which command with the missing tools, I get the corresponding tool paths that are of course not the ones in the usr/bin/ directory.

    % which llvm-ranlib
    /opt/homebrew/opt/llvm/bin/llvm-ranlib
    
    % which llvm-strip
    /opt/homebrew/opt/llvm/bin/llvm-strip
    
    % which llvm-nm
    /opt/homebrew/opt/llvm/bin/llvm-nm
    
    % which llvm-objdump
    /opt/homebrew/opt/llvm/bin/llvm-objdump
    
    % which dsymutil
    /opt/homebrew/opt/llvm/bin/dsymutil
    
    

    According to this observation I could think of the following solutions that all of them do the compilation and do not display the error messages.

    Solution 1

    Running make with the tools defined inline.

    RANLIB=llvm-ranlib STRIP=llvm-strip NM=llvm-nm OBJDUMP=llvm-objdump DSYMUTIL=dsymutil make

    Solution 2

    Define the tools in the ~/.zshrc file:

    export RANLIB=llvm-ranlib
    export STRIP=llvm-strip
    export NM=llvm-nm
    export OBJDUMP=llvm-objdump
    export DSYMUTIL=dsymutil
    

    Solution 3

    Define them in our ./depends/Makefile:

    RANLIB := llvm-ranlib
    STRIP := llvm-strip
    NM := llvm-nm
    OBJDUMP := llvm-objdump
    DSYMUTIL := dsymutil
    
  4. fanquake commented at 9:41 AM on October 2, 2024: member

    Tried on Intel macOS 15.0 (Xcode 16.0) and 13.7 (Xcode 15.2):

    Tried which code? If this was a clean build, according to the log, it's also skipped building Boost for some reason?

    This looks odd, because you seem to be hitting code paths for macOS cross-compilation, when building natively. i.e when building on macOS, the tooling should be found by calling xcrun:

    https://github.com/bitcoin/bitcoin/blob/fc642c33ef28829eda0119a0fe39fd9bc4b84051/depends/builders/darwin.mk#L4-L8

    I got hold of a macOS machine running 15.0, and wasn't able to recreate at fc642c33ef28829eda0119a0fe39fd9bc4b84051.

  5. Sjors commented at 10:52 AM on October 2, 2024: member

    I get it every time on master and any branch I test on.

    Here's the initial log from a clean run on fc642c33ef28829eda0119a0fe39fd9bc4b84051 on Intel macOS 15.0:

    git clean -dfx
    cd depends
    make
    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    Fetching boost_1_81_0.tar.gz from https://archives.boost.io/release/1.81.0/source/
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
     35  133M   35 47.4M    0     0  12.6M      0  0:00:10  0:00:03  0:00:07 12.6M^Cmake: *** Deleting file `/Users/sjors/dev/bitcoin/depends/sources/download-stamps/.stamp_fetched-boost-boost_1_81_0.tar.gz.hash'
    make: *** [/Users/sjors/dev/bitcoin/depends/sources/download-stamps/.stamp_fetched-boost-boost_1_81_0.tar.gz.hash] Interrupt: 2
    

    the tooling should be found by calling xcrun

    Indeed it finds those:

    % xcrun -f ranlib
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
    

    Same on my (Intel) iMac running macOS 13.7 (with Xcode 15.2 manually installed):

    % xcrun -f ranlib
    /Applications/Xcode15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
    
  6. Sjors commented at 10:55 AM on October 2, 2024: member

    Mmm, maybe it's because my macOS 15.0 machine has the full Xcode install? (not needed for Bitcoin Core)

  7. Sjors commented at 10:59 AM on October 2, 2024: member

    Deleting Xcode (on the macOS 15.0 machine) doesn't fix the error.

    It's possible that the installation made permanent changes, but this does point to a new place:

     % xcrun -f ranlib          
    /Library/Developer/CommandLineTools/usr/bin/ranlib
    

    I'll try a reboot.


    Reboot didn't help. I also tried removing Homebrew llvm (19.1), just in case that was interfering, but it made no difference.

    I also tried using env -i zsh -f to get rid of potential interference from PyEnv and similar tools, but that didn't help.


    I wrote in the description:

    but I haven't tested if they actually work.

    I have since, and afaik everything works fine despite these errors.

  8. itornaza commented at 9:21 AM on October 4, 2024: contributor

    Same error messages as @Sjors on a clean build as well.

    ioannis@ergot_a depends % make
    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    Fetching boost_1_81_0.tar.gz from https://archives.boost.io/release/1.81.0/source/
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      8  133M    8 12.0M    0     0   672k      0  0:03:23  0:00:18  0:03:05  734k
    

    Noticing that in the error messages display llvm-ranlib as opposed to ranlib ? On my system they live in different locations because llvm-ranlib is under the brew installation.

    ioannis@ergot_a bitcoin % which ranlib; which llvm-ranlib; xcrun -f ranlib
    /usr/bin/ranlib
    /opt/homebrew/opt/llvm/bin/llvm-ranlib
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
    

    I hope this helps a little.

  9. willcl-ark commented at 1:41 PM on October 4, 2024: member

    I also see this issue on MacOS 15.0.

    This looks odd, because you seem to be hitting code paths for macOS cross-compilation, when building natively. i.e when building on macOS, the tooling should be found by calling xcrun:

    I don't think this is correct? These checks are coming from hosts/darwin.mk which IIUC is the correct host file to be usedwhen building on a darwin host?:

    https://github.com/bitcoin/bitcoin/blob/51c698161b54402f9a8302c9a36f28a4db01fc4f/depends/hosts/darwin.mk#L19-L24

    I think this still works correctly, despite the error, is because the darwin builder overrides the host config:

    https://github.com/bitcoin/bitcoin/blob/51c698161b54402f9a8302c9a36f28a4db01fc4f/depends/builders/darwin.mk#L12-L20

  10. itornaza commented at 4:33 PM on October 5, 2024: contributor

    To get a better understanding I run some experiments on the depeds/hosts/darwin.mk file.

    When either:

    1. Comment out the lines with the definitions of darwin_RANLIB, darwin _STRIP, darwin_OBJDUMP, darwin_NM, and darwin_DSYMUTIL, or

    2. Set the values there as

    RANLIB := llvm-ranlib
    STRIP := llvm-strip
    NM := llvm-nm
    OBJDUMP := llvm-objdump
    DSYMUTIL := dsymutil
    

    instead of

    darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil")
    darwin_NM=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-nm")
    darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump")
    darwin_RANLIB=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ranlib")
    darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
    

    the errors are not present. However, I do not at present understand the implications of this change in other OS configurations.

    It seems that during these $(shell...) assignments the shell is invoked and produces that error but then as @willcl-ark points out, the job is correctly handled by the depends/builders/darwin.mk

  11. maflcko added the label macOS on Oct 24, 2024
  12. maflcko added the label Build system on Oct 24, 2024
  13. hebasto commented at 11:55 AM on January 10, 2025: member

    From my understanding, the issue arises because the make provided by Xcode does not set the .SHELLFLAGS variable properly. Here's an example of the output:

    % whereis make
    make: /usr/bin/make /Applications/Xcode.app/Contents/Developer/usr/share/man/man1/make.1
    % make --version
    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    
    This program built for i386-apple-darwin11.3.0
    % make -C depends print-.SHELLFLAGS 2>/dev/null 
    /bin/sh: command -v llvm-ranlib: No such file or directory
    /bin/sh: command -v llvm-strip: No such file or directory
    /bin/sh: command -v llvm-nm: No such file or directory
    /bin/sh: command -v llvm-objdump: No such file or directory
    /bin/sh: command -v dsymutil: No such file or directory
    .SHELLFLAGS=
    

    This might be related to the fact that "This program built for i386-apple-darwin11.3.0," while the system is x86_64 rather than i386. However, I am not entirely certain, as the following output suggests otherwise:

    % file /usr/bin/make 
    /usr/bin/make: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
    /usr/bin/make (for architecture x86_64):	Mach-O 64-bit executable x86_64
    /usr/bin/make (for architecture arm64e):	Mach-O 64-bit executable arm64e
    

    The Homebrew's make works just fine:

    % whereis gmake
    gmake: /usr/local/bin/gmake /usr/local/share/man/man1/gmake.1
    % gmake --version
    GNU Make 4.4.1
    Built for x86_64-apple-darwin24.0.0
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    % gmake -C depends print-.SHELLFLAGS            
    gmake: Entering directory '/Users/hebasto/dev/bitcoin/depends'
    .SHELLFLAGS=-c
    gmake: Leaving directory '/Users/hebasto/dev/bitcoin/depends'
    

    That said, the mentioned code can be improved regardless of this issue.

    I think there is no need to set darwin_<TOOL> variables in hosts/darwin.mk only to override them later in builders/darwin.mk. Instead, they should be defined in the former file directly as follows:

    ifeq ($(build_os),darwin)
      darwin_AR := $(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
      ...
    else
      darwin_AR := $(shell xcrun -f ar)
      ...
    endif
    
  14. itornaza commented at 11:20 AM on January 20, 2025: contributor

    From my understanding, the issue arises because the make provided by Xcode does not set the .SHELLFLAGS variable properly.

    With @hebasto 's insight, I have tested just setting .SHELLFLAGS=-c at the top of depends/hosts/darwin.mk and no other changes from the original.

    The error seems now to be suppressed for the non-GNU Make version that macos uses.

    Any thoughts?

  15. Sjors commented at 12:38 PM on March 17, 2025: member

    "fixing" this with #32086...

  16. Sjors closed this on May 6, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me