-
Notifications
You must be signed in to change notification settings - Fork 2.1k
build: new static make targets that disable CGO and exec driver
#27310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jrasell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me from a code perspective. My slight fear is we make this area of code a little harder to understand and debug and fragmented a bit more.
I personally don't cross-compile on macOS and use build VMs and I don't think this will change that, so I'd be curious of other thoughts on the addition before a merge.
tgross
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I thought that not having CGO would be a problem for shirou/gopsutil but at some point in their v3 version they managed to get rid of the remaining CGO.
|
Tagged a few other team members that use macOS, curious if others find this useful. If not, it makes no sense. |
Yeah :/
Oh interesting. I struggle getting amd64 VMs on mac running, or running fast enough so that compilation isn't a huge pain. arm64 binaries are no good if feeding them to an e2e cluster, for example. |
|
What if we had a make target that ran a containerized build? |
|
Neat! I have had scenarios where I would find this useful, but I'm not sure about the tradeoff of added complexity for a build that isn't fully complete. If the question is just about the feature though, I think it'd be a handy tool under certain circumstances |
as in, with dockerx? to target different os types or architectures? I guess that'd be fine but I don't see much benefit of having it a make target as opposed to just running I suspect building inside a container would be much slower. We'd have to build all the dependencies on every make. |
|
There's another take on this: at the cost of disabling the |
static make target that disables CGO
static make target that disables CGOstatic make target that disables CGO and exec driver
I love this idea! |
static make target that disables CGO and exec driverexec driver
tgross
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Nomad requires CGO on linux because of its dependency on
nsenter. This dependency is used by theexecdriver.This changeset introduces an idea of providing a
staticmake targets that disable CGO and thus theexecdriver, providing "crippled" statically-linked builds.Verifying from Linux that we're not using CGO in the new target:
note to reviewers: While inelegant, this was the smallest change that achieved the desired effect. I think ideally we should untangle the
executorpackage a bit more, separating theexeccode away fromqemu,javaandraw_exec. Reliance on theExecutorinterface creates a bit of a maze of build flags as every developer that ever touched that package knows. But seeing as this is a dev-ex-only change, I didn't want to make it too big (renamingexecutor_linux.gotoexecutor_linux_cgo.gowas probably already a step too far, because we'll likely want to backport this to avoid merge conflicts...).