Have I got my hg dependencies correct?

I've recently run into a problem building the math and cmath modules for 2.7. (I don't rebuild very often, so this problem might have been around for awhile.) My hg repos look like this:
* My cpython repo pulls from https://hg.python.org/cpython
* My 2.7 repo (and other non-tip repos) pulls from my cpython repo
I think this setup was recommended way back in the day when hg was new to the Python toolchain to avoid unnecessary network bandwidth.
So, if I execute
hg pull hg update
in first cpython, then 2.7 repos I should be up-to-date, correct? However, rebuilding in my 2.7 repo fails to build math and cmath. The compiler complains that Modules/_math.o doesn't exist. If I manually execute
make Modules/_math.o make
after the failure, then the math and cmath modules build.
Looking on bugs.python.org I saw this closed issue:
http://bugs.python.org/issue24421
which seems related. Is it possible that the fix wasn't propagated to the 2.7 branch? Or perhaps I've fouled up my hg repo relationships? My other repos which depend on cpython (3.5, 3.4, 3.3, and 3.2) all build the math module just fine.
I'm running on an ancient MacBook Pro with OS X 10.11.6 (El Capitan) and XCode 8.0 installed.
Any suggestions?
Skip

On Thu, Oct 20, 2016 at 6:47 AM, Skip Montanaro skip.montanaro@gmail.com wrote:
Is it possible that the fix wasn't propagated to the 2.7 branch? Or perhaps I've fouled up my hg repo relationships?
Either way, I went ahead and opened a ticket:
http://bugs.python.org/issue28487
S

Are you on the 2.7 branch or the default branch?
You might try to cleanup your checkout:
hg up -C -r 2.7 make distclean hg purge # WARNING! it removes *all* files not tracked by Mercurial ./configure && make
You should also paste the full error message.
Victor
2016-10-20 13:47 GMT+02:00 Skip Montanaro skip.montanaro@gmail.com:
I've recently run into a problem building the math and cmath modules for 2.7. (I don't rebuild very often, so this problem might have been around for awhile.) My hg repos look like this:
My cpython repo pulls from https://hg.python.org/cpython
My 2.7 repo (and other non-tip repos) pulls from my cpython repo
I think this setup was recommended way back in the day when hg was new to the Python toolchain to avoid unnecessary network bandwidth.
So, if I execute
hg pull hg update
in first cpython, then 2.7 repos I should be up-to-date, correct? However, rebuilding in my 2.7 repo fails to build math and cmath. The compiler complains that Modules/_math.o doesn't exist. If I manually execute
make Modules/_math.o make
after the failure, then the math and cmath modules build.
Looking on bugs.python.org I saw this closed issue:
http://bugs.python.org/issue24421
which seems related. Is it possible that the fix wasn't propagated to the 2.7 branch? Or perhaps I've fouled up my hg repo relationships? My other repos which depend on cpython (3.5, 3.4, 3.3, and 3.2) all build the math module just fine.
I'm running on an ancient MacBook Pro with OS X 10.11.6 (El Capitan) and XCode 8.0 installed.
Any suggestions?
Skip _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/victor.stinner%40gmail.co...

On Thu, Oct 20, 2016 at 7:35 AM, Victor Stinner victor.stinner@gmail.com wrote:
Are you on the 2.7 branch or the default branch?
You might try to cleanup your checkout:
hg up -C -r 2.7 make distclean hg purge # WARNING! it removes *all* files not tracked by Mercurial ./configure && make
You should also paste the full error message.
I am on the 2.7 branch. My tree looks like this:
~/src/hgpython/ cpython 3.6 3.5 3.4 3.3 3.2 2.7
As I indicated, the cpython repo pulls from the central repo. The 3.6 and 2.7 branches pull from cpython. The other 3.x branches pull from the 3.x+1 branch.
Sorry, I no longer have the error message. I wasn't thinking in the correct order, and executed the suggested hg purge command before retrieving the error message from my build.out file.
In any case, there seemed to be something about the hg up command:
% hg up -C -r 2.7 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
A plain hg up command didn't update any files. Looking at 2.7/ Makefile.pre.in, I see it now has the necessary target for _math.o. That must have been one of the six updated files.
Is there some deficiency in a plain hg update command which suggests I should always use the more complex command you suggested? It's not a huge deal typing-wise, as I use a shell script to rebuild my world, doing the necessary work to update and build each branch.
Skip

On Thu, Oct 20, 2016 at 11:23 AM, Skip Montanaro skip.montanaro@gmail.com wrote:
On Thu, Oct 20, 2016 at 7:35 AM, Victor Stinner victor.stinner@gmail.com wrote:
Are you on the 2.7 branch or the default branch?
You might try to cleanup your checkout:
hg up -C -r 2.7 make distclean hg purge # WARNING! it removes *all* files not tracked by Mercurial ./configure && make
You should also paste the full error message.
I am on the 2.7 branch. My tree looks like this:
~/src/hgpython/ cpython 3.6 3.5 3.4 3.3 3.2 2.7
As I indicated, the cpython repo pulls from the central repo. The 3.6 and 2.7 branches pull from cpython. The other 3.x branches pull from the 3.x+1 branch.
Sorry, I no longer have the error message. I wasn't thinking in the correct order, and executed the suggested hg purge command before retrieving the error message from my build.out file.
In any case, there seemed to be something about the hg up command:
% hg up -C -r 2.7 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
A plain hg up command didn't update any files. Looking at 2.7/Makefile.pre.in, I see it now has the necessary target for _math.o. That must have been one of the six updated files.
Is there some deficiency in a plain hg update command which suggests I should always use the more complex command you suggested? It's not a huge deal typing-wise, as I use a shell script to rebuild my world, doing the necessary work to update and build each branch.
Sounds like you had an unexpected patch to Makefile.pre.in (and 5 other files) which broke things. Plain `hg update` will try to keep any changes in your working directory intact, whereas `hg update -C` blows away any changes to tracked files.

On Thu, 20 Oct 2016 at 04:48 Skip Montanaro skip.montanaro@gmail.com wrote:
I've recently run into a problem building the math and cmath modules for 2.7. (I don't rebuild very often, so this problem might have been around for awhile.) My hg repos look like this:
My cpython repo pulls from https://hg.python.org/cpython
My 2.7 repo (and other non-tip repos) pulls from my cpython repo
I think this setup was recommended way back in the day when hg was new to the Python toolchain to avoid unnecessary network bandwidth.
So, if I execute
hg pull hg update
in first cpython, then 2.7 repos I should be up-to-date, correct?
Nope, you need to execute the same steps in your 2.7 checkout if you're keeping it in a separate directory from your cpython repo that you're referring to (you can also use `hg pull -u` to do the two steps above in a single command).

On Fri, Oct 21, 2016 at 1:12 PM, Brett Cannon brett@python.org wrote:
in first cpython, then 2.7 repos I should be up-to-date, correct?
Nope, you need to execute the same steps in your 2.7 checkout
"repos" == "checkout" in my message.
So the hg up -C solved my problem, but I'm still a bit confused (nothing new, in addition to which I only use hg for my Python repositories)... Why didn't a plain "hg up" tell me it couldn't update some files because of changes? Or, like git (I think), attempt to incorporate the upstream changes, then leave conflict markers if that failed?
Skip

On 10/21/2016 2:12 PM, Brett Cannon wrote:
On Thu, 20 Oct 2016 at 04:48 Skip Montanaro <skip.montanaro@gmail.com mailto:skip.montanaro@gmail.com> wrote:
I've recently run into a problem building the math and cmath modules for 2.7. (I don't rebuild very often, so this problem might have been around for awhile.) My hg repos look like this: * My cpython repo pulls from https://hg.python.org/cpython * My 2.7 repo (and other non-tip repos) pulls from my cpython repo I think this setup was recommended way back in the day when hg was new to the Python toolchain to avoid unnecessary network bandwidth. So, if I execute hg pull hg update in first cpython, then 2.7 repos I should be up-to-date, correct?
Nope, you need to execute the same steps in your 2.7 checkout if you're keeping it in a separate directory from your cpython repo that you're referring to
If the 2.7 repository shares the default repository, as described in the devguide, then only update is needed. This has worked for me for at least two years.
participants (5)
-
Brett Cannon
-
Skip Montanaro
-
Terry Reedy
-
Victor Stinner
-
Zachary Ware