Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

python-2.7.4 fails to patch with 000-homebrew.diff #19203

Closed
jabbas opened this issue Apr 15, 2013 · 13 comments
Closed

python-2.7.4 fails to patch with 000-homebrew.diff #19203

jabbas opened this issue Apr 15, 2013 · 13 comments

Comments

@jabbas
Copy link
Contributor

jabbas commented Apr 15, 2013

It fails for around one or two weeks...

==> Downloading http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/python-2.7.4.tar.bz2
tar xf /Library/Caches/Homebrew/python-2.7.4.tar.bz2
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.9.4 (Ruby 1.8.7-358; Mac OS X 10.8.3) https://raw.github.com/gist/3415636/2365dea8dc5415daa0148e98c394345e1191e4aa/pythondtrace-patch.diff -o 000-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file Doc/library/debug.rst
patching file Doc/library/dtrace.rst
patching file Include/code.h
patching file Include/pydtrace.d
patching file Include/pydtrace_offsets.c
patching file Include/pydtrace_offsets.sh
patching file Lib/test/dtrace_sample.py
patching file Lib/test/test_dtrace.py
patching file Makefile.pre.in
Hunk #1 succeeded at 51 (offset 4 lines).
Hunk #2 succeeded at 567 (offset 41 lines).
Hunk #3 succeeded at 575 (offset 41 lines).
Hunk #4 succeeded at 667 (offset 49 lines).
Hunk #5 succeeded at 1310 (offset 70 lines).
Hunk #6 succeeded at 1340 (offset 70 lines).
patching file Modules/dtracemodule.c
patching file Modules/gcmodule.c
Hunk #2 succeeded at 873 (offset 51 lines).
Hunk #3 succeeded at 1038 (offset 54 lines).
patching file Objects/classobject.c
Hunk #2 succeeded at 557 (offset 10 lines).
Hunk #3 succeeded at 622 (offset 10 lines).
Hunk #4 succeeded at 676 (offset 10 lines).
Hunk #5 succeeded at 758 (offset 10 lines).
patching file Objects/codeobject.c
patching file Objects/typeobject.c
Hunk #2 succeeded at 754 (offset 4 lines).
Hunk #3 succeeded at 798 (offset 4 lines).
Hunk #4 succeeded at 935 with fuzz 1 (offset 9 lines).
patching file Python/ceval.c
patching file Python/sysmodule.c
patching file configure
Hunk #1 succeeded at 639 (offset 28 lines).
Hunk #2 succeeded at 802 (offset 43 lines).
Hunk #3 succeeded at 1480 (offset 45 lines).
Hunk #4 FAILED at 2652.
Hunk #5 FAILED at 3584.
Hunk #6 FAILED at 3699.
Hunk #7 FAILED at 3742.
Hunk #8 FAILED at 3801.
Hunk #9 FAILED at 3853.
Hunk #10 FAILED at 4396.
Hunk #11 FAILED at 6749.
Hunk #12 FAILED at 6782.
Hunk #13 FAILED at 6815.
Hunk #14 FAILED at 6848.
Hunk #15 FAILED at 6881.
Hunk #16 FAILED at 6914.
Hunk #17 FAILED at 6947.
Hunk #18 FAILED at 6980.
Hunk #19 FAILED at 7013.
Hunk #20 FAILED at 7073.
Hunk #21 FAILED at 7134.
Hunk #22 FAILED at 7195.
Hunk #23 FAILED at 7243.
Hunk #24 FAILED at 7284.
Hunk #25 FAILED at 7346.
Hunk #26 FAILED at 7417.
Hunk #27 succeeded at 10014 (offset 559 lines).
Hunk #28 FAILED at 13031.
Hunk #29 FAILED at 13083.
Hunk #30 FAILED at 13202.
Hunk #31 FAILED at 13468.
Hunk #32 FAILED at 15268.
Hunk #33 FAILED at 15583.
Hunk #34 FAILED at 15611.
Hunk #35 FAILED at 15638.
31 out of 35 hunks FAILED -- saving rejects to file configure.rej
can't find file to patch at input line 2055
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -r 70274d53c1dd -r 56ac083c60dc configure.in
|--- a/configure.in Mon Apr 09 19:04:04 2012 -0400
|+++ b/configure.in Tue Jul 03 03:19:10 2012 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
patching file pyconfig.h.in
Hunk #1 succeeded at 1095 (offset 12 lines).
patching file setup.py
Hunk #1 succeeded at 676 (offset 78 lines).
ln -s ../Cellar/python/2.7.3/bin/smtpd2.py smtpd2.py
ln -s ../Cellar/python/2.7.3/bin/smtpd2.7.py smtpd2.7.py
ln -s ../Cellar/python/2.7.3/bin/smtpd.py smtpd.py
ln -s ../Cellar/python/2.7.3/bin/pythonw2.7 pythonw2.7
ln -s ../Cellar/python/2.7.3/bin/pythonw2 pythonw2
ln -s ../Cellar/python/2.7.3/bin/pythonw pythonw
ln -s ../Cellar/python/2.7.3/bin/python2.7-config python2.7-config
ln -s ../Cellar/python/2.7.3/bin/python2.7 python2.7
ln -s ../Cellar/python/2.7.3/bin/python2-config python2-config
ln -s ../Cellar/python/2.7.3/bin/python2 python2
ln -s ../Cellar/python/2.7.3/bin/python-config python-config
ln -s ../Cellar/python/2.7.3/bin/python python
ln -s ../Cellar/python/2.7.3/bin/pydoc2.7 pydoc2.7
ln -s ../Cellar/python/2.7.3/bin/pydoc2 pydoc2
ln -s ../Cellar/python/2.7.3/bin/pydoc pydoc
ln -s ../Cellar/python/2.7.3/bin/pip-2.7 pip-2.7
ln -s ../Cellar/python/2.7.3/bin/pip pip
ln -s ../Cellar/python/2.7.3/bin/idle2.7 idle2.7
ln -s ../Cellar/python/2.7.3/bin/idle2 idle2
ln -s ../Cellar/python/2.7.3/bin/idle idle
ln -s ../Cellar/python/2.7.3/bin/easy_install-2.7 easy_install-2.7
ln -s ../Cellar/python/2.7.3/bin/easy_install easy_install
ln -s ../Cellar/python/2.7.3/bin/2to3-2.7 2to3-2.7
ln -s ../Cellar/python/2.7.3/bin/2to3-2 2to3-2
ln -s ../Cellar/python/2.7.3/bin/2to3 2to3
ln -s ../Cellar/python/2.7.3/Frameworks/Python.framework Python.framework
ln -s ../../Cellar/python/2.7.3/share/python/Extras Extras
ln -s ../../../Cellar/python/2.7.3/share/man/man1/python2.7.1 python2.7.1
ln -s ../../Cellar/python/2.7.3 python
ln -s ../Cellar/python/2.7.3 python
Error: Failure while executing: /usr/bin/patch -f -p1 -i 000-homebrew.diff
@adamv
Copy link
Contributor

adamv commented Apr 15, 2013

Does brew doctor have anything to say?

@paxswill
Copy link
Contributor

I had this exact same issue, but solved it by updating my CLT, unlinking python (brew unlink python) and then installing.

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

brew doctor says nothing, but i can't imagine it can fix the problem with applying patch...

~ $ brew doctor
Set variables:
    DYLD_LIBRARY_PATH
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
    /usr/local/lib/libusb-1.0.0.dylib

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

Reinstalling CLT didn't fix the problem too...

It looks like diff file does not apply cleanly onto source tree untared from Python-2.7.4.tar.bz2.

Downloading Python-2.7.4.tar.bz2 by hand, unpacking and trying to apply the diff fails, so i think that we can assume that this dtrace patch is bad...

See:

jabbas@ /tmp $ wget www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.bz2
--2013-04-17 10:21:05--  http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.bz2
Resolving www.python.org (www.python.org)... 82.94.164.162, 2001:888:2000:d::a2
Connecting to www.python.org (www.python.org)|82.94.164.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12146770 (12M) [application/x-bzip2]
Saving to: ‘Python-2.7.4.tar.bz2’
100%[====================================================================================================================>] 12,146,770  3.66MB/s   in 3.3s
2013-04-17 10:21:08 (3.50 MB/s) - ‘Python-2.7.4.tar.bz2’ saved [12146770/12146770]
jabbas@ /tmp $ tar xjf Python-2.7.4.tar.bz2
jabbas@ /tmp $ cd Python-2.7.4/
jabbas@ /tmp/Python-2.7.4 $ curl 'https://raw.github.com/gist/3415636/2365dea8dc5415daa0148e98c394345e1191e4aa/pythondtrace-patch.diff' | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 65479  100 65479    0     0  68382      0 --:--:-- --:--:-- --:--:--  127k
patching file Doc/library/debug.rst
patching file Doc/library/dtrace.rst
patching file Include/code.h
patching file Include/pydtrace.d
patching file Include/pydtrace_offsets.c
patching file Include/pydtrace_offsets.sh
patching file Lib/test/dtrace_sample.py
patching file Lib/test/test_dtrace.py
patching file Makefile.pre.in
Hunk #1 succeeded at 51 (offset 4 lines).
Hunk #2 succeeded at 567 (offset 41 lines).
Hunk #3 succeeded at 575 (offset 41 lines).
Hunk #4 succeeded at 667 (offset 49 lines).
Hunk #5 succeeded at 1310 (offset 70 lines).
Hunk #6 succeeded at 1340 (offset 70 lines).
patching file Modules/dtracemodule.c
patching file Modules/gcmodule.c
Hunk #2 succeeded at 873 (offset 51 lines).
Hunk #3 succeeded at 1038 (offset 54 lines).
patching file Objects/classobject.c
Hunk #2 succeeded at 557 (offset 10 lines).
Hunk #3 succeeded at 622 (offset 10 lines).
Hunk #4 succeeded at 676 (offset 10 lines).
Hunk #5 succeeded at 758 (offset 10 lines).
patching file Objects/codeobject.c
patching file Objects/typeobject.c
Hunk #2 succeeded at 754 (offset 4 lines).
Hunk #3 succeeded at 798 (offset 4 lines).
Hunk #4 succeeded at 935 with fuzz 1 (offset 9 lines).
patching file Python/ceval.c
patching file Python/sysmodule.c
patching file configure
Hunk #1 succeeded at 639 (offset 28 lines).
Hunk #2 succeeded at 802 (offset 43 lines).
Hunk #3 succeeded at 1480 (offset 45 lines).
Hunk #4 FAILED at 2652.
Hunk #5 FAILED at 3584.
Hunk #6 FAILED at 3699.
Hunk #7 FAILED at 3742.
Hunk #8 FAILED at 3801.
Hunk #9 FAILED at 3853.
Hunk #10 FAILED at 4396.
Hunk #11 FAILED at 6749.
Hunk #12 FAILED at 6782.
Hunk #13 FAILED at 6815.
Hunk #14 FAILED at 6848.
Hunk #15 FAILED at 6881.
Hunk #16 FAILED at 6914.
Hunk #17 FAILED at 6947.
Hunk #18 FAILED at 6980.
Hunk #19 FAILED at 7013.
Hunk #20 FAILED at 7073.
Hunk #21 FAILED at 7134.
Hunk #22 FAILED at 7195.
Hunk #23 FAILED at 7243.
Hunk #24 FAILED at 7284.
Hunk #25 FAILED at 7346.
Hunk #26 FAILED at 7417.
Hunk #27 succeeded at 10014 (offset 559 lines).
Hunk #28 FAILED at 13031.
Hunk #29 FAILED at 13083.
Hunk #30 FAILED at 13202.
Hunk #31 FAILED at 13468.
Hunk #32 FAILED at 15268.
Hunk #33 FAILED at 15583.
Hunk #34 FAILED at 15611.
Hunk #35 FAILED at 15638.
31 out of 35 hunks FAILED -- saving rejects to file configure.rej
can't find file to patch at input line 2055
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -r 70274d53c1dd -r 56ac083c60dc configure.in
|--- a/configure.in Mon Apr 09 19:04:04 2012 -0400
|+++ b/configure.in Tue Jul 03 03:19:10 2012 +0200
--------------------------
File to patch: ^C
jabbas@ /tmp/Python-2.7.4 $

@paxswill
Copy link
Contributor

@jabbas, did you originally install python 2.7.3 with the DTrace option? That's the only extra option I had used with Python 2.7.3, and it's currently unsupported with 2.7.4. To confirm that this is the issue, I removed my new build of 2.7.4 and tried re-upgrading from 2.7.3 (brew rm python && brew link python && brew upgrade python), and it failed again, but a fresh rebuild of 2.7.4 worked fine.

@paxswill
Copy link
Contributor

Ah, missed that comment. Yeah, the DTrace patch doesn't work with 2.7.4 (@fbf7be913)

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

So, how about disabling it in the formulae? there is no flag for that right now.

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

Ok.. sorry, i'm still pretty new to the homebrew, so i'm probably missing something...

I briefly searched python.rb formula and didn't find any references to dtrace or curl, so how this happens that it want to patch it?

@paxswill
Copy link
Contributor

The problem is line 37. Even though there's no declared option --with-dtrace in the current formula, during an upgrade the options used for the old build (saved in the INSTALL_RECEIPT.json file in the keg) are passed to the new build. Because line 37 just checks if the DTrace option is present, it still applies the patch. I just uncommented that line like so: paxswill/homebrew@a582851. That fix feels hacky though, and I'm going to try seeing if it's an easy-ish fix for the patch.

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

Ok, found it. Here's a patch https://gist.github.com/jabbas/5402809

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

I came to homebrew from the gentoo world, there was some kind of conditional patch applying. Generally something like this:

version <= 5 ? apply patch <filename-one.patch>
version == 10 ? apply patch <filename-two.patch>

Same thing can be applied for other things like configure arguments, CFLAGS/CXXFLAGS etc... So if there is no such thing in homebrew maybe it will be an good idea to implement it?

@paxswill
Copy link
Contributor

Homebrew normally deals with just one version at a time (the latest), but that is certainly possible within Ruby.

I cleaned up the patch and have submitted a pull request (#19257), so this should be fixed properly soon.

@jabbas
Copy link
Contributor Author

jabbas commented Apr 17, 2013

Thanks!

2013/4/17 Will Ross [email protected]

Homebrew normally deals with just one version at a time (the latest), but
that is certainly possible within Ruby.

I cleaned up the patch and have submitted a pull request (#19257#19257),
so this should be fixed properly soon.


Reply to this email directly or view it on GitHubhttps://github.com//issues/19203#issuecomment-16496027
.

Grzegorz Dzięgielewski
http://jabbas.eu

@adamv adamv closed this as completed in 1747136 Apr 27, 2013
handyman5 pushed a commit to handyman5/homebrew that referenced this issue Oct 7, 2013
The old patch had a lot of whitespace differences, and they were failing with
Python 2.7.4. In addition to removing the whitespace differences, configure.in
was removed from the patch, as configure is being patched already.

Closes Homebrew#19257.
Closes Homebrew#19203.
Closes Homebrew#19400.

Signed-off-by: Adam Vandenberg <[email protected]>
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants