Macvim: Build failed on macOS Catalina with Xcode 12.2

Created on 15 Nov 2020  路  23Comments  路  Source: macvim-dev/macvim

Build failed on macOS Catalina with Xcode 12.2

xcodebuild -project MacVim/MacVim.xcodeproj GCC_PREPROCESSOR_DEFINITIONS=' DISABLE_SPARKLE=1' MACOSX_DEPLOYMENT_TARGET=10.15 VIM_SHORT_VERSION_STRING=8.2.1975
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project MacVim/MacVim.xcodeproj "GCC_PREPROCESSOR_DEFINITIONS= DISABLE_SPARKLE=1" MACOSX_DEPLOYMENT_TARGET=10.15 VIM_SHORT_VERSION_STRING=8.2.1975

Build settings from command line:
    GCC_PREPROCESSOR_DEFINITIONS =  DISABLE_SPARKLE=1
    MACOSX_DEPLOYMENT_TARGET = 10.15
    VIM_SHORT_VERSION_STRING = 8.2.1975

note: Using new build system
note: Planning build
note: Constructing build description
warning: ONLY_ACTIVE_ARCH=YES requested with multiple ARCHS and no run destination to provide an active architecture; building for all applicable architectures (in target 'PSMTabBarControlFramework' from project 'PSMTabBarControl')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'PSMTabBarControlFramework' from project 'PSMTabBarControl')
warning: ONLY_ACTIVE_ARCH=YES requested with multiple ARCHS and no run destination to provide an active architecture; building for all applicable architectures (in target 'MacVim' from project 'MacVim')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'MacVim' from project 'MacVim')
error: The linked and embedded framework 'Sparkle.framework' is missing one or more architectures required by this target: arm64. (in target 'MacVim' from project 'MacVim')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'QuickLookStephen' from project 'QuickLookStephen')

** BUILD FAILED **

make[1]: *** [macvim] Error 65
make: *** [first] Error 2

To Reproduce

  1. Build with homebrew brew install -s macvim

Expected behavior
Build success without issues.

Environment (please complete the following information):

HOMEBREW_VERSION: 2.5.10-20-gfd15352
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: fd15352ea4eb7072b34533101bd60a252c2fe6bc
Last commit: 18 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: fd16f6e4d33d210b263bf37c26b0656c0099959d
Core tap last commit: 17 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.aIT0EOyjtg/org.macosforge.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.2
macOS: 10.15.7-x86_64
CLT: 12.2.0.0.1.1603499215

Most helpful comment

Yeah it was fixed in the 169 formula to build for the correct architecture.

All 23 comments

@douglarek Thanks, but I still build failed with this patch. Here comes the error logs:

The following build commands failed:
    ProcessPCH /tmp/macvim-20201116-28253-1pg0a3g/src/MacVim/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/3339186150682377709/AppKit.h.gch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make[1]: *** [macvim] Error 65
make: *** [first] Error 2

HOMEBREW_VERSION: 2.5.10-29-gfb61594
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: fb6159467ae35926ba8d31227c4658a9a40198c0
Last commit: 12 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ff900f9ff632f6325e533e1e96751ddcd59a4387
Core tap last commit: 11 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.MUWa2Waego/org.macosforge.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.2
macOS: 10.15.7-x86_64
CLT: 12.2.0.0.1.1603499215
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/[email protected]:/usr/local/opt/readline:/usr/local/opt/sqlite:/usr/local/opt/ruby:/usr/local
CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /usr/local/opt/[email protected]/Frameworks
PKG_CONFIG_PATH: /usr/local/opt/lua/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/libyaml/lib/pkgconfig:/usr/local/opt/ruby/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/cscope/bin:/usr/local/opt/lua/bin:/usr/local/opt/gdbm/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/xz/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/ruby/bin:/usr/bin:/bin:/usr/sbin:/sbin

@douglarek Thanks, but I still build failed with this patch. Here comes the error logs:

The following build commands failed:
  ProcessPCH /tmp/macvim-20201116-28253-1pg0a3g/src/MacVim/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/3339186150682377709/AppKit.h.gch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make[1]: *** [macvim] Error 65
make: *** [first] Error 2

HOMEBREW_VERSION: 2.5.10-29-gfb61594
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: fb6159467ae35926ba8d31227c4658a9a40198c0
Last commit: 12 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ff900f9ff632f6325e533e1e96751ddcd59a4387
Core tap last commit: 11 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.MUWa2Waego/org.macosforge.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.2
macOS: 10.15.7-x86_64
CLT: 12.2.0.0.1.1603499215
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/[email protected]:/usr/local/opt/readline:/usr/local/opt/sqlite:/usr/local/opt/ruby:/usr/local
CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /usr/local/opt/[email protected]/Frameworks
PKG_CONFIG_PATH: /usr/local/opt/lua/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/libyaml/lib/pkgconfig:/usr/local/opt/ruby/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/cscope/bin:/usr/local/opt/lua/bin:/usr/local/opt/gdbm/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/xz/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/ruby/bin:/usr/bin:/bin:/usr/sbin:/sbin

What is your build command ? and try make distclean first

@douglarek Thanks, I use homebrew-core/macvim.rb formula with the patch, I think the only difference between you and me is I still on macOS Catalina.

homebrew will setup a clean build for me every time, so I don't need to do make distclean.

I can confirm the patch provided in #1113 allowed me to successfully build from git src on Catalina.

I'll merge #1118 tonight. Sparkle released an update that will support building for Apple Silicon.

Here comes the more complete error logs:

clang: error: the clang compiler does not support '-march=nehalem'

warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'MacVim' from project 'MacVim')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'QuickLookStephen' from project 'QuickLookStephen')
** BUILD FAILED **


The following build commands failed:
    ProcessPCH /tmp/macvim-20201117-37782-p78go0/src/MacVim/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/4765281400848888823/AppKit.h.gch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make[1]: *** [macvim] Error 65
make: *** [first] Error 2

For me, the issue seems related to this https://github.com/Homebrew/brew/issues/7857#issuecomment-655536261.

It is homebrew's bug, I guess.

After remove -march=nehalem from homebrew source code, everything works well.

It compiled, but after run mvim from terminal, it keeps showing

2020-11-17 22:47:05.278 MacVim[55242:2158042] FinderSync: Failed to find extension for com.google.GoogleDrive.FinderSyncAPIExtension
2020-11-17 22:47:06.446 MacVim[55242:2158042] FinderSync: Failed to find extension for com.google.GoogleDrive.FinderSyncAPIExtension
2020-11-17 22:47:07.661 MacVim[55242:2158042] FinderSync: Failed to find extension for com.google.GoogleDrive.FinderSyncAPIExtension
2020-11-17 22:47:08.305 MacVim[55242:2158042] FinderSync: Failed to find extension for com.google.GoogleDrive.FinderSyncAPIExtension

The developer from homebrew said:

You're trying to cross-compile targeting arm64, but there's no microarchitecture called nehalem for that target. The issue is with the build script or custom formula you're using, not with Homebrew.

They said it might be the problem of the build script or formula, but the formula is from official homebrew-core repository.

Okay, I think I solved the problem with the following patch

diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj
index 729c23009..9b66f5335 100644
--- a/src/MacVim/MacVim.xcodeproj/project.pbxproj
+++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
    archiveVersion = 1;
    classes = {
    };
-   objectVersion = 47;
+   objectVersion = 54;
    objects = {

 /* Begin PBXBuildFile section */
@@ -1169,6 +1169,7 @@
            buildSettings = {
                COMBINE_HIDPI_IMAGES = YES;
                COPY_PHASE_STRIP = NO;
+               EXCLUDED_ARCHS = arm64;
                FRAMEWORK_SEARCH_PATHS = (
                    "$(inherited)",
                    "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -1202,6 +1203,7 @@
            buildSettings = {
                COMBINE_HIDPI_IMAGES = YES;
                COPY_PHASE_STRIP = YES;
+               EXCLUDED_ARCHS = arm64;
                FRAMEWORK_SEARCH_PATHS = (
                    "$(inherited)",
                    "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -1233,6 +1235,7 @@
            buildSettings = {
                CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
                ENABLE_TESTABILITY = YES;
+               EXCLUDED_ARCHS = arm64;
                GCC_VERSION = 4.2;
                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                GCC_WARN_UNUSED_VARIABLE = YES;
@@ -1246,6 +1249,7 @@
            isa = XCBuildConfiguration;
            buildSettings = {
                CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+               EXCLUDED_ARCHS = arm64;
                GCC_VERSION = 4.2;
                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                GCC_WARN_UNUSED_VARIABLE = YES;
diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj
index 21c3f7f56..6b7477acf 100644
--- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj
+++ b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj
@@ -456,13 +456,14 @@
        0259C573FE90428111CA0C5A /* Project object */ = {
            isa = PBXProject;
            attributes = {
-               LastUpgradeCheck = 0710;
+               LastUpgradeCheck = 1220;
            };
            buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */;
            compatibilityVersion = "Xcode 3.2";
            developmentRegion = English;
            hasScannedForEncodings = 1;
            knownRegions = (
+               English,
                en,
            );
            mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */;
@@ -676,6 +677,7 @@
            isa = XCBuildConfiguration;
            buildSettings = {
                ENABLE_TESTABILITY = YES;
+               EXCLUDED_ARCHS = arm64;
                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                GCC_WARN_UNUSED_VARIABLE = YES;
                ONLY_ACTIVE_ARCH = YES;
@@ -687,6 +689,7 @@
        C056398D08A954F8003078D8 /* Release */ = {
            isa = XCBuildConfiguration;
            buildSettings = {
+               EXCLUDED_ARCHS = arm64;
                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                GCC_WARN_UNUSED_VARIABLE = YES;
                ONLY_ACTIVE_ARCH = YES;
diff --git a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj
index c7de7370d..030dbe89b 100644
--- a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj
+++ b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj
@@ -134,13 +134,14 @@
        089C1669FE841209C02AAC07 /* Project object */ = {
            isa = PBXProject;
            attributes = {
-               LastUpgradeCheck = 0730;
+               LastUpgradeCheck = 1220;
            };
            buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */;
            compatibilityVersion = "Xcode 3.2";
            developmentRegion = English;
            hasScannedForEncodings = 1;
            knownRegions = (
+               English,
                en,
            );
            mainGroup = 089C166AFE841209C02AAC07 /* QuickLookStephen */;
@@ -241,6 +242,7 @@
            isa = XCBuildConfiguration;
            buildSettings = {
                ENABLE_TESTABILITY = YES;
+               EXCLUDED_ARCHS = arm64;
                GCC_C_LANGUAGE_STANDARD = c99;
                GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_";
                GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -259,6 +261,7 @@
        2CA326240896AD4900168862 /* Release */ = {
            isa = XCBuildConfiguration;
            buildSettings = {
+               EXCLUDED_ARCHS = arm64;
                GCC_C_LANGUAGE_STANDARD = c99;
                GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_";
                GCC_WARN_ABOUT_RETURN_TYPE = YES;

Hi @douglarek

Thanks, I think my problem solved. You just modify the build settings of MacVim, but another two components PSMTabBarControl and QuickLookStephen need modification, too.

After the modification, my homebrew formula works.

https://github.com/markwu/homebrew-personal/blob/master/Formula/macvim.rb

But, I am not sure if all functions work.

Another problem, after the modification, it only works for x86_64 cpu, not for Apple M1 (arm64).

Actually, the problem is with the EXCLUDED_ARCHS flag that was added right? I think that was only added due to the Sparkle issue, which has since been resolved. I think we can just remove that patch and it should work.

The problem is with the EXCLUDED_ARCHS flag that was added right?

I think the problem is EXCLUDED_ARCHS was not added. So, we need this patch for homebrew to compile macvim on Catalina.

Actually I think if you were just using -s (but not asking fetch from head) to install, Homebrew would just be using the pinned version (r166) right? That would not have contained the Sparkle fixes to allow building for Apple Silicon. I just released r168 (skipped 167) so if Homebrew updates to it, it should alleviate the building issue, hopefully.

I think the bug fixed, I can compiled macvim without the patch by homebrew. I'll close this issue.

Yeah it was fixed in the 169 formula to build for the correct architecture.

I have this same error. Using the latest brew etc. Any resolution?

Works with a cask install brew install --cask macvim

What's the issue? What error do you see?

Was this page helpful?
0 / 5 - 0 ratings