Skip to content

Instantly share code, notes, and snippets.

@PatrickLang
Last active January 8, 2019 01:39
Show Gist options
  • Save PatrickLang/31b974bb576ef7767bbbf73f46cab382 to your computer and use it in GitHub Desktop.
Save PatrickLang/31b974bb576ef7767bbbf73f46cab382 to your computer and use it in GitHub Desktop.
Building kubernetes/kubernetes with Bazel

Here's what I tried after reading https://github.com/kubernetes/community/blob/master/contributors/devel/bazel.md

sudo apt install golang
export GOPATH=~/go
go get k8s.io/kubernetes/vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle
go install k8s.io/kubernetes/vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle
hack/update-bazel.sh # this returned some errors, but the next step still seemed to work
make bazel-build # this failed running out of disk space for me
external/go_sdk/pkg/tool/linux_amd64/link: running /usr/bin/gcc failed: exit status 1
/usr/bin/ld.gold: fatal error: /home/patrick/.cache/bazel/_bazel_patrick/9577579d659a1d3fc96334a72d668262/sandbox/linux-sandbox/5383/execroot/__main__/bazel-out/k8-fastbuild/bin/pkg/kubelet/kuberuntime/logs/linux_amd64_stripped/
go_default_test: No space left on device
collect2: error: ld returned 1 exit status

GoLink: error running subcommand: exit status 2
INFO: Elapsed time: 1873.691s, Critical Path: 254.72s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 5382 processes: 5382 linux-sandbox.
FAILED: Build did NOT complete successfully
Makefile:556: recipe for target 'bazel-build' failed
make: *** [bazel-build] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment