Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72449

Outputs "xcrun: error: no utility name specified" when compiling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.11.2
    • Fix Version/s: 5.12.1, 5.12.2
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Environment:
      Mac OS X 10.11.6
      Xcode 9.1
      GNU Make 3.81
    • Platform/s:
      macOS
    • Commits:
      5af60d3b371360285af442d1ee194b44d681f297 (qt/qtbase/5.12)

      Description

      I am basically copying a forum post I made about this issue:

       

      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 
      

       

      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'. 

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            buddenha Oswald Buddenhagen
            Reporter:
            btse Bradley Tse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes