From a5c32a150415ecaadaec519538a3dd3da8dbd132 Mon Sep 17 00:00:00 2001 From: 5aaee9 <7685264+5aaee9@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:36:24 +0800 Subject: [PATCH] [v3] allow build with garble (#3192) * feat: allow build with garble * docs: update * Updated docs --------- Co-authored-by: Lea Anthony --- docs/src/content/docs/changelog.mdx | 1 + mkdocs-website/docs/en/changelog.md | 0 v3/internal/go-common-file-dialog/cfd/DialogConfig.go | 4 ++++ v3/pkg/application/application_debug.go | 5 +++++ 4 files changed, 10 insertions(+) create mode 100644 mkdocs-website/docs/en/changelog.md diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index 91f828eb7..e4ca6fa24 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix event handling by [@leaanthony](https://github.com/leaanthony) - Fixed window shutdown logic by [@leaanthony](https://github.com/leaanthony) - Common taskfile now defaults to generating Typescript bindings for Typescript templates by [@leaanthony](https://github.com/leaanthony) +- Fixed garble build by @5aaee9 in [#3192](https://github.com/wailsapp/wails/pull/3192) ### Changed diff --git a/mkdocs-website/docs/en/changelog.md b/mkdocs-website/docs/en/changelog.md new file mode 100644 index 000000000..e69de29bb diff --git a/v3/internal/go-common-file-dialog/cfd/DialogConfig.go b/v3/internal/go-common-file-dialog/cfd/DialogConfig.go index a80606df7..800573ed2 100644 --- a/v3/internal/go-common-file-dialog/cfd/DialogConfig.go +++ b/v3/internal/go-common-file-dialog/cfd/DialogConfig.go @@ -3,6 +3,7 @@ package cfd import ( + "reflect" "fmt" "os" ) @@ -14,6 +15,9 @@ type FileFilter struct { Pattern string } +// Never obfuscate the FileFilter type. +var _ = reflect.TypeOf(FileFilter{}) + type DialogConfig struct { // The title of the dialog Title string diff --git a/v3/pkg/application/application_debug.go b/v3/pkg/application/application_debug.go index 265e67484..bc850c3e8 100644 --- a/v3/pkg/application/application_debug.go +++ b/v3/pkg/application/application_debug.go @@ -40,6 +40,11 @@ func newApplication(options Options) *App { func (a *App) logStartup() { var args []any + // BuildInfo is nil when build with garble + if BuildInfo == nil { + return + } + wailsPackage, _ := lo.Find(BuildInfo.Deps, func(dep *debug.Module) bool { return dep.Path == "github.com/wailsapp/wails/v3" })