-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spell mixins for Go toolchain options #37
Milestone
Comments
svengreb
added a commit
that referenced
this issue
Nov 24, 2020
To support common use cases for debugging and production optimization, some spell mixins [1] have been implemented in the "golang" [2] package: - π `MixinImproveDebugging` - A `struct` type that adds linker flags to improve the debugging of binary artifacts. This includes the disabling of inlining and all compiler optimizations tp improve the compatibility for debuggers. Note that this mixin adds the `all` prefix for `-gcflags` parameters to make sure all packages are affected. If you disabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinImproveEscapeAnalysis` - A `struct` type that adds linker flags to improve the escape analysis of binary artifacts. Note that this mixin removes the `all` prefix for `-gcflags` parameters to make sure only the target package is affected, otherwise reports for (traverse) dependencies would be included as well. If you enabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinStripDebugMetadata` - A `struct` type that adds linker flags to strip debug information from binary artifacts. This includes "DWARF" tables needed for debuggers, but keeps annotations needed for stack traces so panics are still readable. It also shrinks the file size and memory overhead as well as reducing the chance for possible security related problems due to enabled development features or debug information leaks. Note that this mixin adds the `all` prefix for `-gcflags` parameters to make sure all packages are affected. If you disabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinInjectBuildTimeVariableValues` - A `struct` type that injects build-time values through the `-X` linker flags to populate e.g. application metadata variables. It store a `map[string]string` of key/value pairs to inject to variables at build-time. The key must be the path to the variable in form of `<IMPORT_PATH>.<VARIABLE_NAME>`, e.g. `pkg/internal/support/app.version`. The value is the actual value that will be assigned to the variable, e.g. the application version. A field of type `*project.GoModuleID` [3] stores partial information about the target Go module to inject the key/value pairs from the data map into. [1]: https://pkg.go.dev/github.com/svengreb/wand/pkg/spell#Mixin [2]: https://pkg.go.dev/github.com/svengreb/wand/pkg/spell/golang [3]: https://pkg.go.dev/github.com/svengreb/wand/pkg/project#GoModuleID GH-37
svengreb
added a commit
that referenced
this issue
Nov 24, 2020
To support common use cases for debugging and production optimization, some spell mixins [1] have been implemented in the "golang" [2] package: - π `MixinImproveDebugging` - A `struct` type that adds linker flags to improve the debugging of binary artifacts. This includes the disabling of inlining and all compiler optimizations tp improve the compatibility for debuggers. Note that this mixin adds the `all` prefix for `-gcflags` parameters to make sure all packages are affected. If you disabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinImproveEscapeAnalysis` - A `struct` type that adds linker flags to improve the escape analysis of binary artifacts. Note that this mixin removes the `all` prefix for `-gcflags` parameters to make sure only the target package is affected, otherwise reports for (traverse) dependencies would be included as well. If you enabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinStripDebugMetadata` - A `struct` type that adds linker flags to strip debug information from binary artifacts. This includes "DWARF" tables needed for debuggers, but keeps annotations needed for stack traces so panics are still readable. It also shrinks the file size and memory overhead as well as reducing the chance for possible security related problems due to enabled development features or debug information leaks. Note that this mixin adds the `all` prefix for `-gcflags` parameters to make sure all packages are affected. If you disabled the `all` prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options. - π `MixinInjectBuildTimeVariableValues` - A `struct` type that injects build-time values through the `-X` linker flags to populate e.g. application metadata variables. It store a `map[string]string` of key/value pairs to inject to variables at build-time. The key must be the path to the variable in form of `<IMPORT_PATH>.<VARIABLE_NAME>`, e.g. `pkg/internal/support/app.version`. The value is the actual value that will be assigned to the variable, e.g. the application version. A field of type `*project.GoModuleID` [3] stores partial information about the target Go module to inject the key/value pairs from the data map into. [1]: https://pkg.go.dev/github.com/svengreb/wand/pkg/spell#Mixin [2]: https://pkg.go.dev/github.com/svengreb/wand/pkg/spell/golang [3]: https://pkg.go.dev/github.com/svengreb/wand/pkg/project#GoModuleID Closes GH-37
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To support common use cases for debugging and production optimization, some spell mixins will be implemented in the golang package:
MixinImproveDebugging
β Astruct
type that adds linker flags to improve the debugging of binary artifacts. This includes the disabling of inlining and all compiler optimizations tp improve the compatibility for debuggers.Note that this mixin will add the
all
prefix forβgcflags
parameters to make sure all packages are affected. If you disabled theall
prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options.MixinImproveEscapeAnalysis
β Astruct
type that will add linker flags to improve the escape analysis of binary artifacts.Note that this mixin removes the
all
prefix forβgcflags
parameters to make sure only the target package is affected, otherwise reports for (traverse) dependencies would be included as well. If you enabled theall
prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options.MixinStripDebugMetadata
β Astruct
type that will add linker flags to strip debug information from binary artifacts. This will include DWARF tables needed for debuggers, but keeps annotations needed for stack traces so panics are still readable. It will also shrink the file size and memory overhead as well as reducing the chance for possible security related problems due to enabled development features or debug information leaks.Note that this mixin will add the
all
prefix forβgcflags
parameters to make sure all packages are affected. If you disabled theall
prefix on purpose you need to handle this conflict on your own, e.g. by creating more than one binary artifact each with different build options.MixinInjectBuildTimeVariableValues
β Astruct
type that will inject buildβtime values through theβX
linker flags to populate e.g. application metadata variables.It will store a
map[string]string
of key/value pairs to inject to variables at buildβtime. The key must be the path to the variable in form of<IMPORT_PATH>.<VARIABLE_NAME>
, e.g.pkg/internal/support/app.version
. The value is the actual value that will be assigned to the variable, e.g. the application version.A field of type
*project.GoModuleID
will store partial information about the target Go module to inject the key/value pairs from the data map into.The text was updated successfully, but these errors were encountered: