MCPcopy Create free account
hub / github.com/celer-pkg/celer / setupRuntimePath

Method setupRuntimePath

buildsystems/buildconfig_envs.go:234–251  ·  view source on GitHub ↗

setupLDLibraryPath Keep host-side dev tool runtimes resolvable before any helper process starts. This is especially important for Python extensions and other host tools that link against libraries from tmp/deps/ -dev/lib.

()

Source from the content-addressed store, hash-verified

232// This is especially important for Python extensions and other host tools that
233// link against libraries from tmp/deps/<host>-dev/lib.
234func (b BuildConfig) setupRuntimePath() {
235 tmpDevDir := filepath.Join(dirs.TmpDepsDir, b.PortConfig.HostName+"-dev")
236 for _, devLibDir := range []string{
237 filepath.Join(tmpDevDir, "lib"),
238 filepath.Join(tmpDevDir, "lib64"),
239 } {
240 if !fileio.PathExists(devLibDir) {
241 continue
242 }
243
244 switch runtime.GOOS {
245 case "linux":
246 b.envBackup.setenv("LD_LIBRARY_PATH", env.JoinPaths("LD_LIBRARY_PATH", devLibDir))
247 case "darwin":
248 b.envBackup.setenv("DYLD_LIBRARY_PATH", env.JoinPaths("DYLD_LIBRARY_PATH", devLibDir))
249 }
250 }
251}
252
253func (b BuildConfig) setupPythonEnvs() {
254 // Ensure PYTHONUSERBASE for pip.

Callers 1

setupEnvsMethod · 0.95

Calls 3

PathExistsFunction · 0.92
JoinPathsFunction · 0.92
setenvMethod · 0.80

Tested by

no test coverage detected