This is an archive of the discontinued Mercurial Phabricator instance.

setup: only write some autogenerated files if they change
ClosedPublic

Authored by indygreg on Dec 4 2017, 12:00 AM.

Details

Summary

Without this change, setup.py always writes some files on every
invocation. This prevents some builds from being a no-op when they
should. And, since times can sneak into generated .pyc files,
this prevents file content from being deterministic between
builds.

As part of the refactor, we treat file content as bytes.

The only potential regression from this would be if some tool
is looking at mtimes of the changed files to determine if
further action should be taken. But I don't think anything
critically important is keyed off the mtimes of these specific files.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Dec 4 2017, 12:00 AM
yuja accepted this revision.Dec 5 2017, 6:56 AM
yuja added a subscriber: yuja.
yuja added inline comments.
setup.py
499

Made it bytes and queued, thanks.

This revision is now accepted and ready to land.Dec 5 2017, 6:56 AM
This revision was automatically updated to reflect the committed changes.