New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #13601 (closed defect: fixed)

Opened 4 years ago

Last modified 10 months ago

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@…, nox@…
Port: git-core

Description (last modified by ryandesign@…) (diff)

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

  Changed 4 years ago by jmpp@…

  • milestone set to Port Enhancements

  Changed 4 years ago by ryandesign@…

  • owner changed from macports-tickets@… to mgrimes@…
  • cc bryan@… added

Assign/Cc maintainers.

  Changed 4 years ago by blb@…

  • cc bryan@… removed
  • component changed from ports to base
  • summary changed from git-core hard link to MacPorts doesn't respect hard links during install phase
  • owner changed from mgrimes@… to macports-tickets@…
  • milestone changed from Port Enhancements to MacPorts base bugs
  • keywords tcl hard link added
  • type changed from enhancement to defect

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).

follow-up: ↓ 7   Changed 3 years ago by 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.

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

  Changed 3 years ago by ryandesign@…

  • description modified (diff)

  Changed 3 years ago by ryandesign@…

  • cc blb@…, ryandesign@… added
  • port set to git-core

in reply to: ↑ 4   Changed 3 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.

  Changed 3 years ago by toby@…

  • milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

  Changed 2 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.

  Changed 2 years ago by nox@…

  • cc nox@… added

Cc Me!

  Changed 10 months ago by jmr@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacPorts Future to MacPorts 2.0.0

This should also have been fixed by r77511.

Note: See TracTickets for help on using tickets.