diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/on_create_command.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/on_create_command.sh index d8de6ee..8ffaa13 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/on_create_command.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/on_create_command.sh @@ -18,9 +18,20 @@ if [ -d /var/cache/bazel ]; then echo "Bazel Cache: /var/cache/bazel is not owned by ${current_owner_group}. Setting ownership (this may take a few seconds) ..." sudo chown -R "${current_user_group}" /var/cache/bazel fi - echo "Bazel Cache: Configuring Bazel to use /var/cache/bazel as cache..." + echo "Bazel Cache: Configuring Bazel to use /var/cache/bazel as cache (=output user root)..." echo "startup --output_user_root=/var/cache/bazel" >> ~/.bazelrc + echo "Bazel Cache: Configuring Bazel disk cache to be in /var/cache/bazel/diskcache..." + echo "common --disk_cache=/var/cache/bazel/diskcache" >> ~/.bazelrc +else + echo "Bazel Cache: Configuring Bazel disk cache to be in /var/cache/bazel/diskcache..." + # Assuming the default location for the output user root folder is used + # Put disk cache folder within output user root folder + echo "common --disk_cache=~/.cache/bazel/_disk_cache" >> ~/.bazelrc fi +echo "Bazel Cache: Configuring Bazel disk cache retention time (60 days)..." +echo "common --experimental_disk_cache_gc_max_age=60d" >> ~/.bazelrc +echo "Bazel Cache: Configuring Bazel disk cache max size (50 GB)..." +echo "common --experimental_disk_cache_gc_max_size=50G" >> ~/.bazelrc # Configure clangd to remove the -fno-canonical-system-headers flag, which is # GCC-specific. If not done, there is an annoying error message on the first