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

support SOURCE_DATE_EPOCH to make gem spec reproducible #2278

Merged
merged 1 commit into from May 12, 2018
Merged

support SOURCE_DATE_EPOCH to make gem spec reproducible #2278

merged 1 commit into from May 12, 2018

Conversation

anthraxx
Copy link
Contributor

@anthraxx anthraxx commented May 2, 2018

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of TODAY to allow reproducible builds of created gem specs.

In case none is specified, fall back to the current time.


The problem is that using TODAY will change during time which makes created artifacts not reproducible (bit by bit identical).

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

Buy-in:
https://reproducible-builds.org/docs/buy-in/

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

@hsbt
Copy link
Member

hsbt commented May 8, 2018

I'm not familiar with SOURCE_DATE_EPOCH environment variable. Is it major on the linux distribution like debian, fedora, archlinux?

@anthraxx
Copy link
Contributor Author

anthraxx commented May 8, 2018 via email

@segiddins
Copy link
Member

Does this actually make the generated tar files byte for byte equal? If that’s the goal, should we add test coverage for that?

@anthraxx
Copy link
Contributor Author

anthraxx commented May 8, 2018 via email

@anthraxx
Copy link
Contributor Author

anthraxx commented May 9, 2018

@hsbt @segiddins So i took a look at the TarHeader and TarWriter stuff and I think its not hard to make it fully reproducible.
I would personally still prefere to make it in a separate PR, but thats your call. Either way i would take a look into that as well.

# The date this gem was created. Lazily defaults to the current UTC date.
# The date this gem was created. Lazily defaults to the current UTC date or if
# SOURCE_DATE_EPOCH is set as an environment variable (unix timestamp) to
# support reproducible builds.
Copy link
Member

Choose a reason for hiding this comment

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

@anthraxx Thoughts on changing this to something like the following?

# The date this gem was created.
#
# If SOURCE_DATE_EPOCH is set as an environment variable, use that to support
# reproducible builds; otherwise, default to the current UTC date.
#
# Details on SOURCE_DATE_EPOCH:
# https://reproducible-builds.org/specs/source-date-epoch/

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of TODAY to allow reproducible builds of created gem specs.

In case none is specified, fall back to the current time.
@hsbt
Copy link
Member

hsbt commented May 10, 2018

@anthraxx Thanks for your explanation. I prefer your idea.

@segiddins
Copy link
Member

👍🏻

@duckinator
Copy link
Member

@bundlerbot r+

thanks for the PR, @anthraxx!

@bundlerbot
Copy link
Collaborator

📌 Commit 9fc4ca4 has been approved by duckinator

@bundlerbot
Copy link
Collaborator

⌛ Testing commit 9fc4ca4 with merge a941b2d...

bundlerbot added a commit that referenced this pull request May 12, 2018
support SOURCE_DATE_EPOCH to make gem spec reproducible

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of TODAY to allow reproducible builds of created gem specs.

In case none is specified, fall back to the current time.
______________

The problem is that using TODAY will change during time which makes created artifacts not reproducible (bit by bit identical).

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

Buy-in:
https://reproducible-builds.org/docs/buy-in/

# Tasks:

- [x] Describe the problem / feature
- [x] Write tests
- [x] Write code to solve the problem
- [x] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@bundlerbot
Copy link
Collaborator

💔 Test failed - status-travis

@anthraxx
Copy link
Contributor Author

^ tm that doesn't look like i broke it 😼

@duckinator
Copy link
Member

duckinator commented May 12, 2018

@bundlerbot retry

¯\(ツ)

@bundlerbot
Copy link
Collaborator

⌛ Testing commit 9fc4ca4 with merge 2617baa...

bundlerbot added a commit that referenced this pull request May 12, 2018
support SOURCE_DATE_EPOCH to make gem spec reproducible

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of TODAY to allow reproducible builds of created gem specs.

In case none is specified, fall back to the current time.
______________

The problem is that using TODAY will change during time which makes created artifacts not reproducible (bit by bit identical).

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

Buy-in:
https://reproducible-builds.org/docs/buy-in/

# Tasks:

- [x] Describe the problem / feature
- [x] Write tests
- [x] Write code to solve the problem
- [x] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@bundlerbot
Copy link
Collaborator

⌛ Testing commit 9fc4ca4 with merge 8eef507...

bundlerbot added a commit that referenced this pull request May 12, 2018
support SOURCE_DATE_EPOCH to make gem spec reproducible

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of TODAY to allow reproducible builds of created gem specs.

In case none is specified, fall back to the current time.
______________

The problem is that using TODAY will change during time which makes created artifacts not reproducible (bit by bit identical).

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

Buy-in:
https://reproducible-builds.org/docs/buy-in/

# Tasks:

- [x] Describe the problem / feature
- [x] Write tests
- [x] Write code to solve the problem
- [x] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@bundlerbot
Copy link
Collaborator

☀️ Test successful - status-travis
Approved by: duckinator
Pushing 8eef507 to master...

@bundlerbot bundlerbot merged commit 9fc4ca4 into rubygems:master May 12, 2018
@anthraxx anthraxx deleted the fix/reproducible-build branch May 12, 2018 19:41
bundlerbot added a commit that referenced this pull request May 14, 2018
…hsbt

support SOURCE_DATE_EPOCH to make gem tar reproducible

Optionally respect the SOURCE_DATE_EPOCH environment variable to be used
instead of Time.now to allow reproducible builds of created gem tarballs.

In case none is specified, fall back to the current time.

# Description:

The problem is that using Time.now will change during time which makes created gem tarballs not reproducible (bit by bit identical).

This is related to making the .gemspec file's itself reproducible: #2278

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

Buy-in:
https://reproducible-builds.org/docs/buy-in/
______________

# Tasks:

- [x] Describe the problem / feature
- [x] Write tests
- [x] Write code to solve the problem
- [x] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@colby-swandale colby-swandale added this to the 2.8.0 milestone Sep 23, 2018
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.

None yet

7 participants