criyle / go-judge

Sandbox Server in REST / gRPC API. Based on Linux container technologies.
MIT License
419 stars 67 forks source link

编译go程序问题 #118

Closed c2016958413 closed 3 weeks ago

c2016958413 commented 3 weeks ago

作者你好,我在wsl的ubuntu24.04上使用发送请求,编译go程序时发生 No such file or directory, 以下是我的请求参数和响应结果

 CmdRunArgs{
        Args: []string{
            "/usr/bin/go",
            "build",
            "-o",
            "solve",
            "solve.go",
        },
        Env: []string{
            "PATH=/usr/bin:/bin",
            "GOPATH=/w",
            "GOCACHE=/tmp",
        },
        Files: []CmdFile{
            Collector{Name: "stdout", Max: 10240000},
            Collector{Name: "stderr", Max: 10240000},
        },
        CpuLimit:    2000000000,
        ClockLimit:  4000000000,
        MemoryLimit: 1073741824,
        ProcLimit:   16,
        CopyIn: map[string]CmdFile{
            "solve.go": MemoryFile{Content: string(file)},
        },

        CopyOut:       []string{"stdout", "stderr"},
        CopyOutCached: []string{"solve"},
    }
2024/10/01 09:30:18 [{"status":"Nonzero Exit Status","exitStatus":1,"time":146119600,"memory":16519168,"runTime":50322854,"files":{"stderr":"","stdout":""},"fileError":[{"name":"solve","type":"CopyOutOpen","message":"open solve: no such file or directory"}]}]

请问要如何解决这个问题呢?