Opened 11 years ago

Closed 10 years ago

#25174 closed defect (fixed)

relocation should be disabled in pkgs

Reported by: tonymaher@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 1.8.2
Keywords: snowleopard Cc: emanuel@…, nerdling (Jeremy Lavergne), layer@…, sk-public@…
Port: python26

Description

Created a python2.6 mdmg on Snow Leopard but when trying to install on another Snow Leopard machine get the following install error

...
...
python26-2.6.5.mpkg/Contents/Packages/zlib-1.2.5.pkg/Contents/Archive.pax.gz (destination=/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/PKInstallSandbox-tmp/Root, uid=0)
installer[1345]: PackageKit: Extracting /Volumes/python26-2.6.5-1/python26-2.6.5.mpkg/Contents/Packages/python26-2.6.5.pkg/Contents/Archive.pax.gz (destination=/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/PKInstallSandbox-tmp/Root, uid=0)
installer[1345]: Applications/MacPorts/Python 2.6/Python Launcher.app relocated to System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python Launcher.app
installer[1345]: PackageKit: Install Failed: (null)
Error Domain=NSCocoaErrorDomain Code=512 UserInfo=0x1004583c0 "“Python” couldn’t be moved to “Frameworks”." {
    NSDestinationFilePath = "/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/PKInstallSandbox-tmp/Root/System/Library/Frameworks/Python.framework";
    NSFilePath = "/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/PKInstallSandbox-tmp/Root/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app";
    NSUserStringVariant = Move;
}
installer[1345]: install:didFailWithError:Error Domain=NSCocoaErrorDomain Code=512 UserInfo=0x1004583c0 "“Python” couldn’t be moved to “Frameworks”."
installer[1345]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
installer: Package name is python26
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)

Change History (17)

comment:1 Changed 11 years ago by jmroot (Joshua Root)

Cc: mcalhoun@… added
Owner: changed from macports-tickets@… to blb@…
Port: python26 added

comment:2 Changed 11 years ago by blb@…

installer[1345]: Applications/MacPorts/Python 2.6/Python Launcher.app relocated to System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python Launcher.app

It definitely shouldn't be messing with anything in /System/Library... at all. I think this may have something to do with the IFPkgPathMappings key added to python26's pkg (in the Info.plist) which from what I can tell is done automatically by PackageMaker.

So far no googling has turned up any clues as to how to avoid this.

comment:4 Changed 11 years ago by blb@…

Cc: mcalhoun@… removed
Owner: changed from blb@… to mcalhoun@…

comment:5 Changed 11 years ago by emanuel@…

Cc: emanuel@… added

Cc Me!

comment:6 Changed 10 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

Cc Me!

comment:7 Changed 10 years ago by nerdling (Jeremy Lavergne)

Is this something we can handle in a post-pkg phase (is there such a thing)?

comment:8 Changed 10 years ago by nerdling (Jeremy Lavergne)

The key to avoiding the issue is to delete the TokenDefinitions file in the packaging phase, before it goes to the disk image:

sudo port mpkg pspp-devel
sudo find /opt/local/var/macports/build -type f -name TokenDefintions.plist -delete
sudo port mdmg pspp-devel

comment:9 in reply to:  8 ; Changed 10 years ago by tonymaher@…

Replying to snc@…:

The key to avoiding the issue is to delete the TokenDefinitions file in the packaging phase, before it goes to the disk image:

Thanks - I will try this once I get back to work next week.

cheers
--
tonym

comment:10 Changed 10 years ago by layer@…

Cc: layer@… added

Cc Me!

comment:11 in reply to:  9 Changed 10 years ago by layer@…

This is a serious bug. Any chance of getting it fixed soon? Thanks.

comment:12 in reply to:  8 Changed 10 years ago by tonymaher@…

Replying to snc@…:

The key to avoiding the issue is to delete the TokenDefinitions file in the packaging phase, before it goes to the disk image:

sudo port mpkg pspp-devel
sudo find /opt/local/var/macports/build -type f -name TokenDefintions.plist -delete
sudo port mdmg pspp-devel

Sorry got distracted and forgot about this. Just tried it and it appeared to work fine. I do not have a spare test machine so I installed the package from the dmg file on the same machine that built the dmg file so it was overwriting already installed packages so not 100% sure it has solved all the problems.

comment:13 Changed 10 years ago by nerdling (Jeremy Lavergne)

You might try temporarily moving your /opt folder to something else, installing and testing, delete the new /opt, and then restoring the old /opt directory.

From the DMGs I've published this seems to be what is necessary to make it work. I've also not come across an instance where removing the file causes issues. Could we have the removal of the files done automatically in the [m]pkg phase?

comment:14 Changed 10 years ago by nerdling (Jeremy Lavergne)

Sorry about being ambiguous; that second paragraph was referencing the TokenDefinitions.plist file.

comment:15 in reply to:  13 Changed 10 years ago by tonymaher@…

Replying to snc@…:

You might try temporarily moving your /opt folder to something else, installing and testing, delete the new /opt, and then restoring the old /opt directory.

From the DMGs I've published this seems to be what is necessary to make it work. I've also not come across an instance where removing the file causes issues. Could we have the removal of the files done automatically in the [m]pkg phase?

I got a colleague who does not have any macports installed to test the dmg file. The installation went fine but

cd /opt/local/bin
./python2.6
python2.6: execv: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or directory

Having a little look around

ls /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/
Info.plist
ls -lrt /opt/local/Library/Frameworks/Python.framework/Versions/2.6
total 4144
drwxr-xr-x   3 root  wheel      102 Mar  7 14:00 share
-rwxr-xr-x   1 root  wheel  2117472 Mar  7 14:00 Python
drwxr-xr-x   3 root  wheel      102 Mar  7 14:00 lib
drwxr-xr-x   3 root  wheel      102 Mar  7 14:00 include
lrwxr-xr-x   1 root  wheel       17 Mar  7 15:44 Headers -> include/python2.6
drwxr-xr-x  15 root  wheel      510 Mar  7 15:44 bin
drwxr-xr-x   3 root  wheel      102 Mar  7 15:44 Resources

On my build machine with MacPorts

ls -lrt /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/
total 24
-rwxr-xr-x  1 root  wheel  8576  7 Mar 14:00 Python*

So that it does not appear to be the full solution.

comment:16 Changed 10 years ago by sk-public@…

Cc: sk-public@… added

Cc Me!

comment:17 Changed 10 years ago by jmroot (Joshua Root)

Component: portsbase
Keywords: snowleopard added
Milestone: MacPorts 2.0.0
Resolution: fixed
Status: newclosed
Summary: Python2.6 mpkg fails to installrelocation should be disabled in pkgs
Note: See TracTickets for help on using tickets.