This is an archive of the discontinued LLVM Phabricator instance.

[lit] Make lit stop writing .pyc files
Needs RevisionPublic

Authored by zturner on Sep 18 2017, 5:43 PM.

Details

Summary

This seems to be causing endless SVN tree conflicts on certain buildbots. I guess what's happening is that we run the test suite, and the test suite does import lit.llvm and that creates a .pyc file in the source tree. Then, svn gets confused when doing an update and refuses to update it because it thinks there's a conflict.

I don't know why this isn't happening for other lit folders (e.g. lit/formats), but it definitely seems to be the problem. I don't know of a better way to fix this then just disabling pyc generation, which I think this does the trick.

Diff Detail

Event Timeline

zturner created this revision.Sep 18 2017, 5:43 PM

Sorry, ignore the inode changes, they are part of a different patch.

zturner updated this revision to Diff 115769.Sep 18 2017, 5:49 PM

Removed code that belonged in another patch

smeenai accepted this revision.Sep 18 2017, 6:35 PM

This seems fine as a workaround, though I'm curious about the root cause. Shouldn't there only be conflicts during an update if the update is bringing in pyc files of its own (i.e. if pyc files got committed to svn)?

This revision is now accepted and ready to land.Sep 18 2017, 6:35 PM
dlj edited edge metadata.Sep 18 2017, 8:10 PM

Would it make more sense to set this as an SVN property?

http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html

svn propset svn:global-ignores . '*.pyc'

(Or as svn:ignore on the lit directories)

In D38016#874699, @dlj wrote:

Would it make more sense to set this as an SVN property?

http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html

svn propset svn:global-ignores . '*.pyc'

(Or as svn:ignore on the lit directories)

I actually did set svn:ignore on the lit directory and it didn't work. It's kind of hard diagnosing this kind of thing because I can't physically see it reproducing so all I can do is hit it with as big of a hammer as possible. I guess I can wait and see if it happens again on another bot the next time I check something in, and if so I can try to get one of the bot owners to help me investigate.

dlj added a comment.Sep 18 2017, 8:51 PM
In D38016#874699, @dlj wrote:

Would it make more sense to set this as an SVN property?

http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html

svn propset svn:global-ignores . '*.pyc'

(Or as svn:ignore on the lit directories)

I actually did set svn:ignore on the lit directory and it didn't work. It's kind of hard diagnosing this kind of thing because I can't physically see it reproducing so all I can do is hit it with as big of a hammer as possible. I guess I can wait and see if it happens again on another bot the next time I check something in, and if so I can try to get one of the bot owners to help me investigate.

Yeah, that sounds pretty strange. Although it could be because svn:ignore doesn't inherit (as opposed to svn:global-ignores).

Either way, this seems OK.

dlj accepted this revision.Sep 18 2017, 8:51 PM
rnk requested changes to this revision.Sep 19 2017, 8:48 AM

Are you sure you can't reproduce this behavior by checking out the lit subtree with SVN before you deleted that directory, importing some .py files from that tree to create .pycs, and then doing svn up and checking if it creates a conflict? I'd really prefer to have an explanatory comment in here that says why we're setting this mysterious configuration.

I hate it when I trip over configuration tweaks that exist to work around problems that have been completely forgotten.

This revision now requires changes to proceed.Sep 19 2017, 8:48 AM