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

unable to find utility *, not a developer tool or in PATH #3931

Open
rolfbjarne opened this issue Apr 13, 2018 · 6 comments
Open

unable to find utility *, not a developer tool or in PATH #3931

rolfbjarne opened this issue Apr 13, 2018 · 6 comments
Labels
enhancement The issue or pull request is an enhancement iOS Issues affecting iOS macOS Issues affecting macOS
Milestone

Comments

@rolfbjarne
Copy link
Member

Steps to Reproduce

  1. Ensure the system Xcode (as defined by xcode-select -p) points to a different Xcode than Visual Studio for Mac.
  2. Execute xcrun -k
  3. Create an iOS project, makes sure it has multiple architectures selected (and device-specific builds disabled), and build it.

Result:

lipo : error : unable to find utility "lipo", not a developer tool or in PATH

The error can be reproduced directly on the command line as well:

xcrun -k
$ DEVELOPER_DIR=/Applications/Xcode92.app XCODE_DEVELOPER_DIR_PATH=/Applications/Xcode93.app/Contents/Developer xcrun lipo
xcrun: error: unable to find utility "lipo", not a developer tool or in PATH

The problem is the XCODE_DEVELOPER_DIR_PATH environment variable, which confuses Apple's tooling (when building an XI or XM project the variable is inherited from Visual Studio for Mac, which sets it).

Workarounds

  • Make sure the system Xcode and the VSfM Xcode is the same.

  • Run xcrun once without the variable (per broken tool) so that the tool's path is cached:

    $ xcrun -k
    $ xcrun clang --version
    Apple LLVM version 9.0.0 (clang-900.0.39.2)
    [...]
    $ DEVELOPER_DIR=/Applications/Xcode92.app XCODE_DEVELOPER_DIR_PATH=/Applications/Xcode93.app/Contents/Developer xcrun clang --version
    Apple LLVM version 9.0.0 (clang-900.0.39.2)
    [...]

Potential fixes

  1. Make mtouch and mmp unset XCODE_DEVELOPER_DIR_PATH unconditionally.
  2. Make VSfM unset XCODE_DEVELOPER_DIR_PATH. Presumably there's a reason it's set in the first place, so this might be non-trivial.

I think making mtouch and mmp unset the variable is the simplest and fastest to implement.

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement macOS Issues affecting macOS iOS Issues affecting iOS labels Apr 13, 2018
@rolfbjarne rolfbjarne added this to the Future milestone Apr 13, 2018
@madhurig
Copy link

madhurig commented May 9, 2018

Is there a way to change "VS for Mac" Xcode settings without going through the UI? We have a customer running into this on the VSTS Hosted macOS VMs and we are looking for a way to switch the "VS for mac" default via a script.

Thanks,
Madhuri

@rolfbjarne
Copy link
Member Author

@madhurig it's stored in ~/Library/Preferences/Xamarin/Settings.plist:

$ cat ~/Library/Preferences/Xamarin/Settings.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>AppleSdkRoot</key>
	<string>/Applications/Xcode93.app</string>
</dict>
</plist>

@DelcoigneYves
Copy link

DelcoigneYves commented Aug 8, 2018

I managed to work around it on our build system by reading out the path located in the Settings.plist, and setting the DEVELOPER_DIR environment variable to this path, appended with "/Contents/Developer".

@VincentDondain
Copy link
Contributor

@rolfbjarne we might also want to create an IDE issue. The IDE could get the Xcode path from xcode-select -p and also set a new Xcode path with xcode-select -s from the UI. What do you think?

@rolfbjarne
Copy link
Member Author

@VincentDondain yes, that's another solution that should work just as fine.

@VincentDondain
Copy link
Contributor

VincentDondain commented Oct 18, 2018

Also it's what Xcode does.

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 8, 2022
* Enable nullability and fix code accordingly.
* Augment it to be able to take multiple files to strip at the same time.
* Strip in parallel.
* Execute using xcrun (ref: xamarin#3931)
* Pass the full path to the executable file to strip, to make command lines
  easier to copy-paste.
* Remove test that is now outdated. We have other tests that run strip
  anyways, so this shouldn't be a problem.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 8, 2022
* Enable nullability and fix code accordingly.
* Augment it to be able to take multiple files to run dsymutil on at the same time.
* Execute using xcrun (ref: xamarin#3931)
* Pass the full path to the executable file to dsymutil, to make command lines
  easier to copy-paste.
rolfbjarne added a commit that referenced this issue Mar 11, 2022
* Enable nullability and fix code accordingly.
* Augment it to be able to take multiple files to strip at the same time.
* Strip in parallel.
* Execute using xcrun (ref: #3931)
* Pass the full path to the executable file to strip, to make command lines
  easier to copy-paste.
* Remove test that is now outdated. We have other tests that run strip
  anyways, so this shouldn't be a problem.
rolfbjarne added a commit that referenced this issue Mar 11, 2022
* Enable nullability and fix code accordingly.
* Augment it to be able to take multiple files to run dsymutil on at the same time.
* Execute using xcrun (ref: #3931)
* Pass the full path to the executable file to dsymutil, to make command lines
  easier to copy-paste.
rolfbjarne added a commit that referenced this issue Oct 15, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
rolfbjarne added a commit that referenced this issue Oct 16, 2024
…. (#21439)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
haritha-mohan pushed a commit that referenced this issue Oct 19, 2024
…. (#21439)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'altool' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'zip' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'altool' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'productbuild' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'altool' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
…XamarinTask.

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'altool' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 13, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.
* We can optimize images in parallel.

Additionally:

* Use 'xcrun' to invoke 'pngcrush' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 22, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.
* We can optimize images in parallel.

Additionally:

* Use 'xcrun' to invoke 'pngcrush' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 22, 2024
…XamarinTask. (#21617)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'altool' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 22, 2024
…1613)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'mdimport' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 22, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'zip' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
rolfbjarne added a commit that referenced this issue Nov 22, 2024
#21615)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'plutil' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement iOS Issues affecting iOS macOS Issues affecting macOS
Projects
None yet
Development

No branches or pull requests

4 participants