3 Commits

Author SHA1 Message Date
Etienne Perot c2dd6140f4 embeddedbinary: Skip compression unless using --compilation_mode=opt.
This speeds up debug builds and fastbuilds by not adding the compression step.

PiperOrigin-RevId: 579906206
2023-11-06 11:31:52 -08:00
Andrei Vagin 1c2b646c26 embeddedbinary: access proc files of the current process via /proc/self/
/proc/self is always points on the current process entry, but /proc/pid/ can
points to another process if a process is in another pid namespace than /proc.

PiperOrigin-RevId: 579328968
2023-11-03 16:00:15 -07:00
Etienne Perot 9ca09375e4 Add tool to generate a Go library that executes an embedded compressed binary.
This creates a `go_template` that can generate a `go_library` rule which
extracts a compressed binary to a temporary location, then executes it.

This is useful to implement `runsc` subcommands without requiring that these
subcommands' dependencies are linked into the main `runsc` binary.

PiperOrigin-RevId: 557270682
2023-08-15 15:32:43 -07:00