Execute the managed interpreter through its real path
ci / vet-and-test (pull_request) Successful in 1m3s
ci / vet-and-test (pull_request) Successful in 1m3s
Why: the sandbox hides /home and only remounts the resolved Python prefix, so executing python/current/bin/python3 failed before the base layer could be imported. Evidence: go test ./internal/tools/ -run TestResolveInterpreterFollowsManagedSymlink passed, and env doctor against the built base layer printed doctor ok (SELF). Impact: run_python and env doctor follow the symlink into the mounted prefix or /usr/bin/python3. The layer and the prefix mount stay the same. Refs: Agent-System-Backend PR 207 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"agent-system-backend/internal/execenv"
|
||||
@@ -137,6 +138,9 @@ func runDoctor(ctx context.Context, root *execenv.Root, py string, sandbox bool)
|
||||
if prefix := root.PythonPrefix(); prefix != "" {
|
||||
mounts = append(mounts, prefix)
|
||||
}
|
||||
if resolved, err := filepath.EvalSymlinks(py); err == nil {
|
||||
py = resolved
|
||||
}
|
||||
if err := execenv.Doctor(ctx, py, pyPath, nil, sandbox, mounts); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "env doctor:", err)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user