buildBinary uses os.Environ() directly (not cfg.cmd()) because the build needs the full unfiltered parent environment.
(ctx context.Context, logger slog.Logger, cfg *devConfig)
| 749 | // buildBinary uses os.Environ() directly (not cfg.cmd()) because |
| 750 | // the build needs the full unfiltered parent environment. |
| 751 | func buildBinary(ctx context.Context, logger slog.Logger, cfg *devConfig) error { |
| 752 | target := fmt.Sprintf("build/coder_%s_%s", runtime.GOOS, runtime.GOARCH) |
| 753 | cmd := exec.CommandContext(ctx, "make", "-j", target) |
| 754 | cmd.Dir = cfg.projectRoot |
| 755 | w := &logWriter{logger: logger.Named("build")} |
| 756 | cmd.Stdout = w |
| 757 | cmd.Stderr = w |
| 758 | cmd.Env = append(os.Environ(), |
| 759 | "DEVELOP_IN_CODER="+shellBool(developInCoder()), |
| 760 | "MAKE_TIMED=1", |
| 761 | ) |
| 762 | if cfg.agpl { |
| 763 | cmd.Env = append(cmd.Env, "CODER_BUILD_AGPL=1") |
| 764 | } |
| 765 | return cmd.Run() |
| 766 | } |
| 767 | |
| 768 | func startServer(cfg *devConfig, group *procGroup) error { |
| 769 | serverArgs := []string{ |
no test coverage detected