From 87b2b76b0f581d893941b9d37f0e644006a430c5 Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Wed, 17 May 2023 13:52:42 +0200 Subject: [PATCH] sg: build syntax-highlighter via bazel (#52056) Kill docker with fire in our sg start. Test Plan: sg run syntax-highlighter works. Then sg start and view a file to confirm there is functional syntax highlighting. --- dev/sg/internal/run/run.go | 5 +++++ sg.config.yaml | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/dev/sg/internal/run/run.go b/dev/sg/internal/run/run.go index a0b3905acc2..721f890fd89 100644 --- a/dev/sg/internal/run/run.go +++ b/dev/sg/internal/run/run.go @@ -29,6 +29,11 @@ import ( const MAX_CONCURRENT_BUILD_PROCS = 4 func Commands(ctx context.Context, parentEnv map[string]string, verbose bool, cmds ...Command) error { + if len(cmds) == 0 { + // Exit early if there are no commands to run. + return nil + } + chs := make([]<-chan struct{}, 0, len(cmds)) monitor := &changeMonitor{} for _, cmd := range cmds { diff --git a/sg.config.yaml b/sg.config.yaml index 696ffe98b85..8b1aa99b332 100644 --- a/sg.config.yaml +++ b/sg.config.yaml @@ -956,6 +956,17 @@ bazelCommands: SRC_PROF_HTTP: 127.0.0.1:3551 searcher: target: //cmd/searcher + syntax-highlighter: + target: //docker-images/syntax-highlighter:syntect_server + env: + # Environment copied from Dockerfile + WORKERS: "1" + ROCKET_ENV: "production" + ROCKET_LIMITS: "{json=10485760}" + ROCKET_SECRET_KEY: "SeerutKeyIsI7releuantAndknvsuZPluaseIgnorYA=" + ROCKET_KEEP_ALIVE: "0" + ROCKET_PORT: "9238" + QUIET: "true" github-proxy: target: //cmd/github-proxy frontend: @@ -1060,10 +1071,10 @@ commandsets: - oss-gitserver-1 - github-proxy - searcher + - syntax-highlighter commands: - oss-web - caddy - - syntax-highlighter - zoekt-index-0 - zoekt-index-1 - zoekt-web-0 @@ -1112,12 +1123,12 @@ commandsets: - gitserver-1 - searcher - symbols + - syntax-highlighter - github-proxy commands: - web - blobstore - docsite - - syntax-highlighter - zoekt-index-0 - zoekt-index-1 - zoekt-web-0 @@ -1204,6 +1215,7 @@ commandsets: - gitserver-1 - searcher - symbols + - syntax-highlighter - github-proxy - codeintel-worker - codeintel-executor @@ -1211,7 +1223,6 @@ commandsets: - web - blobstore - docsite - - syntax-highlighter - zoekt-index-0 - zoekt-index-1 - zoekt-web-0