https://bazel.build/ Inputs /usr/bin/cc Action Outputs - - PowerPoint PPT Presentation

https bazel build inputs usr bin cc action outputs parser
SMART_READER_LITE
LIVE PREVIEW

https://bazel.build/ Inputs /usr/bin/cc Action Outputs - - PowerPoint PPT Presentation

https://bazel.build/ Inputs /usr/bin/cc Action Outputs ./parser.h cc -I. -c parser.c -o parser.o ./parser.o ./parser.c Inputs /usr/bin/cc Action Outputs ./parser.h cc -I. -c parser.c -o parser.o ./parser.o ./parser.c Workspace


slide-1
SLIDE 1
slide-2
SLIDE 2

https://bazel.build/

slide-3
SLIDE 3

Action cc -I. -c parser.c -o parser.o Inputs /usr/bin/cc ./parser.h ./parser.c Outputs ./parser.o

slide-4
SLIDE 4

Action cc -I. -c parser.c -o parser.o Inputs /usr/bin/cc ./parser.h ./parser.c Outputs ./parser.o Workspace ./lexer.h ./lexer.c ./parser.h ./parser.c

slide-5
SLIDE 5

Sandbox Process clever-cc input.c -o output.o

Mock hostname Network input.c /dev/random

  • utput.o

Real hostname

On Linux: user namespaces – On macOS: sandbox-exec https://blog.bazel.build/2015/09/11/sandboxing.html, https://jmmv.dev/2019/11/macos-sandbox-exec.html

slide-6
SLIDE 6

Action cc -I. -c parser.c -o parser.o Inputs /usr/bin/cc ./parser.h ./parser.c Outputs ./parser.o Sandbox Directory ./parser.h (ro?) ./parser.c (ro?) ./ (rw) Workspace ./lexer.h ./lexer.c ./parser.h ./parser.c Workspace ./lexer.h ./lexer.c ./parser.h ./parser.c ./parser.o

slide-7
SLIDE 7

Action cc -I. -c parser.c -o parser.o Inputs /usr/bin/cc ./parser.h ./parser.c Outputs ./parser.o Sandbox Directory ./parser.h (ro?) ./parser.c (ro?) ./ (rw) Workspace ./lexer.h ./lexer.c ./parser.h ./parser.c Workspace ./lexer.h ./lexer.c ./parser.h ./parser.c ./parser.o

slide-8
SLIDE 8

https://github.com/bazelbuild/sandboxfs/

sandboxfs Bazel

CreateSandbox(action1, { / → .../scratch/action1 (rw), /src/file1.h → .../src/file1.h (ro), /src/file1.c → .../src/file1.c (ro), })

Mount Point

slide-9
SLIDE 9

https://github.com/bazelbuild/sandboxfs/

sandboxfs Bazel

CreateSandbox(action1, { / → .../scratch/action1 (rw), /src/file1.h → .../src/file1.h (ro), /src/file1.c → .../src/file1.c (ro), })

Mount Point

action1/ (rw) action1/src/file1.h (ro) action1/src/file1.c (ro)

slide-10
SLIDE 10

https://github.com/bazelbuild/sandboxfs/

sandboxfs Bazel

CreateSandbox(action1, { / → .../scratch/action1 (rw), /src/file1.h → .../src/file1.h (ro), /src/file1.c → .../src/file1.c (ro), })

Mount Point

action1/ (rw) action1/src/file1.h (ro) action1/src/file1.c (ro)

Same idea as: mount --bind (Linux) mount -t null (BSD)

slide-11
SLIDE 11

https://github.com/bazelbuild/sandboxfs/

sandboxfs Bazel

CreateSandbox(action1, { / → .../scratch/action1 (rw), /src/file1.h → .../src/file1.h (ro), /src/file1.c → .../src/file1.c (ro), }) CreateSandbox(action2, { / → .../scratch/action2 (rw), /gfx/libgfx.a → .../libgfx.a (ro), /main.a → .../main.a (ro), })

Mount Point

action1/ (rw) action1/src/file1.h (ro) action1/src/file1.c (ro) action1/ (rw) action1/src/file1.h (ro) action1/src/file1.c (ro) action2/ (rw) action2/gfx/libgfx.a (ro) action2/main.a (ro)

slide-12
SLIDE 12

https://blog.bazel.build/2018/04/13/preliminary-sandboxfs-support.html

Target Machine Local Bazel MacBook Pro 2017 581s Bazel Mac Pro 2013 247s iOS app Mac Pro 2013 1235s

slide-13
SLIDE 13

https://blog.bazel.build/2018/04/13/preliminary-sandboxfs-support.html

Target Machine Local Symlinked sandbox Bazel MacBook Pro 2017 581s 621s (+6%) Bazel Mac Pro 2013 247s 265s (+7%) iOS app Mac Pro 2013 1235s 4572s (+270%)

slide-14
SLIDE 14

https://blog.bazel.build/2018/04/13/preliminary-sandboxfs-support.html

Target Machine Local Symlinked sandbox sandboxfs sandbox Bazel MacBook Pro 2017 581s 621s (+6%) 612s (+5%) Bazel Mac Pro 2013 247s 265s (+7%) 250s (+1%) iOS app Mac Pro 2013 1235s 4572s (+270%) 1922s (+55%)

slide-15
SLIDE 15
  • https://jmmv.dev/2018/07/rust-vs-go.html
slide-16
SLIDE 16
  • https://jmmv.dev/2018/07/rust-vs-go.html
slide-17
SLIDE 17
  • https://jmmv.dev/2018/07/rust-vs-go.html
slide-18
SLIDE 18

slide-19
SLIDE 19