cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.4k stars 359 forks source link

feat(rootless): help detection with execv check "is current builder rootless?" #1380

Closed fenollp closed 8 months ago

fenollp commented 8 months ago

I recently encountered #1098 and propose an iteration on the fix in #890

This patch adds a last minute check that looks up the current builder endpoint. This may be seen as a costly operation however, as mentioned in #889

Here's the output of docker builder inspect on my rootless install:

Name:          rootless
Driver:        docker
Last Activity: 2023-12-03 02:04:14 +0000 UTC

Nodes:
Name:      rootless
Endpoint:  rootless  # <= THIS HERE
Status:    running
Buildkit:  v0.11.7+d3e6c1360f6e
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
Labels:
 org.mobyproject.buildkit.worker.moby.host-gateway-ip: 172.17.0.1
Emilgardis commented 8 months ago

does docker info -f "{{println .SecurityOptions}}" mention rootless? if so we could maybe use that instead earlier in the chain, while we gather the server and client versions here

fenollp commented 8 months ago

[name=seccomp,profile=builtin name=rootless name=cgroupns]

Alright I'll see about extracting this then, then :)

fenollp commented 8 months ago

@Emilgardis here ya go