Skip to content

Commit

Permalink
feat: add system level bazelrcs to make building easier in various sy…
Browse files Browse the repository at this point in the history
…stems (magma#9441)

Signed-off-by: Marie Bremner <[email protected]>
  • Loading branch information
themarwhal authored Oct 6, 2021
1 parent a7704b4 commit 40386f5
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.bazel-cache/
.bazel-cache-repo/
.cache
orc8r/cloud/docker/metrics-configs/alert_rules
nms/app/node_modules
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ build:asan --copt=-O0
build:asan --copt=-fno-omit-frame-pointer
build:asan --linkopt=-fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always

# system bazelrc should include config specific to different build envs (--config=vm, --config=devcontainer, etc.)
try-import /etc/bazelrc
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,6 @@ RUN go get -v golang.org/x/tools/gopls
#### Update shared library configuration
RUN ldconfig -v

RUN ln -s /magma/experimental/bazel-base/bazelrcs/devcontainer.bazelrc /etc/bazelrc

WORKDIR /workspaces/magma
2 changes: 2 additions & 0 deletions experimental/bazel-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ RUN git clone --branch v4.3 https://github.com/mfontanini/libtins.git && \
#### Update shared library configuration
RUN ldconfig -v

RUN ln -s /magma/experimental/bazel-base/bazelrcs/docker.bazelrc /etc/bazelrc

WORKDIR /magma
1 change: 1 addition & 0 deletions experimental/bazel-base/bazelrcs/devcontainer.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --config=devcontainer
1 change: 1 addition & 0 deletions experimental/bazel-base/bazelrcs/docker.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --config=docker
1 change: 1 addition & 0 deletions experimental/bazel-base/bazelrcs/vm.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --config=vm
1 change: 1 addition & 0 deletions experimental/bazel-base/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ services:
volumes:
- ${MAGMA_ROOT}:/magma
- ${MAGMA_ROOT}/lte/gateway/configs:/etc/magma
- /tmp/bazel:/tmp/bazel
working_dir: /magma
7 changes: 7 additions & 0 deletions lte/gateway/deploy/roles/magma/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,10 @@
pkg:
- clangd-12
retries: 5

- name: Symlink system wide bazelrc into the VM
file:
src: '/home/vagrant/magma/experimental/bazel-base/bazelrcs/vm.bazelrc'
path: '/etc/bazelrc'
state: link
force: yes
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
"**/.bazel-cache-repo/**": true,
},
"bsv.bazel.buildFlags": [
"--config=vm",
],
"bsv.bazel.testFlags": [
"--compilation_mode=dbg",
],
"bsv.bes.enabled": false,
"bsv.bzl.codesearch.enabled": false,
Expand All @@ -42,7 +40,7 @@
],
"clangd.onConfigChanged": "restart",
"bsv.cc.compdb.targets": [
"//lte/gateway/c/session_manager:sessiond"
"//lte/gateway/c/session_manager:sessiond",
]
},
}

0 comments on commit 40386f5

Please sign in to comment.