classification
Title: Fix importlib.h build rule to not depend on hg
Type: compile error Stage: needs patch
Components: Build Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: Arfrever, brett.cannon, eric.araujo, eric.smith, georg.brandl, loewis, python-dev
Priority: release blocker Keywords:

Created on 2012-04-22 01:52 by brett.cannon, last changed 2012-04-28 09:57 by loewis. This issue is now closed.

Messages (17)
msg158944 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 01:52
A shell or Python script should be used to verify that importlib.h actually needs to be rebuilt, and if so make sure that it's even possible (since it depends on a locally built ./python).
msg158965 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 15:01
The thing should also do a sanity check on the syntax so as to minimize the chances of freezing code that has no chance of working.
msg158969 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-22 16:43
What do you mean by "sanity check on the syntax"? The current Makefile rule to build importlib.h already checks the syntax of _bootstrap.py, and fails if there is a syntax error.
msg158970 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 17:02
On Sun, Apr 22, 2012 at 12:43, Martin v. Löwis <report@bugs.python.org>wrote:

>
> Martin v. Löwis <martin@v.loewis.de> added the comment:
>
> What do you mean by "sanity check on the syntax"? The current Makefile
> rule to build importlib.h already checks the syntax of _bootstrap.py, and
> fails if there is a syntax error

That's true, so ignore my comment. =)
msg158972 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-22 17:10
Also, what's the issue with a shell script? The current Makefile will rebuild importlib.h if its time stamp is older than the one of _bootstrap.py. That will fail if ./python was not build.

So what is the problem to solve?
msg158977 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 17:49
I don't quite follow. I have no issue with a shell script verifying things  by doing an `hg status` to verify certain truths (or something). I said a shell *or* Python script to begin with.
msg158991 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-22 22:25
My point is: ISTM that everything is already as it should be, I can see no problem in the status quo. If there is a problem, can you please rephrase it? If you want a shell script just to have one, here is one

#!/bin/sh
make Python/importlib.h
msg158992 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 22:46
No, I don't want a shell script just to have one. =)

The status quo seems to work, but people like Georg think it's partially luck that it does and if hg changes its semantics that will cause us trouble.
msg159261 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-25 08:54
New changeset acfdf46b8de1 by Marc-Andre Lemburg in branch 'default':
Issue #14605 and #14642:
http://hg.python.org/cpython/rev/acfdf46b8de1
msg159294 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-25 15:03
This is where a script could help with printing out a warning if the built Python interpreter is not available.
msg159309 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-04-25 15:56
> The status quo seems to work, but people like Georg think it's partially luck that
> it does and if hg changes its semantics that will cause us trouble.

Could you expand on that?
msg159315 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-25 16:30
When you do a fresh checkout, Python/importlib.h comes after Lib/importlib/_bootstrap.py and Python/freeze_importlib.py in a lexicographical sort which leads to it have a newer timestamp and thus not triggering a new build of the file.

This is why Martin suggested at some point using hg status or something from a script to properly detect if something has changed that would warrant rebuilding.
msg159326 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-25 17:45
New changeset 5fea362b92fc by Marc-Andre Lemburg in branch 'default':
Issue #14605 and #14642: Issue a warning in case Python\importlib.h needs to
http://hg.python.org/cpython/rev/5fea362b92fc
msg159332 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-25 18:39
I'm working on a "hg touch" extension which is able to bring the time stamps back in correct order after a checkout. One would either do "make touch" after an update, or register that extension as a post-update action in .hg/hgrc. It will be controlled by a versioned .hgtouch file, that uses make(1) dependency syntax.
msg159456 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-27 14:10
New changeset b3d3f3238c13 by Martin v. Loewis in branch 'default':
Issue #14642: Add "hg touch" extension, and "make touch" target.
http://hg.python.org/cpython/rev/b3d3f3238c13
msg159493 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-27 20:50
Can this issue be closed, Martin, thanks to your extension?
msg159515 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-28 09:57
As I don't fully understand what the original issue was, I can't know for sure whether it's fixed now. But yes, there is now a mechanism to bring the time stamps in the right order.
History
Date User Action Args
2012-04-28 09:57:08loewissetstatus: open -> closed
resolution: fixed
messages: + msg159515
2012-04-27 20:50:00brett.cannonsetassignee: loewis
messages: + msg159493
2012-04-27 14:10:19python-devsetmessages: + msg159456
2012-04-25 18:39:15loewissetmessages: + msg159332
2012-04-25 17:45:29python-devsetmessages: + msg159326
2012-04-25 16:30:56brett.cannonsetmessages: + msg159315
2012-04-25 15:56:27eric.araujosetnosy: + eric.araujo
messages: + msg159309
2012-04-25 15:03:54brett.cannonsetmessages: + msg159294
2012-04-25 08:54:58python-devsetnosy: + python-dev
messages: + msg159261
2012-04-22 22:46:34brett.cannonsetmessages: + msg158992
2012-04-22 22:25:33loewissetmessages: + msg158991
2012-04-22 17:49:39brett.cannonsetmessages: + msg158977
2012-04-22 17:10:04loewissetmessages: + msg158972
2012-04-22 17:02:05brett.cannonsetmessages: + msg158970
2012-04-22 16:43:18loewissetmessages: + msg158969
2012-04-22 15:01:54brett.cannonsetmessages: + msg158965
2012-04-22 14:29:18Arfreversetnosy: + Arfrever
2012-04-22 11:20:59eric.smithsetnosy: + eric.smith
2012-04-22 09:54:39Arfreversettitle: Fix imoprtlib.h build rule to not depend on hg -> Fix importlib.h build rule to not depend on hg
2012-04-22 01:52:47brett.cannoncreate