Skip to content

Commit

Permalink
Turn on reproducible PEX builds, e.g. for ./pants binary command (p…
Browse files Browse the repository at this point in the history
…antsbuild#7734)

Pex 1.6.7 added support for reproducible Pex builds (pex-tool/pex#716), meaning that the output of `pex -o 1.pex` will be byte for byte identical to `pex -o 2.pex`. This specifically means that the PEX will use a deterministic timestamp of January 1, 1980 and that the built PEX will not include `.pyc`, which is inherently non-reproducible.

In Pex 1.7.0, Pex will default to this reproducible behavior. Originally we were going to wait for that to land to avoid making any changes to Pex. However, a [user has a strong desire](pex-tool/pex#718 (comment)) for reproducible PEX builds so we are turning on the behavior earlier.

Note that we do not introduce any flags to turn off reproducible builds, because we expect that all users will want this behavior. If we get feedback that users do not, e.g. that they want to include `.pyc` files, then we will add options to turn this behavior off.
  • Loading branch information
Eric-Arellano authored and stuhood committed May 16, 2019
1 parent 06511c6 commit 46c22fa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 350,7 @@ def set_entry_point(self, entry_point):

def build(self, safe_path):
self.freeze()
self._builder.build(safe_path)
self._builder.build(safe_path, bytecode_compile=False, deterministic_timestamp=True)

def set_shebang(self, shebang):
self._builder.set_shebang(shebang)
Expand Down

0 comments on commit 46c22fa

Please sign in to comment.