Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#66821 closed defect (fixed)

MacPorts 2.8.1 does not create a symlink to source when worksrcpath is specified

Reported by: essandess (Steve Smith) Owned by: essandess (Steve Smith)
Priority: Normal Milestone:
Component: base Version: 2.8.1
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

MacPorts 2.8.1 does not create symlink to source when worksrcpath is specified.

This is breaking behavior from version 2.8.0. See e.g., #66690.

The problem with the latest MacPorts version is that the worksrcpath specified by the Portfile is created as an actual directory, not a symlink to the untarred source contents created by the extract phase. This will be a problem with any port that specifies worksrcpath—I cannot recall why I did this for cabal but I believe that there was a good reason. See below.

How to observe the issue. The directory cabal-install-3.8.1.0 should be a symlink to cabal-Cabal-v3.8.1.0.

sudo port -sd patch cabal
# process hangs
^C

ls -l /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_cabal/cabal/work/
total 0
drwxr-xr-x  53 macports  wheel  1696 Feb  3 05:44 cabal-Cabal-v3.8.1.0/
drwxr-xr-x   2 macports  wheel    64 Feb  3 05:44 cabal-install-3.8.1.0/

https://github.com/macports/macports-ports/blob/b9c71b3bf2561a10fd6e0b64ca31859944a6e6f5/lang/cabal/Portfile#L99

    worksrcdir      ${name}-install-${version}

Change History (6)

comment:1 Changed 21 months ago by essandess (Steve Smith)

Description: modified (diff)

comment:2 Changed 21 months ago by kencu (Ken)

this was all done on purpose, to fix other bugs caused by creating the symlink.

see the recent base commits where it is explained fully.

Many ports will need fixing for this new reality, however….

comment:3 Changed 21 months ago by essandess (Steve Smith)

So how does one get the symlink back??

There must be some simple Portfile flag, right?

comment:4 Changed 21 months ago by kencu (Ken)

extract.rename yes

but if you set worksrcdir as well, it might not work… I have to read the code again to see exactly how Josh wrote it to work…

Last edited 21 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

Component: portsbase
Description: modified (diff)
Resolution: invalid
Status: newclosed

Closing because the change is intentional, as documented in the 2.8.1 release notes.

Either set worksrcdir correctly or use extract.rename yes.

comment:6 Changed 21 months ago by essandess (Steve Smith)

Owner: set to essandess
Resolution: invalidfixed

In 7266d113fa70286e6f71194814ee716d7b9205d2/macports-ports (master):

ghc-prebuilt, hadrian: Fix worksrcdir on MacPorts 2.8.1

Fixes: #66821

Note: See TracTickets for help on using tickets.