Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

xcrun: error: no utility name specified



  • I'm porting my code to Qt 5.11 and I now get this message when I build my project:

    cd momagse/ && ( test -e Makefile || /usr/local/Cellar/qt/5.11.2/bin/qmake -o Makefile /Users/brad/labcode/qt56_port/momagse/momagse.pro -config release ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile

    OUTPUT:

    xcrun: error: no utility name specified
    Usage: xcrun [options] <tool name> ... arguments ...

    Find and execute the named command line tool from the active developer
    directory.

    The active developer directory can be set using xcode-select, or via the
    DEVELOPER_DIR environment variable. See the xcrun and xcode-select manual
    pages for more information.

    Options:
    -h, --help show this help message and exit
    --version show the xcrun version
    -v, --verbose show verbose logging output
    --sdk <sdk name> find the tool for the given SDK name
    --toolchain <name> find the tool for the given toolchain
    -l, --log show commands to be executed (with --run)
    -f, --find only find and print the tool path
    -r, --run find and execute the tool (the default behavior)
    -n, --no-cache do not use the lookup cache
    -k, --kill-cache invalidate all existing cache entries
    --show-sdk-path show selected SDK install path
    --show-sdk-version show selected SDK version
    --show-sdk-build-version show selected SDK build version
    --show-sdk-platform-path show selected SDK platform path
    --show-sdk-platform-version show selected SDK platform version

    It seems to still build fine, but I don't know why this is output. Does anyone know how to fix this?

    A bit more info:
    Mac OS X 10.11.6
    Xcode 8.1 8B62
    GNU Make 3.81


  • Lifetime Qt Champion

    Hi,

    Do you know the exact line of the Makefile that triggers that ?



  • After some more debugging, I was able to fix this by updating my XCode version to 9.1, MacOS SDK 10.13 and also updating my OS from Yosemite to High Sierra.

    I don't know which of these fixed the problem, but I'm not getting that output anymore.



  • Scratch that, I didn't actually resolve this.


  • Lifetime Qt Champion

    Then, my question still is valid.



  • This post is deleted!


  • @SGaist After some more digging, I've found some things:

    1. This only happens for apps and not libs
    2. I build my projects in debug_and_release mode, so it generates 3 Makefiles: Makefile, Makefile.Debug, Makefile.Release
    3. I noticed that this only occurs when I do "make" instead of explicitly stating the debug or release versions (make -f Makefule.Debug), so this led me to believe there was something unique about "Makefile".
    4. So I went and poked around a bit and noticed this line:
    include /usr/local/Cellar/qt/5.11.2/mkspecs/features/mac/sdk.mk
    

    I navigated to that file and found this line in that file:

    CURRENT_MAC_SDK_VERSION := $(shell /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version)
    

    I was able to reproduce the output in the original post with the following command:

    /usr/bin/xcrun --sdk -show-sdk-version
    

    If I do what it's supposed to do:

    /usr/bin/xcrun --sdk macosx -show-sdk-version
    

    Then it produces the expected output of:

    10.13
    

    So that would suggest $(EXPORT_QMAKE_MAC_SDK) was undefined, so I went back into the qmake generated Makefile and noticed this:

    MAKEFILE      = Makefile
    
    first: release
    install: release-install
    uninstall: release-uninstall
    include /usr/local/Cellar/qt/5.11.2/mkspecs/features/mac/sdk.mk
    QMAKE         = /usr/local/bin/qmake511
    DEL_FILE      = rm -f
    CHK_DIR_EXISTS= test -d
    MKDIR         = mkdir -p
    COPY          = cp -f
    COPY_FILE     = cp -f
    COPY_DIR      = cp -f -R
    INSTALL_FILE  = install -m 644 -p
    INSTALL_PROGRAM = install -m 755 -p
    INSTALL_DIR   = cp -f -R
    QINSTALL      = /usr/local/bin/qmake511 -install qinstall
    QINSTALL_PROGRAM = /usr/local/bin/qmake511 -install qinstall -exe
    DEL_FILE      = rm -f
    SYMLINK       = ln -f -s
    DEL_DIR       = rmdir
    MOVE          = mv -f
    TAR           = tar -cf
    COMPRESS      = gzip -9f
    DISTNAME      = momadataview1.0.0
    DISTDIR = /Users/brad/labcode/qt5/momadataview/build/release/obj/momadataview1.0.0
    SUBTARGETS    =  \
    		release \
    		debug
    
    
    ####### Custom Variables
    EXPORT_QMAKE_MAC_SDK = macosx
    EXPORT_QMAKE_MAC_SDK_VERSION = 10.13
    ...
    

    Notice how the "Include" line comes before the definition of "EXPORT_QMAKE_MAC_SDK" and "EXPORT_QMAKE_MAC_SDK_VERSION" at the bottom.

    So, it looks like this is why this is happening. To test my hypothesis, I went and moved the two variables above the include and reran "make". Lo and behold, this was my output:

    /Library/Developer/CommandLineTools/usr/bin/make -f Makefile.Release
    make[1]: Nothing to be done for `first'.
    

    I suppose this is a bug then? I'm surprised this was not caught during testing, it seems like a pretty normal work flow.

    It's possible there's something wrong with my Qt version or I'm doing something wrong in my project files.


  • Lifetime Qt Champion

    Interesting results !

    Can you reproduce that with a minimal .pro file ?



  • Yup, so I created a new QWidget project with Qt Creator.

    I manually added "CONFIG += debug_and_release" to the .proj file and I was able to reproduce the initial problem.

    Seems like "debug_and_release" mode really got screwed around in Qt5+. I actually have another bug ticket already open because "debug_and_release" auto generates "debug" and "release" dirs when I don't want it to (even with "debug_and_release_target" removed), which it never did in Qt4's qmake.


  • Lifetime Qt Champion

    Can post the link to the ticket ?

    Can you test with Qt 5.12's beta ?



  • Hi,
    any news about this?
    I just upgrded to Qt 5.11.2 and McOS 10.14.1.
    Now i get the same problem.

    xcrun: error: no utility name specified
    Usage: xcrun [options] <tool name> ... arguments ...
    
    Find and execute the named command line tool from the active developer
    directory.
    
    The active developer directory can be set using `xcode-select`, or via the
    DEVELOPER_DIR environment variable. See the xcrun and xcode-select manual
    pages for more information.
    
    Options:
      -h, --help                  show this help message and exit
      --version                   show the xcrun version
      -v, --verbose               show verbose logging output
      --sdk <sdk name>            find the tool for the given SDK name
      --toolchain <name>          find the tool for the given toolchain
      -l, --log                   show commands to be executed (with --run)
      -f, --find                  only find and print the tool path
      -r, --run                   find and execute the tool (the default behavior)
      -n, --no-cache              do not use the lookup cache
      -k, --kill-cache            invalidate all existing cache entries
      --show-sdk-path             show selected SDK install path
      --show-sdk-version          show selected SDK version
      --show-sdk-build-version    show selected SDK build version
      --show-sdk-platform-path    show selected SDK platform path
      --show-sdk-platform-version show selected SDK platform version
    


  • No, it's annoying but I've been ignoring it since it doesn't actually break anything.

    Here's the bug ticket I just created about it: https://bugreports.qt.io/browse/QTBUG-72449

    I have not tested to see if this was resolved with Qt 5.12. I'll try that sometime soon.



  • @btse

    @btse said in xcrun: error: no utility name specified:

    Yup, so I created a new QWidget project with Qt Creator.

    I manually added "CONFIG += debug_and_release" to the .proj file and I was able to reproduce the initial problem.
    Videoder Tubemate Snaptube
    Seems like "debug_and_release" mode really got screwed around in Qt5+. I actually have another bug ticket already open because "debug_and_release" auto generates "debug" and "release" dirs when I don't want it to (even with "debug_and_release_target" removed), which it never did in Qt4's qmake.

    I created a new QWidget assignment with Qt author.

    I manually delivered "CONFIG += debug_and_release" to the .proj file and i used to be capable of reproduce the preliminary trouble.

    looks as if "debug_and_release" mode certainly got screwed around in Qt5+. I simply have every other trojan horse price tag already open because "debug_and_release" automobile generates "debug" and "release" dirs after I don't want it to (despite "debug_and_release_target" eliminated), which it in no way did in Qt4's qmake.



  • @fouad1995 Yup, I actually created a bug about this one also: https://bugreports.qt.io/browse/QTBUG-71437

    Seems like it's too low priority for them to actually do anything about it. I haven't tried to see if this was somehow resolved in 5.12 yet, but I find it unlikely.


  • Banned

    This post is deleted!

Log in to reply