mage
mage copied to clipboard
refactor(compile): add trimpath to compile to remove local paths
- Include trimpath to ensure local filepaths from CI or developer don't get included in the produced artifact.
- This was added in Go 1.13, so not sure if there is something special to handle adding this flag only if go version > 1.13.
Go documentation on this:
-trimpath remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin either a module path@version (when using modules), or a plain import path (when using the standard library, or GOPATH).
I feel like the aqua part should be called out in the title/desc somewhere....
EDIT: Ah, I see, that is from https://github.com/magefile/mage/pull/451 and just wasn't removed when making this PR. I'd suggest cleaning that up :D
My mistake. I did a pr for that but did it on main branch in fork resulting in my new branch including that. I’ll have to separate this out.
@jaredallard reverted back so pr changes are now just this. Not sure about compatibility for prior go versions to 1.13 like I mentioned but otherwise this will be good for privacy. Right now compiled binary includes full path. Cheers