Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANED UP PATCH] install_name_tool in OSX Framework builds #168 #241

Closed
wants to merge 6 commits into from

Conversation

gorakhargosh
Copy link

shouldfix: creating a virtualenv from an OSX
Framework build should no longer require XCode to
run successfully.

implementaion: if install_name_tool missing,
download binaries from macosxforge, and install
them to a temp directory

rejected: download and compile .c source.

TODOS:

Possible Test Code:

#!/bin/sh

deactivate # virtualenv on system (Framework) python

# assuming I have XCode or ``install_name_tool`` in path.
python virtualenv.py t_install_name_tool  # creates with no issue
t_install_name_tool/bin/python -c ""

# remove it from path
sudo mv /usr/bin/install_name_tool{,2}

# should create with no issue, using tmpfile
python virtualenv.py t_tmp_install_name_tool
t_tmp_install_name_tool/bin/python -c ""

# clean up
sudo mv /usr/bin/install_name_tool{2,}
command rm -rf t_{,tmp_}install_name_tool

The original patch was cleaned up, tested against
at Python 2.5, 2.6, 2.7, 3.2, and verified to work.

Signed-off-by: Yesudeep Mangalapilly [email protected]

gregglind and others added 2 commits March 13, 2012 20:14
shouldfix:  creating a virtualenv from an OSX
Framework build should no longer require XCode to
run successfully.

implementaion:  if ``install_name_tool`` missing,
download binaries from macosxforge, and install
them to a temp directory

rejected:  download and compile .c source.

TODOS:

*   review for python2/3 issues
*   cleanup of tempfiles?  Assume the system will do it?
*   test for robustness
*   review implications of not having XCode for packages, if any
*   integrate with pypa#54 pull or its descendents.  (trivial)

Possible Test Code:

    #!/bin/sh

    deactivate # virtualenv on system (Framework) python

    # assuming I have XCode or ``install_name_tool`` in path.
    python virtualenv.py t_install_name_tool  # creates with no issue
    t_install_name_tool/bin/python -c ""

    # remove it from path
    sudo mv /usr/bin/install_name_tool{,2}

    # should create with no issue, using tmpfile
    python virtualenv.py t_tmp_install_name_tool
    t_tmp_install_name_tool/bin/python -c ""

    # clean up
    sudo mv /usr/bin/install_name_tool{2,}
    command rm -rf t_{,tmp_}install_name_tool

The original patch was cleaned up, tested against
at Python 2.5, 2.6, 2.7, 3.2, and verified to work.

Signed-off-by: Yesudeep Mangalapilly <[email protected]>
@gregglind
Copy link

Thank you for doing more work on this everyone!

@gorakhargosh
Copy link
Author

This is currently a blocker on some of our systems.
Can someone tell us whether the patch is acceptable
or if it needs any further enhancements?

# TODO: Where should this get 'cleaned up', if it's a temp
# install? Perhaps this should return a tuple of (path, tempdir)?

import platform
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use inline imports.

@jezdez
Copy link
Member

jezdez commented Mar 29, 2012

@gorakhargosh I've commented inline a bit. Thanks for your work so far, but this needs a bit more work.

@gorakhargosh
Copy link
Author

@jezdez I'll try to get it cleaned up.

@pwaller
Copy link

pwaller commented Apr 11, 2012

I don't have a mac, but just tried this on a friends computer, so I can't debug it. The behaviour was different - it froze for a while before failing. It's a bootstrap script, so line numbers may differ. Here is the output:

New python executable in env/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool
Installing distribute........
 Complete output from command /Applications/mcviz/env/bin/python -c "#!python
\"\"\"Bootstra... main(sys.argv[1:])
" --always-copy -U distribute:
 Traceback (most recent call last):
 File "<string>", line 22, in <module>
 File "/Applications/mcviz/env/lib/python2.6/distutils/__init__.py", line 16, in <module>
   exec(open(os.path.join(distutils_path, '__init__.py')).read())
IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/__init__.py'
----------------------------------------
...Installing distribute...done.
Traceback (most recent call last):
 File "./virtualenv.py", line 2364, in <module>
   main()
 File "./virtualenv.py", line 942, in main
   never_download=options.never_download)
 File "./virtualenv.py", line 1051, in create_environment
   search_dirs=search_dirs, never_download=never_download)
 File "./virtualenv.py", line 603, in install_distribute
   search_dirs=search_dirs, never_download=never_download)
 File "./virtualenv.py", line 572, in _install_req
   cwd=cwd)
 File "./virtualenv.py", line 1020, in call_subprocess
   % (cmd_desc, proc.returncode))
OSError: Command /Applications/mcviz/env/bin/python -c "#!python
\"\"\"Bootstra... main(sys.argv[1:])
" --always-copy -U distribute failed with error code 1

@jezdez
Copy link
Member

jezdez commented Jun 22, 2012

Many thanks for your efforts, we're happy to say we've now gone with a full Python implementation of install_name_tool added in #289.

@jezdez jezdez closed this Jun 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants