Skip to content
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

Reproducible buildsystem #7247

Merged
merged 20 commits into from
Sep 13, 2020
Merged

Reproducible buildsystem #7247

merged 20 commits into from
Sep 13, 2020

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Sep 7, 2020

This aims to provide a simple Docker-based mechanism for application
developers to provide reproducible builds. Unlike gaia's current
reproducible buildsystem, this does not depend on external tools,
e.g. gitian-builder.

build-simd-linux now builds simd in a deterministic Linux container.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@alessio alessio requested a review from tac0turtle September 7, 2020 12:27
This aims to provide a simple Docker-based mechanism for
application developers to provide reproducible builds. Unlike
`gaia`'s current reproducible buildsystem, this does not
depend on external tools, e.g. `gitian-builder`.

`build-simd-linux` now builds `simd` in a deterministic
Linux container.
@alessio alessio force-pushed the alessio/simplified-buildsystem branch from fbcc19e to 4e78c78 Compare September 7, 2020 13:48
@alessio alessio marked this pull request as ready for review September 7, 2020 13:49
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK. Love this new update. Does this mean we will be removing gitian?

@alessio
Copy link
Contributor Author

alessio commented Sep 8, 2020

@marbar3778 dixit:

Does this mean we will be removing gitian?

Yes, the ultimate objective of this is removing gitian altogether. Juicy and sweet extra bit: this buildsystem is actually much faster than the old gitian-based one.

@alessio
Copy link
Contributor Author

alessio commented Sep 9, 2020

@marbar3778 building an app is even easier now - look at build.sh for an example

Copy link
Contributor

@faddat faddat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is simd?

ledger enabled means using cgo, correct?

@codecov
Copy link

codecov bot commented Sep 13, 2020

Codecov Report

Merging #7247 into master will decrease coverage by 5.76%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #7247      +/-   ##
==========================================
- Coverage   56.22%   50.46%   -5.77%     
==========================================
  Files         584      284     -300     
  Lines       40515    20451   -20064     
==========================================
- Hits        22781    10320   -12461     
+ Misses      15816     9298    -6518     
+ Partials     1918      833    -1085     

@alessio alessio merged commit 606956b into master Sep 13, 2020
@alessio alessio deleted the alessio/simplified-buildsystem branch September 13, 2020 19:55
@cebi1992
Copy link

#!/bin/bash

set -ue

Expect the following envvars to be set:

- APP

- VERSION

- COMMIT

- TARGET_OS

- LEDGER_ENABLED

- DEBUG

Source builder's functions library

. /usr/local/share/tendermint/buildlib.sh

These variables are now available

- BASEDIR

- OUTDIR

Build for each os-architecture pair

for platform in ${TARGET_PLATFORMS} ; do
# This function sets GOOS, GOARCH, and OS_FILE_EXT environment variables
# according to the build target platform. OS_FILE_EXT is empty in all
# cases except when the target platform is 'windows'.
setup_build_env_for_platform "${platform}"

make clean
echo Building for $(go env GOOS)/$(go env GOARCH) >&2
GOROOT_FINAL="$(go env GOROOT)" \
make build \
    LDFLAGS=-buildid=${VERSION} \
    VERSION=${VERSION} \
    COMMIT=${COMMIT} \
    LEDGER_ENABLED=${LEDGER_ENABLED}
mv ./build/${APP}${OS_FILE_EXT} ${OUTDIR}/${APP}-${VERSION}-$(go env GOOS)-$(go env GOARCH)${OS_FILE_EXT}

# This function restore the build environment variables to their
# original state.
restore_build_env

done

Generate and display build report.

generate_build_report
cat ${OUTDIR}/build_report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants