On Thu, Aug 13, 2015 at 11:48 AM, Abdó Roig-Maranges <[email protected]> wrote: > > Hi, > > I'm attempting to create a new msys2 tree from within msys with > > pacman --root /tmp/newmsys/msys64 -Sy base > > as it is done in the installer scripts. I just want to add some extra > packages, > for internal use on our project. > > However, the execution of the ".install" scripts of some packages fail. I've > straced it, and I think it has to do with msys path translation messing up the > chroot. Here is a filtered version of the huge strace: > > $ strace pacman -S grep --root 'D:\msys64\tmp\newmsys\msys64' | grep 'chroot' > warning: grep-2.21-1 is up to date -- reinstalling > :: Proceed with installation? [Y/n] > 101 580580682 [main] pacman 3292 chroot: 0 = chroot(/tmp/newmsys/msys64/) > 145 420375 [main] bash 4308 mount_info::conv_to_win32_path: attempt to > access outside of chroot '/tmp/newmsys/msys64 - D:\msys64\tmp\newmsys\msys64' > error: command (/usr/bin/bash /usr/bin/bash -c . /tmp/alpm_gp8OmG/.INSTALL; > post_upgrade 2.21-1 2.21-1 ) failed to execute correctly > > The problem seems to be that both paths: /tmp/newmsys/msys64, and > D:\msys64\tmp\newmsys\msys64 point to the same directory, but someone fails to > recognize it.
I think this might be because I reorder the mount paths so that, generally speaking, if there's 2 mounts to the same path the shortest one gets selected always. I think the lookup code in conv_to_win32_path needs to be taught to ignore paths outside of the chroot instead of reporting such a lookup as an access error. You need to edit MSYS-packages/msys2-runtime/PKGBUILD and enable options= of '!strip' and 'debug', then rebuild it, install it, exit your shells, then write a simple test program that calls chroot and then attempts to do such an access .. that should be enough to get you started. You can debug using Qt Creator too, if you use the right debugger / kit. Thanks, Ray. > > I'm willing to write a patch to fix this, but I'd appreciate some pointers on > where to look, since I'm not really familiar with msys internals. > > Thanks! > > Abdó Roig. > > ------------------------------------------------------------------------------ > _______________________________________________ > Msys2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/msys2-users ------------------------------------------------------------------------------ _______________________________________________ Msys2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/msys2-users
