Opened 13 months ago
Closed 4 months ago
#68486 closed defect (worksforme)
libfido2 @1.13.0: error: use of undeclared identifier 'kIOMainPortDefault'
Reported by: | jasperweiss (Jasper Weiss) | Owned by: | jasperweiss (Jasper Weiss) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | sonoma | Cc: | |
Port: | libfido2 |
Description
MacOS Sonoma 14.0 Intel
Attempted to install openssh +fido2 but port fails to build libfido2
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:391:38: error: use of undeclared identifier 'kIOMainPortDefault' :info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:391:38 return (IOServiceGetMatchingService(kIOMainPortDefault,: :info:build ^ :info:build error: use of undeclared identifier 'kIOMainPortDefault' :info:build return (IOServiceGetMatchingService(kIOMainPortDefault, :info:build ^ :info:build 2 errors generated.
Attachments (1)
Change History (8)
comment:1 follow-up: 2 Changed 13 months ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | sonoma added |
---|
Changed 13 months ago by jasperweiss (Jasper Weiss)
comment:2 Changed 13 months ago by jasperweiss (Jasper Weiss)
Replying to ryandesign:
Please attach the main.log file.
kIOMainPortDefault
is documented to be available on macOS 12 and later so you should have it on macOS 14. Perhaps you have an outdated version of Xcode and/or the command line tools installed that predates macOS 12. For Sonoma, use Xcode 15 and/or the Xcode 15 version of the CLT or later. Check ProblemHotlist#reinstall-clt to learn about an issue that sometimes prevents Software Update from notifying you your command line tools are outdated and how to fix that.
I've attached the log. I've honestly never had the need to install Xcode so far. My understanding is that build dependencies are handled by port itself (which in the case of libfido2 should be clang-15, cmake, mandoc, pkgconfig). Libfido2 did build just fine a little while ago (without Xcode installed). Isn't port supposed to take care of all the dependencies? Installing a port on a new system usually starts off building old versions of clang up until the version it requires
comment:3 follow-up: 4 Changed 13 months ago by jmroot (Joshua Root)
:debug:sysinfo Xcode none, CLT none
Since /usr/bin/clang appears to be mostly working, you almost certainly have outdated Command Line Tools installed and need to follow ProblemHotlist#reinstall-clt as Ryan mentioned.
comment:4 follow-up: 5 Changed 13 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to jasperweiss:
I've honestly never had the need to install Xcode so far.
That's fine. Most ports build fine with only the CLT. Those that need Xcode should tell you, although the ability for portfiles to indicate the Xcode requirement is only a few years old so there may still be old ports in the collection that need Xcode but that do not so indicate.
You can even get away without the CLT if you only install ports for which we provide binaries. We only just started building Intel binaries for macOS 14 a few days ago and have not yet started to build arm64 binaries for it so on macOS 14 you're unlikely to get away without the CLT.
My understanding is that build dependencies are handled by port itself (which in the case of libfido2 should be clang-15, cmake, mandoc, pkgconfig). Libfido2 did build just fine a little while ago (without Xcode installed). Isn't port supposed to take care of all the dependencies? Installing a port on a new system usually starts off building old versions of clang up until the version it requires
MacPorts takes care of those dependencies which are provided by MacPorts, such as cmake, pkgconfig, etc.—anything listed in port deps
.
Xcode and the CLT are not provided by MacPorts. You're expected to have installed one or the other or both prior to using MacPorts.
libfido2 does not require clang-15. You can confirm this by running port deps libfido2
. If you believed it does because it says so on the ports.macports.org web site, the ports web site is in error because its data is generated on a non-macOS operating system where clang-15 is apparently a dependency of most or all ports. Or, if port deps libfido2
does really show clang-15 on your system, that would presumably be evidence that MacPorts could not find a compiler from either Xcode or the CLT and tried to use a MacPorts version instead, but the intended way to use MacPorts on macOS is to have Xcode and/or the CLT installed so that that compiler can be used for most ports. (Some ports—not libfido2—do have more specific compiler requirements and might actually configure themselves to use specific versions of MacPorts clang.)
Replying to jmroot:
:debug:sysinfo Xcode none, CLT noneSince /usr/bin/clang appears to be mostly working, you almost certainly have outdated Command Line Tools installed and need to follow ProblemHotlist#reinstall-clt as Ryan mentioned.
The log also says:
:info:configure -- The C compiler identification is AppleClang 12.0.0.12000026
Looking at XcodeVersionInfo, it looks like that corresponds to some Xcode version between 12.0 and 12.4, which were for macOS 10.15 and macOS 11.
comment:5 Changed 13 months ago by jasperweiss (Jasper Weiss)
Replying to ryandesign:
You can even get away without the CLT if you only install ports for which we provide binaries. We only just started building Intel binaries for macOS 14 a few days ago and have not yet started to build arm64 binaries for it so on macOS 14 you're unlikely to get away without the CLT.
Ah so it turns out that I did have the CLT installed.
$ xcode-select --install xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates
However the softwareupdate command did not list any available updates
$ softwareupdate --list Software Update Tool Finding available software No new software available
But this answer from stackoverflow did the trick https://stackoverflow.com/a/75829171
$ touch "/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress" $ softwareupdate --list Software Update Tool Finding available software Software Update found the following new or updated software: * Label: Command Line Tools for Xcode-15.0 Title: Command Line Tools for Xcode, Version: 15.0, Size: 721962KiB, Recommended: YES,
MacPorts takes care of those dependencies which are provided by MacPorts, such as cmake, pkgconfig, etc.—anything listed in
port deps
.Xcode and the CLT are not provided by MacPorts. You're expected to have installed one or the other or both prior to using MacPorts.
libfido2 does not require clang-15. You can confirm this by running
port deps libfido2
. If you believed it does because it says so on the ports.macports.org web site, the ports web site is in error because its data is generated on a non-macOS operating system where clang-15 is apparently a dependency of most or all ports. Or, ifport deps libfido2
does really show clang-15 on your system, that would presumably be evidence that MacPorts could not find a compiler from either Xcode or the CLT and tried to use a MacPorts version instead, but the intended way to use MacPorts on macOS is to have Xcode and/or the CLT installed so that that compiler can be used for most ports. (Some ports—not libfido2—do have more specific compiler requirements and might actually configure themselves to use specific versions of MacPorts clang.)
I see! Yes I was under the impression that it was using a clang version provided by port because ports.macports.org lists it as a build dependency. But port deps
doesn't list it.
Replying to jmroot:
:debug:sysinfo Xcode none, CLT noneSince /usr/bin/clang appears to be mostly working, you almost certainly have outdated Command Line Tools installed and need to follow ProblemHotlist#reinstall-clt as Ryan mentioned.
The log also says:
:info:configure -- The C compiler identification is AppleClang 12.0.0.12000026Looking at XcodeVersionInfo, it looks like that corresponds to some Xcode version between 12.0 and 12.4, which were for macOS 10.15 and macOS 11.
It turns out that for some reason it did not update by itself. In fact, it must have been stuck at that exact version for at least 3 years now. I did get it to update in the end and libfido2 builds fine now!
Thank you all for the help!
comment:6 Changed 13 months ago by jasperweiss (Jasper Weiss)
Owner: | set to jasperweiss |
---|---|
Status: | new → assigned |
This ticket can be closed. I would do it myself if I knew how :)
comment:7 Changed 4 months ago by jmroot (Joshua Root)
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
Please attach the main.log file.
kIOMainPortDefault
is documented to be available on macOS 12 and later so you should have it on macOS 14. Perhaps you have an outdated version of Xcode and/or the command line tools installed that predates macOS 12. For Sonoma, use Xcode 15 and/or the Xcode 15 version of the CLT or later. Check ProblemHotlist#reinstall-clt to learn about an issue that sometimes prevents Software Update from notifying you your command line tools are outdated and how to fix that.