Skip to content

Commit

Permalink
Merge pull request opensearch-project#373 from javierhonduco/clean-de…
Browse files Browse the repository at this point in the history
…buginfo-stripped

debuginfo: remove `.debuginfo.stripped` binaries
  • Loading branch information
kakkoyun authored Apr 25, 2022
2 parents 235c061 + 91af04c commit 80e9cb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/debuginfo/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func (e *Extractor) Extract(ctx context.Context, buildID, filePath string) (stri
}

outFile := path.Join(e.tmpDir, fmt.Sprintf("%s.debuginfo", buildID))
strippedFile := fmt.Sprintf("%s.stripped", outFile)

var cmd *exec.Cmd
switch {
case hasDWARF:
Expand All @@ -124,7 +126,7 @@ func (e *Extractor) Extract(ctx context.Context, buildID, filePath string) (stri
if err := os.Remove(file); err != nil {
level.Warn(e.logger).Log("msg", "failed to remove temporary file", "file", file, "err", err)
}
}(fmt.Sprintf("%s.stripped", buildID))
}(strippedFile)
case isGo:
cmd = e.objcopy(ctx, filePath, outFile, toRemove)
case hasSymtab:
Expand Down

0 comments on commit 80e9cb0

Please sign in to comment.