MCPcopy
hub / github.com/livekit/livekit / BuildLinux

Function BuildLinux

magefile.go:80–108  ·  view source on GitHub ↗

builds binary that runs on linux

()

Source from the content-addressed store, hash-verified

78
79// builds binary that runs on linux
80func BuildLinux() error {
81 mg.Deps(generateWire)
82 if !checksummer.IsChanged() {
83 fmt.Println("up to date")
84 return nil
85 }
86
87 fmt.Println("building...")
88 if err := os.MkdirAll("bin", 0755); err != nil {
89 return err
90 }
91 buildArch := os.Getenv("GOARCH")
92 if len(buildArch) == 0 {
93 buildArch = "amd64"
94 }
95 cmd := mageutil.CommandDir(context.Background(), "cmd/server", "go build -buildvcs=false -o ../../bin/livekit-server-" + buildArch)
96 cmd.Env = []string{
97 "GOOS=linux",
98 "GOARCH=" + buildArch,
99 "HOME=" + os.Getenv("HOME"),
100 "GOPATH=" + os.Getenv("GOPATH"),
101 }
102 if err := cmd.Run(); err != nil {
103 return err
104 }
105
106 checksummer.WriteChecksum()
107 return nil
108}
109
110func Deadlock() error {
111 ctx := context.Background()

Callers

nothing calls this directly

Calls 1

RunMethod · 0.45

Tested by

no test coverage detected