Replies: 2 comments
-
@Edu4rdSHL this is brilliant. thanks a lot! |
Beta Was this translation helpful? Give feedback.
0 replies
-
TZAG, After two days of hard work I have finished the migration of all the Go packages to the new build process as proposed here. The summary can be found in this attached file with the following conventions:
Regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have created BlackArch/blackarch-pkgbuilds#10 in order to switch from the old Golang build process to a new one that brings a lot of advantages and is technically superior and simple.
Why
As mentioned previously, there are several advantages:
-trimpath
to go build makes them system independent and help creating reproducible builds. The option instructs the compiler to remove all file system paths from the compiled executable. As a result, you will see module paths in stack traces instead of absolute paths of the build environment. Also prevents issues like Cameradar is compiled with hardcoded path prefixes which can't exist #3082.-buildmode=pie
build executables in Position-independent Code mode.-mod=readonly
resolve module imports, but fail if they must be reconfigured, means that it prevents the build process from modifying the go.mod file.-modcacherw
instructs the go command to leave newly-created directories in the module cache at their default permissions rather than making them read-only.-ldflags "-s -w"
strip DWARF, symbol table and debug info, it leads to ~25% binary size decrease or more in most cases.Additionally to the previous mentioned benefits, this build mode will rarely fails.
TODO
If this proposition is accepted, then I will take care of migrating all packages that depend on Go to the new build model. Of course, help is welcome.
Regards,
Ed
Beta Was this translation helpful? Give feedback.
All reactions