micro/tools
Morten Linderud 9a3fb52b42
Support reproducible builds (#1802)
* Makefile: Ensure we strip out embedded paths

To reproduce binaries undeterministic values needs to be removed. By
default Go embeds several module paths into the binaries, which prevents
people from reproducing said distributed binary.

The distributed binary from micro contains the full home path of the
current builder of the binary. -trimpath removes these paths from the
binary.

    $ strings micro | grep "/home/zyedidia" | wc -l
    868

This also helps other distributions providing reproducible versions of
micro down the line.

Signed-off-by: Morten Linderud <morten@linderud.pw>

* build-date: Ensure build time adheres to SOURCE_DATE_EPOCH

Embedding undeterministic values into binaries prevents reproduction of
the binaries. The reproducible builds projects defines
`SOURCE_DATE_EPOCH` to allow deterministic insertion of build times.

This patch ensures `build-date` checks the environment variable before
building with the local time.

    $ SOURCE_DATE_EPOCH=123123 go run tools/build-date.go
    January 02, 1970
    $ go run tools/build-date.go
    July 31, 2020

    $ make build-quick && ./micro --version
    [...]
    Compiled on July 31, 2020
    $ SOURCE_DATE_EPOCH=123123 make build-quick && ./micro --version
    [...]
    Compiled on January 02, 1970

https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-08-01 20:26:39 -04:00
..
go-bindata@9453701aa0 Fix tooling dependencies 2019-12-25 17:05:10 -05:00
build-date.go Support reproducible builds (#1802) 2020-08-01 20:26:39 -04:00
build-version.go Tweak version build script 2020-02-19 05:27:33 +00:00
compile-linux.sh Update makefile and vendor script 2019-12-26 22:03:30 -05:00
cross-compile.sh Name svg micro.svg in tarballs 2020-07-09 13:29:48 -04:00
info-plist.go Fix various linter and vet warnings 2017-02-21 13:07:37 -05:00
nightly-release.sh Rename deb file in scripts 2020-07-06 17:30:49 +00:00
package-deb.sh Improve deb package 2020-07-06 17:25:30 +00:00
pre-release.sh Rename deb file in scripts 2020-07-06 17:30:49 +00:00
release.sh Rename deb file in scripts 2020-07-06 17:30:49 +00:00
remove-nightly-assets.go Edit nightly release instead of replacing 2020-06-16 20:33:59 -04:00
testgen.go Add more sophisticated buffer benchmark system 2020-03-01 13:20:10 +05:30
update-nightly-tag.sh Update nightly release scripts 2020-07-05 17:12:06 -04:00
vendor-src.sh Fix vendor-src script 2017-06-23 17:28:33 -04:00