Skip to content

Commit 1237970

Browse files
parser: remove gosigar package (#20)
This commit removes the reference to the gosigar package. It leads to build issues when building for MacOS and Windows due to some functions not existing, but MOLT builds for cross platform
1 parent 1b87c86 commit 1237970

File tree

4 files changed

+47
-31
lines changed

4 files changed

+47
-31
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ require (
1414
github.com/cockroachdb/version v0.0.0-20250314144055-3860cd14adf2
1515
github.com/dave/dst v0.27.2
1616
github.com/dustin/go-humanize v1.0.0
17-
github.com/elastic/gosigar v0.14.3
1817
github.com/gogo/protobuf v1.3.2
1918
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551
2019
github.com/google/go-cmp v0.7.0

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m
101101
github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
102102
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
103103
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
104-
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
105-
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
106104
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
107105
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
108106
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
@@ -562,7 +560,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
562560
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
563561
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
564562
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
565-
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
566563
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
567564
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
568565
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

patches/0006-remove-gosigar.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
diff --git a/pkg/util/debugutil/debugutil.go b/pkg/util/debugutil/debugutil.go
2+
index 4aedcb9..446868c 100644
3+
--- a/pkg/util/debugutil/debugutil.go
4+
+++ b/pkg/util/debugutil/debugutil.go
5+
@@ -6,12 +6,8 @@
6+
package debugutil
7+
8+
import (
9+
- "os"
10+
- "path/filepath"
11+
"runtime/debug"
12+
"sync/atomic"
13+
-
14+
- "github.com/elastic/gosigar"
15+
)
16+
17+
// IsLaunchedByDebugger returns true in cases where the delve debugger
18+
@@ -22,29 +18,6 @@ func IsLaunchedByDebugger() bool {
19+
20+
var isLaunchedByDebugger atomic.Bool
21+
22+
-func init() {
23+
- isLaunchedByDebugger.Store(func(maybeDelvePID int) bool {
24+
- // We loop in case there were intermediary processes like the gopls
25+
- // language server.
26+
- for maybeDelvePID != 0 {
27+
- var exe gosigar.ProcExe
28+
- if err := exe.Get(maybeDelvePID); err != nil {
29+
- break
30+
- }
31+
- switch filepath.Base(exe.Name) {
32+
- case "dlv":
33+
- return true
34+
- }
35+
- var state gosigar.ProcState
36+
- if err := state.Get(maybeDelvePID); err != nil {
37+
- break
38+
- }
39+
- maybeDelvePID = state.Ppid
40+
- }
41+
- return false
42+
- }(os.Getppid()))
43+
-}
44+
-
45+
// SafeStack is an alias for []byte that handles redaction. Use this type
46+
// instead of []byte when you are sure that the stack trace does not contain
47+
// sensitive information.

pkg/util/debugutil/debugutil.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
package debugutil
77

88
import (
9-
"os"
10-
"path/filepath"
119
"runtime/debug"
1210
"sync/atomic"
13-
14-
"github.com/elastic/gosigar"
1511
)
1612

1713
// IsLaunchedByDebugger returns true in cases where the delve debugger
@@ -22,29 +18,6 @@ func IsLaunchedByDebugger() bool {
2218

2319
var isLaunchedByDebugger atomic.Bool
2420

25-
func init() {
26-
isLaunchedByDebugger.Store(func(maybeDelvePID int) bool {
27-
// We loop in case there were intermediary processes like the gopls
28-
// language server.
29-
for maybeDelvePID != 0 {
30-
var exe gosigar.ProcExe
31-
if err := exe.Get(maybeDelvePID); err != nil {
32-
break
33-
}
34-
switch filepath.Base(exe.Name) {
35-
case "dlv":
36-
return true
37-
}
38-
var state gosigar.ProcState
39-
if err := state.Get(maybeDelvePID); err != nil {
40-
break
41-
}
42-
maybeDelvePID = state.Ppid
43-
}
44-
return false
45-
}(os.Getppid()))
46-
}
47-
4821
// SafeStack is an alias for []byte that handles redaction. Use this type
4922
// instead of []byte when you are sure that the stack trace does not contain
5023
// sensitive information.

0 commit comments

Comments
 (0)