From 05a26adbb50a556d223835a191232d8380f509ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 17 Nov 2022 22:00:13 +0000 Subject: [PATCH] revert obfuscation of the syscall package In the hopes that it fixes the sporadic gogarble.txtar failures on Mac, where rebuilding runtime sometimes leads to a different binary. For #609. --- shared.go | 4 ++++ testdata/script/gogarble.txtar | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shared.go b/shared.go index 2156eedc..01837c74 100644 --- a/shared.go +++ b/shared.go @@ -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, diff --git a/testdata/script/gogarble.txtar b/testdata/script/gogarble.txtar index 5c6cd4c7..be3a7ccf 100644 --- a/testdata/script/gogarble.txtar +++ b/testdata/script/gogarble.txtar @@ -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