MCPcopy Index your code
hub / github.com/coder/coder / buildBinary

Function buildBinary

scripts/develop/main.go:751–766  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

749// buildBinary uses os.Environ() directly (not cfg.cmd()) because
750// the build needs the full unfiltered parent environment.
751func 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
768func startServer(cfg *devConfig, group *procGroup) error {
769 serverArgs := []string{

Callers 1

developFunction · 0.70

Calls 6

shellBoolFunction · 0.85
developInCoderFunction · 0.85
NamedMethod · 0.80
CommandContextMethod · 0.65
EnvironMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected