MCPcopy Index your code
hub / github.com/jetify-com/devbox / prependRPATH

Method prependRPATH

internal/patchpkg/patch.go:96–117  ·  view source on GitHub ↗
(libPkg *packageFS)

Source from the content-addressed store, hash-verified

94}
95
96func (p *libPatcher) prependRPATH(libPkg *packageFS) {
97 glob := "lib*/*.so*"
98 matches, _ := fs.Glob(libPkg, glob)
99 if len(matches) == 0 {
100 slog.Debug("not prepending package to RPATH because no shared libraries were found", "pkg", libPkg.storePath)
101 return
102 }
103 for i := range matches {
104 matches[i] = path.Dir(matches[i])
105 }
106 slices.Sort(matches)
107 matches = slices.Compact(matches)
108 for i := range matches {
109 var err error
110 matches[i], err = libPkg.OSPath(matches[i])
111 if err != nil {
112 continue
113 }
114 }
115 p.rpath = append(p.rpath, matches...)
116 slog.Debug("prepended package lib dirs to RPATH", "pkg", libPkg.storePath, "dirs", matches)
117}
118
119// patch applies glibc patches to a binary and writes the patched result to
120// outPath. It does not modify the original binary in-place.

Callers 1

restoreMissingRefsMethod · 0.80

Calls 1

OSPathMethod · 0.80

Tested by

no test coverage detected