summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-09-28 09:09:31 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-09-28 10:03:53 +0200
commit2f6a87df98d42744f1ee08a1a23563040c4f4517 (patch)
treee3c70108649adcb1d695e10acd7b7c71b9bc1af9
parent2c29577e3c5d7c69dacdc67ff643815cb1a30375 (diff)
Build lazygit without optimizations and inlining when debugging
This makes the debugging experience better.
-rw-r--r--pkg/integration/components/runner.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go
index 821319dc1..09b01a71c 100644
--- a/pkg/integration/components/runner.go
+++ b/pkg/integration/components/runner.go
@@ -42,7 +42,7 @@ func RunTests(
testDir := filepath.Join(projectRootDir, "test", "_results")
- if err := buildLazygit(raceDetector); err != nil {
+ if err := buildLazygit(waitForDebugger, raceDetector); err != nil {
return err
}
@@ -138,12 +138,17 @@ func prepareTestDir(
return createFixture(test, paths, rootDir)
}
-func buildLazygit(raceDetector bool) error {
+func buildLazygit(debug bool, raceDetector bool) error {
// // TODO: remove this line!
// // skipping this because I'm not making changes to the app code atm.
// return nil
args := []string{"go", "build"}
+ if debug {
+ // Disable compiler optimizations (-N) and inlining (-l) because this
+ // makes debugging work better
+ args = append(args, "-gcflags=all=-N -l")
+ }
if raceDetector {
args = append(args, "-race")
}