add -O1 to debug docker builds

I've been failing to repro the attached bug locally,
but I did notice that we're missing an -O1 like we
usually add to Debug bot builds.

Bug: skia:9793, skia:9664
Change-Id: If30ccfd55bad3e49862d453a754ed9fcbed9bbde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269938
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
diff --git a/infra/bots/recipe_modules/build/docker.py b/infra/bots/recipe_modules/build/docker.py
index 92132b6..99fa482 100644
--- a/infra/bots/recipe_modules/build/docker.py
+++ b/infra/bots/recipe_modules/build/docker.py
@@ -51,7 +51,10 @@
       'target_cpu': target_arch,
       'werror': True
   }
-  if configuration != 'Debug':
+
+  if configuration == 'Debug':
+    args['extra_cflags'].append('-O1')
+  else:
     args['is_debug'] = False
 
   if 'NoGPU' in extra_tokens:
diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86-Debug-Docker.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86-Debug-Docker.json
index fc9dc16..fc0bc48 100644
--- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86-Debug-Docker.json
+++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86-Debug-Docker.json
@@ -69,7 +69,7 @@
       "type=bind,source=[START_DIR]/cache/work/skia/out/Build-Debian10-GCC-x86-Debug-Docker/Debug,target=/OUT",
       "gcr.io/skia-public/gcc-debian10-x86@sha256:b1ec55403ac66d9500d033d6ffd7663894d32335711fbbb0fb4c67dfce812203",
       "/SRC/../RECIPE_MODULE[skia::build]/resources/docker-compile.sh",
-      "cc=\"gcc\" cxx=\"g++\" extra_cflags=[\"-g1\",\"-DDUMMY_docker_image=gcr.io/skia-public/gcc-debian10-x86@sha256:b1ec55403ac66d9500d033d6ffd7663894d32335711fbbb0fb4c67dfce812203\"] extra_ldflags=[] target_cpu=\"x86\" werror=true"
+      "cc=\"gcc\" cxx=\"g++\" extra_cflags=[\"-O1\",\"-g1\",\"-DDUMMY_docker_image=gcr.io/skia-public/gcc-debian10-x86@sha256:b1ec55403ac66d9500d033d6ffd7663894d32335711fbbb0fb4c67dfce812203\"] extra_ldflags=[] target_cpu=\"x86\" werror=true"
     ],
     "env": {
       "CHROME_HEADLESS": "1",
diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86_64-Debug-Docker.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86_64-Debug-Docker.json
index d3d529b..5f4286f 100644
--- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86_64-Debug-Docker.json
+++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-GCC-x86_64-Debug-Docker.json
@@ -69,7 +69,7 @@
       "type=bind,source=[START_DIR]/cache/work/skia/out/Build-Debian10-GCC-x86_64-Debug-Docker/Debug,target=/OUT",
       "gcr.io/skia-public/gcc-debian10@sha256:89a72df1e2fdea6f774a3fa4199bb9aaa4a0526a3ac1f233e604d689b694f95c",
       "/SRC/../RECIPE_MODULE[skia::build]/resources/docker-compile.sh",
-      "cc=\"gcc\" cxx=\"g++\" extra_cflags=[\"-g1\",\"-DDUMMY_docker_image=gcr.io/skia-public/gcc-debian10@sha256:89a72df1e2fdea6f774a3fa4199bb9aaa4a0526a3ac1f233e604d689b694f95c\"] extra_ldflags=[] target_cpu=\"x86_64\" werror=true"
+      "cc=\"gcc\" cxx=\"g++\" extra_cflags=[\"-O1\",\"-g1\",\"-DDUMMY_docker_image=gcr.io/skia-public/gcc-debian10@sha256:89a72df1e2fdea6f774a3fa4199bb9aaa4a0526a3ac1f233e604d689b694f95c\"] extra_ldflags=[] target_cpu=\"x86_64\" werror=true"
     ],
     "env": {
       "CHROME_HEADLESS": "1",
diff --git a/infra/bots/recipe_modules/build/examples/full.expected/unknown-docker-image.json b/infra/bots/recipe_modules/build/examples/full.expected/unknown-docker-image.json
index 5abca86..cdae0d8 100644
--- a/infra/bots/recipe_modules/build/examples/full.expected/unknown-docker-image.json
+++ b/infra/bots/recipe_modules/build/examples/full.expected/unknown-docker-image.json
@@ -21,7 +21,7 @@
       "    return func(*a, **kw)",
       "  File \"RECIPE_REPO[skia]/infra/bots/recipe_modules/build/api.py\", line 61, in __call__",
       "    self.compile_fn(self.m, checkout_root, out_dir)",
-      "  File \"RECIPE_REPO[skia]/infra/bots/recipe_modules/build/docker.py\", line 82, in compile_fn",
+      "  File \"RECIPE_REPO[skia]/infra/bots/recipe_modules/build/docker.py\", line 85, in compile_fn",
       "    raise Exception('Not implemented: ' + api.vars.builder_name)",
       "Exception: Not implemented: Build-Unix-GCC-x86_64-Release-Docker"
     ]