Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#61481 closed defect (fixed)

MacVim @8.2.snapshot166_0+huge+python37 failing to build

Reported by: xchrey Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: phriedrich, benoitc (Benoit Chesneau), tgyurci (Teubel György), rieder (Steven Rieder)
Port: MacVim

Description

Build fails.

macOS 15.7
Xcode 12.2

sudo port clean has been done prior to a new attempt at upgrading macvim 8.1

Attachments (1)

main.log (670.4 KB) - added by xchrey 3 years ago.
main.log

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by xchrey

Attachment: main.log added

main.log

comment:1 Changed 3 years ago by phriedrich

Cc: phriedrich added

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to raimue
Status: newassigned
Summary: macvim 8.2.snapshot166_0+huge+python37 failing to buildMacVim @8.2.snapshot166_0+huge+python37 failing to build

Even though I think you're only telling it to build for x86_64, it looks like for some reason it's trying to build for arm64 as well, but that can't work because of the x86_64-only Sparkle binary it includes:

:info:build ld: warning: ignoring file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_MacVim/MacVim/work/macvim-dev-macvim-3079528/src/MacVim/Sparkle.framework/Sparkle, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
:info:build Undefined symbols for architecture arm64:
:info:build   "_OBJC_CLASS_$_SUUpdater", referenced from:
:info:build       objc-class-ref in MMAppController.o
:info:build ld: symbol(s) not found for architecture arm64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)

comment:3 Changed 3 years ago by phriedrich

I got it working by basically doing this: https://github.com/macvim-dev/macvim/issues/1113

I also added --disable-sparkle to configure.args in the port file, but I'm not sure if this was necessary.

My workaround was to try to build it and when it failed I changed the permission on /opt/local/var/macports/build/_Users_phriedrich_.ports_editors_MacVim/MacVim/work/macvim-dev-macvim-3079528/src/MacVim/ with sudo chmod -R 777 .. (The …/build/_Users_phriedrich_.ports_editors_MacVim is because I copied the port file to set the disable-sparkle, but this probably is not required.)

Then I opened the Xcode project file with open MacVim.xcodeproj and set the Architectures to x86_64 for the main project, and after it failed again, I also set this for Frameworks → PSMTabBarCrontrol.xcodeproj.

When I re-run the MacPorts build again, it run through and I got a working installation.

Very hacky, but maybe a starting point.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: benoitc added

Has duplicate #61534.

comment:5 Changed 3 years ago by tgyurci (Teubel György)

Cc: tgyurci added

comment:6 Changed 3 years ago by zdw (Zack Williams)

On Catalina on amd64 with MacVim-8.2.snapshot166 , it's trying to do the opposite of the above - trying to link amd64 with arm64:

:info:build ld: warning: ignoring file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_MacVim/MacVim/work/macvim-dev-macvim-3079528/src/MacVim/Sparkle.framework/Sparkle, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
:info:build Undefined symbols for architecture arm64:
:info:build   "_OBJC_CLASS_$_SUUpdater", referenced from:
:info:build       objc-class-ref in MMAppController.o
:info:build ld: symbol(s) not found for architecture arm64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build ** BUILD FAILED **

comment:7 Changed 3 years ago by raimue (Rainer Müller)

Sparkle is meant to be removed by a patch, but the last contributed update broke it. The references in the Xcode project need to be removed as we do not want to use Sparkle. The changes against src/MacVim/MacVim.xcodeproj/project.pbxproj previously handling this were removed.

https://github.com/macports/macports-ports/pull/8437/commits/9a1644fabf3b7e26e1fc003800b4084c5a87e5cd#diff-75d77e0653e84265e1c3b3dd07238d7c8f184244c0c5bac430851a696edf4820

comment:8 Changed 3 years ago by rieder (Steven Rieder)

Cc: rieder added

comment:9 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

comment:10 Changed 3 years ago by kencu (Ken)

This was meant to be fixed by specifying the ARCH for building, as per the referenced commit.

Note: See TracTickets for help on using tickets.