Opened 10 years ago

Closed 10 years ago

#42987 closed defect (fixed)

python34 @3.4.0_1: activation fails if another python selected

Reported by: mndavidoff (Monte Davidoff) Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: michaelld (Michael Dickens), petrrr, skymoo (Adam Mercer)
Port: python34

Description

Installing python34 fails during activation if I have previously selected another python port as the default.

$ sudo port select --set python none
Selecting 'none' for 'python' succeeded. 'none' is now active.
$ ls -l /opt/local/bin/2to3
ls: /opt/local/bin/2to3: No such file or directory
$ sudo port select --set python python27
Selecting 'python27' for 'python' succeeded. 'python27' is now active.
$ ls -l /opt/local/bin/2to3
lrwxr-xr-x  1 root  admin  23 Mar 22 09:16 /opt/local/bin/2to3 -> /opt/local/bin/2to3-2.7
$ sudo port -vs install python34
...
x ./Applications/MacPorts/Python 3.4/IDLE.app/Contents/Resources/PythonSource.icns
x ./Applications/MacPorts/Python 3.4/IDLE.app/Contents/MacOS/IDLE
x ./Applications/MacPorts/Python 3.4/IDLE.app/Contents/MacOS/Python
Error: org.macports.activate for port python34 returned: Image error: /opt/local/bin/2to3 already exists and does not belong to a registered port.  Unable to activate port python34. Use 'port -f activate python34' to force the activation.
Please see the log file for port python34 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_python34/python34/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port python34 failed

The problem may have been introduced in r118099. The problem did not occur with python34 @3.4.0_0.

Attachments (2)

main.log.gz (27.3 KB) - added by mndavidoff (Monte Davidoff) 10 years ago.
Portfile.diff (746 bytes) - added by mndavidoff (Monte Davidoff) 10 years ago.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by mndavidoff (Monte Davidoff)

Attachment: main.log.gz added

comment:1 Changed 10 years ago by michaelld (Michael Dickens)

Cc: jwa@… removed
Owner: changed from macports-tickets@… to jwa@…

Yes, this issue was introduced in r118099:

% tar jtvf /opt/local/var/macports/software/python34/python34-3.4.0_0+universal.darwin_12.i386-x86_64.tbz2  | grep bin/2to3
lrwxr-xr-x  0 root   admin       0 Mar 17 09:13 ./opt/local/bin/2to3-3.4 -> /opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3-3.4
-rwxr-xr-x  0 root   wheel     150 Mar 17 09:13 ./opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3-3.4

% tar jtvf /opt/local/var/macports/software/python34/python34-3.4.0_1+universal.darwin_12.i386-x86_64.tbz2  | grep bin/2to3
lrwxr-xr-x  0 root   admin       0 Mar 22 10:54 ./opt/local/bin/2to3 -> /opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3
lrwxr-xr-x  0 root   admin       0 Mar 22 10:54 ./opt/local/bin/2to3-3.4 -> /opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3-3.4
lrwxr-xr-x  0 root   wheel       0 Mar 22 10:54 ./opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3 -> 2to3-3.4
-rwxr-xr-x  0 root   wheel     150 Mar 22 10:54 ./opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/2to3-3.4

Looks like a post-destroot to delete those "bin/2to3" symlinks is in order. Or, something like that.

comment:2 Changed 10 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:3 Changed 10 years ago by mndavidoff (Monte Davidoff)

Please see #41549 (r113947), which r118099 reverted.

comment:4 Changed 10 years ago by petrrr

Cc: Peter.Danecek@… added

Cc Me!

comment:5 Changed 10 years ago by michaelld (Michael Dickens)

Still have to rev-bump python34 ...

comment:6 Changed 10 years ago by michaelld (Michael Dickens)

Latest svn trunk still didn't work for me just now, even after uninstalling, cleaning, updating other stuff, etc... same issue.

comment:7 Changed 10 years ago by mndavidoff (Monte Davidoff)

There appears to be a reason we need "frameworkinstall maninstall" instead of "altinstall", so I'm attaching a patch that fixes the problem by removing the versionless symlinks in post-destroot, similar to the python27 Portfile. I don't know if this is the best way to fix the problem.

Changed 10 years ago by mndavidoff (Monte Davidoff)

Attachment: Portfile.diff added

comment:8 in reply to:  6 Changed 10 years ago by petrrr

Replying to michaelld@…:

Latest svn trunk still didn't work for me just now, even after uninstalling, cleaning, updating other stuff, etc... same issue.

I do not see that anything changed which would fix this issue. Apparently r118099 introduces this issue and it is still in place. If you need a quick fix you could execute a sudo port select python none, install python34 and select your preferred python interpreter again. It is not very clean, but solves the problem temporary.

Last edited 10 years ago by petrrr (previous) (diff)

comment:9 Changed 10 years ago by skymoo (Adam Mercer)

Cc: ram@… added

Cc Me!

comment:10 Changed 10 years ago by jyrkiwahlstedt

Resolution: fixed
Status: newclosed

done in r118159

Note: See TracTickets for help on using tickets.