Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#62112 closed defect (fixed)

mpv fails to build on MacBook Pro 2014 15" High Sierra

Reported by: KomiaPoika Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: i0ntempest
Port: mpv

Description

Hi,

I'm trying to build mpv from sources using Macports on High Sierra, MacBook Pro mid-2014 15" Iris+Nvidia. I get this error:

https://pastebin.com/DfUPmenF

I have xcode 9.4.1, which is needed for other apps, and XQuartz installed on the same system. The error has something to do with Swift, but I have no clue how to fix it.

I also can't "upgrade" out of High Sierra, because I need it for proprietary software that is no longer supported beyond High Sierra.

mpv also fails to build on my 13" MBp also High Sierra, but there I still have a previous build that works, whereas here is a fresh install so I can't run a built mpv at all.

Change History (5)

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Cc: i0ntempest added
Milestone: MacPorts 2.7.0
Owner: set to Ionic
Priority: HighNormal
Status: newassigned

comment:2 Changed 4 years ago by i0ntempest

Try forcing use_xcode yes in the portfile and retry the build. I have it enabled for 10.15 and later. Swift and swift modules have some weird problems especially in their early days.

comment:3 Changed 4 years ago by KomiaPoika

Thanks! Worked for me. I edited out the condition for use_xcode and then it compiled immediately.

comment:4 Changed 4 years ago by i0ntempest

Resolution: fixed
Status: assignedclosed

comment:5 Changed 4 years ago by JDLH (Jim DeLaHunt)

For the sake of others searching tickets for the same error message, the interesting part of the main.log appears to be:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_mpv/mpv/work/mpv-player-mpv-d5ae9f7/osdep/macos/swift_compat.swift:29:38: error: cannot convert value of type 'CALayerContentsFormat' to specified type 'String'
:info:build     static let RGBA16Float: String = kCAContentsFormatRGBA16Float
:info:build                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                                                                  .rawValue
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_mpv/mpv/work/mpv-player-mpv-d5ae9f7/osdep/macos/swift_compat.swift:30:36: error: cannot convert value of type 'CALayerContentsFormat' to specified type 'String'
:info:build     static let RGBA8Uint: String = kCAContentsFormatRGBA8Uint
:info:build                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                                                              .rawValue
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_mpv/mpv/work/mpv-player-mpv-d5ae9f7/osdep/macos/swift_compat.swift:31:36: error: cannot convert value of type 'CALayerContentsFormat' to specified type 'String'
:info:build     static let gray8Uint: String = kCAContentsFormatGray8Uint
:info:build                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                                                              .rawValue

followed by

:info:build Build failed
:info:build  -> task in 'osdep/macOS_swift.o,osdep/macOS_swift.h,osdep/macOS_swift.swiftmodule' failed with exit status 1: 
:info:build 	{task 4426204096: osdep/macOS_swift.o,osdep/macOS_swift.h,osdep/macOS_swift.swiftmodule log_helper.swift,libmpv_helper.swift,mpv_helper.swift,swift_extensions.swift,swift_compat.swift,remote_command_center.swift,common.swift,view.swift,window.swift,title_bar.swift,cocoa_cb_common.swift,gl_layer.swift -> macOS_swift.o,macOS_swift.h,macOS_swift.swiftmodule}
Note: See TracTickets for help on using tickets.