generic-worker: user: Current not implemented on darwin/amd64
Categories
(Taskcluster :: Workers, defect)
Tracking
(Not tracked)
People
(Reporter: pmoore, Assigned: pmoore)
References
Details
Attachments
(1 file)
When installing release build generic-worker
15.x.x on macOS, we get the error:
user: Current not implemented on darwin/amd64
This is because we are using user.Current here which requires CGO to work on darwin. The error comes from here.
We didn't notice this before, because until now we've been installing generic-worker from source on the macOS workers used by the taskcluster team (building with CGO enabled). However, in setting up a new macOS CI worker in macstadium from a release binary of generic-worker (built with CGO disabled), I stumbled on the issue!
The options we have are:
- Since the root user account of a posix system always has
uid
andgid
0, we can avoid theuser.Current
function call entirely, and just pass in zeros - We could execute
/usr/bin/id [-u|-g]
to get theuid
/gid
which works on both Linux and macOS - We could build with CGO enabled
I'm going for the second option, as that gives us more freedom to run generic-worker as a non-root user in future. I avoided the third option, mostly from a purity standpoint, mostly inspired by this article which in fairness really relates more to the perils of linking in third party C code, rather than trusted C code from the go standard library intetionally designed to interface with go (so the article may not be so relevant).
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Released in generic-worker 15.1.2.
Description
•