Opened 16 years ago

Closed 13 years ago

#13601 closed defect (fixed)

MacPorts doesn't respect hard links during install phase

Reported by: julien.thewys@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 1.5.2
Keywords: tcl hard link Cc: blb@…, ryandesign (Ryan Carsten Schmidt), nox@…
Port: git-core

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

Just installed macports and git-core on 10.5 . I can see that lots of generated bin are just the same file:

cd /opt/local/bin;
for i in git-*; do diff -qs $i git-tag; done | grep identical | wc

Some "cp" could be replaced by "ln" in the build process.

Change History (11)

comment:1 Changed 16 years ago by jmpp@…

Milestone: Port Enhancements

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: bryan@… added
Owner: changed from macports-tickets@… to mgrimes@…

Assign/Cc maintainers.

comment:3 Changed 16 years ago by blb@…

Cc: bryan@… removed
Component: portsbase
Keywords: tcl hard link added
Milestone: Port EnhancementsMacPorts base bugs
Owner: changed from mgrimes@… to macports-tickets@…
Summary: git-core hard linkMacPorts doesn't respect hard links during install phase
Type: enhancementdefect

git-core does use hard links in the destroot, so the issue is actually with MacPorts base. It currently doesn't look for hard links when going from destroot to install, hence each file is then copied instead of hard linked.

The question is how easy/difficult it would be to detect hard linked files in Tcl, since 'file type' appears to only return 'link' which is a symlink, and 'file' for hard links (since it looks like a file).

comment:4 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

I thought that was the point of hard links -- that they are indistinguishable from real files. So there's no way for base to fix this.

So isn't the fix for the for git-core to install those files as symlinks instead of hard links?

comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: blb@… ryandesign@… added
Port: git-core added

comment:7 in reply to:  4 Changed 15 years ago by blb@…

Replying to ryandesign@…:

I thought that was the point of hard links -- that they are indistinguishable from real files. So there's no way for base to fix this.

It can with inode detection (I think that'd be the simplest way). Something using [file stat...] to detect when a file has more than one link, then organizing those which are the same to keep the hard links.

So isn't the fix for the for git-core to install those files as symlinks instead of hard links?

Perhaps, or maybe they have a reason for using hard instead of symlinks. Also, this could come up again.

comment:8 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:9 Changed 14 years ago by nox@…

Actually using ln for every hard link from destroot to the image should work just fine. A file with 2 links would just end up with 2 additional hard links in the image.

comment:10 Changed 14 years ago by nox@…

Cc: nox@… added

Cc Me!

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

Milestone: MacPorts FutureMacPorts 2.0.0
Resolution: fixed
Status: newclosed

This should also have been fixed by r77511.

Note: See TracTickets for help on using tickets.