Skip to content

Commit

Permalink
revert obfuscation of the syscall package
Browse files Browse the repository at this point in the history
In the hopes that it fixes the sporadic gogarble.txtar failures on Mac,
where rebuilding runtime sometimes leads to a different binary.

For #609.
  • Loading branch information
mvdan committed Nov 17, 2022
1 parent 7d59183 commit 7879624
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ func appendListedPackages(packages []string, withDeps bool) error {
//
// TODO: investigate and resolve each one of these
var cannotObfuscate = map[string]bool{
// See https://github.com/burrowers/garble/issues/609.
// Also, how do we write a good regression test?
"syscall": true,

// "unknown pc" crashes on windows in the cgo test otherwise
"runtime/cgo": true,

Expand Down
3 changes: 2 additions & 1 deletion testdata/script/gogarble.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ garble build std
# support ImportMap when linking.
# Also ensure we are obfuscating low-level std packages.
garble build -o=out ./stdimporter
! binsubstr out 'http.ListenAndServe' 'debug.WriteHeapDump' 'time.Now' 'syscall.Listen'
# ! binsubstr out 'http.ListenAndServe' 'debug.WriteHeapDump' 'time.Now' 'syscall.Listen'
! binsubstr out 'http.ListenAndServe' 'debug.WriteHeapDump' 'time.Now'

# The same low-level std packages appear in plain sight in regular builds.
go build -o=out_regular ./stdimporter
Expand Down

0 comments on commit 7879624

Please sign in to comment.