[issue42514] Relocatable framework for macOS

2022-03-14 Thread Shakeeb Alireza


Shakeeb Alireza  added the comment:

I have struggled with this exact issue in my py-js project 
(https://github.com/shakfu/py-js) which embeds a python3 interpreter in a 
max/msp plugin or in a relocatable folder (package) structure. For the latter 
case, Greg's solution, which is based on standard methods, has been absolutely 
crucial. Thank you!

I have found that trying to do the same with a python distro built with 
--enable-shared is basically impossible because in this case sys.prefix is 
hardcoded and it dos not respond (like the framework structure) to the same 
@rpath methods used by Greg.

It would be great for those who embed python for a fun or profit to have these 
issues addressed across all of the standard build structures.

--
nosy: +shakfu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-10-21 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-07-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I guess Ned and I are the only core devs that would be vaguely interested in 
working on this.  I have no active plans to work on this.

Having a relocatable framework would be nice, but doing this in a way that 
maintains all functionality, esp. w.r.t. the Python executable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-06-30 Thread macmule


macmule  added the comment:

Just wondering if any movement on this etc.

This is something I've been struggling with too, and have attempted to overcome 
via Greg's project to no avail.

--
nosy: +macmule

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-06-23 Thread Greg Neagle


Greg Neagle  added the comment:

While checking this issue hoping there might be updates, I realized that I 
didn't share a link to the script I use to convert python.org's Python 
framework into one that can be relocated.

It's here: https://github.com/gregneagle/relocatable-python

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-06-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-06-03 Thread Nathaniel Smith


Change by Nathaniel Smith :


--
nosy: +njs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2021-01-21 Thread Tom Goddard


Change by Tom Goddard :


--
nosy: +tomgoddard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2020-11-30 Thread Greg Neagle


Greg Neagle  added the comment:

A Python.app you could drop somewhere convenient would by definition need a 
relocatable Python.framework within. :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2020-11-30 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

There's also macholib (which is used by py2app for rewriting mach-o headers). 

Note that resigning for arm64 is possible using the following command:

$ codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f 
.

This was mentioned in the Xcode 12 release notes.

BTW. My hobby horse w.r.t. a relocatable Python installation is to turn the 
current framework inside out: have a "Python.app" or "Python 3.10.app" that 
contains the framework and presents a GUI when double clicked (probably IDLE 
with some additional menu items). This would simplify the installation 
experience (no installer, just drop Python.app somewhere convenient).   

I have no idea if I'll ever get around to implementing this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42514] Relocatable framework for macOS

2020-11-30 Thread Greg Neagle


New submission from Greg Neagle :

The current Python.framework installed by the macOS packages is hard-coded to 
/Library/Frameworks/Python.framework and breaks if renamed or moved.

A relocatable framework would allow users/admins/developers to install a 
specific framework to an alternate location, or include it inside an 
application bundle, or access it from a mounted disk image.

Currently it is possible to use `otool` and `install_name_tool` to convert the 
current framework into one that can be relocated, but doing so breaks any code 
signing. With Apple Silicon, all executable code and libraries must be code 
signed, so the effort of relocating the Python framework becomes that more 
difficult.

Ideally the official macOS framework would be built as relocatable, eliminating 
the need to modify it and re-sign it to use it anywhere other than  
/Library/Frameworks/Python.framework.

--
components: macOS
messages: 382171
nosy: gregneagle, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Relocatable framework for macOS
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com