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

Allow to override build date with SOURCE_DATE_EPOCH #2643

Merged
merged 1 commit into from Jul 22, 2019

Conversation

@bmwiedemann
Copy link
Contributor

commented Jul 21, 2019

- What I did
Make cri-o build reproducibly by default.

- How I did it
Default BUILD_INFO to SOURCE_DATE_EPOCH, if available.

- How to verify it

  1. export SOURCE_DATE_EPOCH=123456
  2. Do 2 clean builds within taskset 1 (needed because of some go parallelism bug) and compare /usr/bin/crio - should have identical content between builds.

- Description for the changelog
Allow to override build date with SOURCE_DATE_EPOCH

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

While it is already possible to do reproducible builds without
this patch, this patch makes it the default,
so that distributions do not have to discover the BUILD_INFO variable.

Without this patch, /usr/bin/crio differs in ELF section .note.go.buildid

Signed-off-by: Bernhard M. Wiedemann bwiedemann@suse.de

@openshift-ci-robot

This comment has been minimized.

Copy link

commented Jul 21, 2019

Hi @bmwiedemann. Thanks for your PR.

I'm waiting for a cri-o or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

1 similar comment
@openshift-ci-robot

This comment has been minimized.

Copy link

commented Jul 21, 2019

Hi @bmwiedemann. Thanks for your PR.

I'm waiting for a cri-o or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bmwiedemann

This comment has been minimized.

Copy link
Contributor Author

commented Jul 21, 2019

/assign @rhatdan

@codecov

This comment has been minimized.

Copy link

commented Jul 21, 2019

Codecov Report

Merging #2643 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2643   +/-   ##
=======================================
  Coverage   53.11%   53.11%           
=======================================
  Files          82       82           
  Lines        6979     6979           
=======================================
  Hits         3707     3707           
  Misses       2911     2911           
  Partials      361      361
@haircommander

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

/ok-to-test
Change LGTM, though i'd almost prefer to replace the BUILD_INFO variable with SOURCE_DATE_EPOCH and set it with
SOURCE_DATE_EPOCH ?= $(shell date +%s)

@saschagrunert

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

Hey @bmwiedemann 👋, thanks for the improvement. I agree with @haircommander and I think we can replace the $(BUILD_INFO) variable entirely.

Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This renames BUILD_INFO to the standard name
so that distributions do not have to discover the BUILD_INFO variable.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>

@bmwiedemann bmwiedemann force-pushed the bmwiedemann:date branch from cbdb7e9 to 7996e83 Jul 22, 2019

@saschagrunert

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

/test integration_rhel

@saschagrunert
Copy link
Member

left a comment

LGTM

@openshift-ci-robot

This comment has been minimized.

Copy link

commented Jul 22, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bmwiedemann, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@openshift-ci-robot

This comment has been minimized.

Copy link

commented Jul 22, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bmwiedemann, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2019

/lgtm

@saschagrunert

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

/test integration_rhel

@saschagrunert

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

/test integration_rhel

@bmwiedemann

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

hmm, does the integration test rely on BUILD_INFO somehow?

@saschagrunert

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

hmm, does the integration test rely on BUILD_INFO somehow?

No, we have some flakes in the integration tests which we will tackle in the future 😇

@openshift-merge-robot openshift-merge-robot merged commit 7f8fa7f into cri-o:master Jul 22, 2019

31 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build-legacy Your tests passed on CircleCI!
Details
ci/circleci: build-static Your tests passed on CircleCI!
Details
ci/circleci: build-test-binaries Your tests passed on CircleCI!
Details
ci/circleci: bundle Your tests passed on CircleCI!
Details
ci/circleci: clang-format Your tests passed on CircleCI!
Details
ci/circleci: docs-validation Your tests passed on CircleCI!
Details
ci/circleci: ginkgo Your tests passed on CircleCI!
Details
ci/circleci: git-validation Your tests passed on CircleCI!
Details
ci/circleci: integration Your tests passed on CircleCI!
Details
ci/circleci: integration-critest Your tests passed on CircleCI!
Details
ci/circleci: integration-static-glibc Your tests passed on CircleCI!
Details
ci/circleci: integration-static-musl Your tests passed on CircleCI!
Details
ci/circleci: integration-userns Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: results Your tests passed on CircleCI!
Details
ci/circleci: unit-tests Your tests passed on CircleCI!
Details
ci/circleci: vendor Your tests passed on CircleCI!
Details
ci/kata-jenkins Jenkins job succeeded.
Details
ci/openshift-jenkins/critest_fedora Jenkins job succeeded.
Details
ci/openshift-jenkins/critest_rhel Jenkins job succeeded.
Details
ci/openshift-jenkins/e2e_features_fedora Jenkins job succeeded.
Details
ci/openshift-jenkins/e2e_features_rhel Jenkins job succeeded.
Details
ci/openshift-jenkins/e2e_fedora Jenkins job succeeded.
Details
ci/openshift-jenkins/e2e_rhel Jenkins job succeeded.
Details
ci/openshift-jenkins/integration_fedora Jenkins job succeeded.
Details
ci/openshift-jenkins/integration_rhel Jenkins job succeeded.
Details
codecov/patch Coverage not affected when comparing 77a5e9e...7996e83
Details
codecov/project 53.11% remains the same compared to 77a5e9e
Details
dco All commits have Signed-off-by
Details
tide In merge pool.
Details

@bmwiedemann bmwiedemann deleted the bmwiedemann:date branch Jul 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.