Skip to content

Conversation

1351914167
Copy link

  • New module internal/pyenv
  • Purpose: during llgo build, automatically download a Python environment into LLGoCache, pip corresponding site-packages, and set up the runtime.

Current issues:

  1. Only supported under llgo run and llgo build. When running the binary, the program falls back to the system’s default Python.
  2. Only macOS Python builds are supported. On Ubuntu, Go–Python programs will panic with “todo” instead of using the system’s default Python. Therefore, all Ubuntu jobs in CI failing is expected.

@1351914167 1351914167 marked this pull request as draft August 25, 2025 07:52
Comment on lines 117 to 122
for _, p := range parts {
if p == pkgcfg {
found = true
break
}
}
Copy link
Contributor

@MeteorsLiu MeteorsLiu Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to replace with slices.Contains

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 3f9c97b.

return err
}
lines := strings.Split(string(b), "\n")
rpath := "-Wl,-rpath," + filepath.Join(pyHome, "lib")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that's unnecessary, #1163 will set up -rpath automatically.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5643951, I keep FindPythonRpath to dynamically resolve the local Python library path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants