Opened 5 years ago

Closed 5 years ago

#58163 closed defect (fixed)

muniversal-1.0: symlinked worksrcpath break correct operation (only last arch built and installed)

Reported by: Ionic (Mihai Moldovan) Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), ryandesign (Ryan Carsten Schmidt), mojca (Mojca Miklavec), slewsys (Andrew L. Moore)
Port:

Description

If worksrcpath is really a symlink to another directory, muniversal 1.0 copies the symlink instead of the referencing directory tree. Further operations are all faulty.

One example of this happening is boehmgc:

lrwxr-xr-x   1 macports   19 Mar  5 04:02 bdwgc-8.0.2 -> ivmai-bdwgc-88a0d3d
lrwxr-xr-x   1 macports   19 Mar  5 04:03 bdwgc-8.0.2-i386 -> ivmai-bdwgc-88a0d3d
lrwxr-xr-x   1 macports   19 Mar  5 04:02 bdwgc-8.0.2-x86_64 -> ivmai-bdwgc-88a0d3d
drwxr-xr-x   3 root      102 Mar  5 04:04 destroot
drwxr-xr-x   7 root      238 Mar  5 04:04 destroot-i386
drwxr-xr-x   7 root      238 Mar  5 04:04 destroot-intel
drwxr-xr-x   2 root       68 Mar  5 04:04 destroot-powerpc
drwxr-xr-x   7 root      238 Mar  5 04:04 destroot-x86_64
drwxr-xr-x 147 macports 4.9K Mar  5 04:27 ivmai-bdwgc-88a0d3d

I have no idea how many other ports are affected by this issue.

CCing Marcus and Ryan because this PG seems to be pretty important to them.

Working on a patch right now.

Attachments (1)

muniversal.patch (2.4 KB) - added by Ionic (Mihai Moldovan) 5 years ago.
Updated to include a basic loop detection mechanism. Actually just added a depth limit of 50 iterations.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Ionic (Mihai Moldovan)

Cc: mojca added

Joshua pointed out that this behavior is relatively new as of 7921b2e05e9a4c9cda6efedee496affb305dcc07/macports-base.

git grep -E 'copy \$\{?worksrc' revealed a few other ports that might behave erratic after this change: LanguageTool, OmegaT, sphinx4, asdf-binary-locations, autobook, poco, yarn, zinc, infobot, android-platform-tools, apache-solr3, apache-solr4, derby-server, dualist, glassfishv3, launch4j, mahout, microemu, QiII, dart-sdk, fsharp, kotlin, mozart-doc, pypy-bootstrap, scala2.10, scala2.11, scala2.12, scala2.7, scala2.8, scala2.9, amavisd-new, spambnc, ProofGeneral, atlas, live555, mythweb.27, mythweb.28, xpn, pear-TCPDF, php5-simpletest, py-gpilab-core, dcw-gmt, gshhg-gmt, rangs-gshhs-ncarg, sqlmap, extractopinion, naturaldocs, unidic-mecab, ZendFramework2, drush, phppgadmin, tiki, websvn, wordpress, BWidget, gtk-osx-tiger

I may have missed a few.

All these ports copy ${worksrcpath} directly to some other location and will break in unexpected ways if it is a symlink. Ports that copy subcontents of ${worksrcpath} are not affected, though, which is the majority of ports.

Last edited 5 years ago by Ionic (Mihai Moldovan) (previous) (diff)

comment:2 Changed 5 years ago by Ionic (Mihai Moldovan)

Cc: slewsys added

Adding original author of the base patch.

Changed 5 years ago by Ionic (Mihai Moldovan)

Attachment: muniversal.patch added

Updated to include a basic loop detection mechanism. Actually just added a depth limit of 50 iterations.

comment:3 Changed 5 years ago by slewsys (Andrew L. Moore)

Is it possible to just replace

copy ${worksrcpath} ${worksrcpath}-${arch}

with

exec cp -HR ${worksrcpath} ${worksrcpath}-${arch}

comment:4 Changed 5 years ago by Ionic (Mihai Moldovan)

Mh, theoretically yes, but it always feels weird to execute system commands (and depend upon these) if native functionality exists.

Using that would be an easy replacement for the (maybe/theoretically) broken ports I mentioned, though.

comment:5 Changed 5 years ago by Mihai Moldovan <ionic@…>

Resolution: fixed
Status: assignedclosed

In b9564a04c393d6187025d461fa3a4251781f39ad/macports-ports (master):

muniversal-1.0: if worksrcpath is a symlink, copy the directory tree referred to instead of the symlink.

Fixes: #58163

Note: See TracTickets for help on using tickets.