mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-27 12:32:37 +02:00
Build lazygit without optimizations and inlining when debugging
This makes the debugging experience better.
This commit is contained in:
parent
2c29577e3c
commit
2f6a87df98
@ -42,7 +42,7 @@ func RunTests(
|
|||||||
|
|
||||||
testDir := filepath.Join(projectRootDir, "test", "_results")
|
testDir := filepath.Join(projectRootDir, "test", "_results")
|
||||||
|
|
||||||
if err := buildLazygit(raceDetector); err != nil {
|
if err := buildLazygit(waitForDebugger, raceDetector); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,12 +138,17 @@ func prepareTestDir(
|
|||||||
return createFixture(test, paths, rootDir)
|
return createFixture(test, paths, rootDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildLazygit(raceDetector bool) error {
|
func buildLazygit(debug bool, raceDetector bool) error {
|
||||||
// // TODO: remove this line!
|
// // TODO: remove this line!
|
||||||
// // skipping this because I'm not making changes to the app code atm.
|
// // skipping this because I'm not making changes to the app code atm.
|
||||||
// return nil
|
// return nil
|
||||||
|
|
||||||
args := []string{"go", "build"}
|
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 {
|
if raceDetector {
|
||||||
args = append(args, "-race")
|
args = append(args, "-race")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user