Opened 5 years ago

Closed 4 years ago

#59599 closed defect (fixed)

kubectl-1.16 @1.16.2: dyld: Symbol not found: _unlinkat

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: patarra@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: mavericks mountainlion lion snowleopard leopard tiger Cc: lbschenkel (Leonardo Brondani Schenkel), pedrohdz (Pedro)
Port: kubectl

Description

kubectl-1.16 doesn't build on Mavericks at least:

DEBUG: Executing org.macports.destroot (kubectl-1.16)
xinstall: /opt/local/var/macports/distfiles/kubectl/1.16.2/kubectl -> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/work/destroot/opt/local/bin/kubectl1.16
xinstall: mkdir /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/work/destroot/opt/local/share/kubectl-1.16
xinstall: mkdir /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/work/destroot/opt/local/share/kubectl-1.16/completion
Error: Failed to destroot kubectl-1.16: dyld: Symbol not found: _unlinkat
  Referenced from: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/work/destroot/opt/local/bin/kubectl1.16
  Expected in: flat namespace

DEBUG: Error code: NONE
DEBUG: Backtrace: dyld: Symbol not found: _unlinkat
  Referenced from: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/work/destroot/opt/local/bin/kubectl1.16
  Expected in: flat namespace

    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_kubectl/kubectl-1.16/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port kubectl-1.16 failed

Change History (8)

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mavericks mountainlion lion snowleopard leopard tiger added

Same with kubectl-1.15 and kubectl-1.14.

Seems linke unlinkat appeared in OS X 10.10. Builds on 10.10 and later are working.

The legacysupport portgroup could be used to provide an implementation of unlinkat on older systems.

comment:2 Changed 5 years ago by lbschenkel (Leonardo Brondani Schenkel)

We're not building those from source, the binaries are downloaded straight from Google. I considered building from source, but last time I checked it did not look obvious to me, someone who is not well-versed in Go nor its build process. Due to inertia we kept shipping the binary.

I could give it a new shot in the next 1-2 weeks but if that doesn't prove to be trivial, I don't think I'll be able to spend the necessary effort to do it in the short term. I am going to have limited time to dedicate to MacPorts.

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

Ah, I did not know this port installs a binary. This bug demonstrates one of the reasons why we would rather build from source. I can't advise you on go's build process though. We do have a go-1.0 portgroup which is designed to help with that.

comment:4 Changed 5 years ago by lbschenkel (Leonardo Brondani Schenkel)

I get it, I'm not quite happy about it either. I would definitely prefer to build from source. The decision to ship the binary is a pragmatic one, to offer something rather than nothing, but I'm fully aware that we may get caught in situations like this.

comment:5 Changed 4 years ago by kencu (Ken)

The binary links only to libSystem.B.dylib:

otool -L /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_kubectl/kubectl-1.17/work/destroot/opt/local/bin/kubectl1.17
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_kubectl/kubectl-1.17/work/destroot/opt/local/bin/kubectl1.17:
	/usr/lib/libSystem.B.dylib (compatibility version 0.0.0, current version 0.0.0)

So there is no easy way around this -- interposing a library might work, but it's not practical.

So the port might as well mark all the broken systems as unsupported for now, "known_fail yes", etc, etc, and close this.

comment:6 Changed 4 years ago by lbschenkel (Leonardo Brondani Schenkel)

Thanks, Ken. We should definitely change the port to build from source if we can, unfortunately I don't have the time to volunteer to make that happen. In the meantime, I agree that we should mark the broken systems as unsupported. Is it <= 10.9 or am I missing something?

comment:7 Changed 4 years ago by kencu (Ken)

we found a trick for this, that works by magic at present. PR opened.

comment:8 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In e308583359b346c3b61b2ec3bc40252bc540a070/macports-ports (master):

kubectl: fix for older systems

uses legacysupport to provide functions
missing on older system versions

closes: #59599

Note: See TracTickets for help on using tickets.