首页 > 解决方案 > 如何避免make命令触发Xcode

问题描述

我有一个 python 项目,makefile其中有

test: clean lint
    @pytest app/tests/ --cov ./app -s

我通常make test在终端中输入来触发它pytest。但是,最近它停止了工作。相反,我得到一个错误

make: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null' failed with exit code 256: (null) (errno=No such file or directory)

MacOS 会弹出一个消息窗口,说它需要下载软件(除了进度条之外没有其他详细信息)。完成安装大约需要 10 分钟。但这并没有改变任何东西。虽然我从未使用过 XCode,但我已经安装了它。Pytest如果我直接输入 pytest 命令仍然有效。

我的机器是带有 BigSur Intel CPU 的 Macbook Pro。我不是 iOS/MacOS 应用程序开发人员,也不使用 Xcode。我不明白为什么会make触发它。如何避免?


遵循@MadScientist 建议的更多信息:

> type -a make
make is /usr/bin/make

> make --version
OR
> make -d test
xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun 

> /usr/bin/make
xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun

标签: pythonxcodemakefile

解决方案


推荐阅读