Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix widget install and uninstall using hardlinks. #2312

Closed
wants to merge 1 commit into from
Closed

Fix widget install and uninstall using hardlinks. #2312

wants to merge 1 commit into from

Conversation

miguelfrde
Copy link
Contributor

Fixes #2206
Related to ongoing discussion on #2264
Related to #2258 (merge conflicts?)

@rolandwalker This fixes the widget problem without showing a popup dialog to install.

File.link seems to do the job of hard linking directories.

@rolandwalker
Copy link
Contributor

File.link seems to do the job of hard linking directories.

Wow, cool find. This is innovative, and I am enthusiastic about helping and testing. However, because it is innovative, we should expect to take it slow.

File-hardlinks are perfectly ordinary; every experienced sysadmin uses them. Dir-hardlinks are exotic, people have been taught they don't exist. Some different rules apply. Therefore, to start with, I think they should be represented by two clearly different classes in Ruby.

Do you mind if I PR to your personal branch?

Also, @Peeja has been thinking about hardlinks in #2258. Perhaps he will join us here.

@Peeja
Copy link
Contributor

Peeja commented Jan 6, 2014

I may be missing something, but I don't think Ruby's being fancy here. I think it's just handing down the link(2) call to the OS, and if it supports directory hardlinks then it won't fail.

@miguelfrde
Copy link
Contributor Author

Do you mind if I PR to your personal branch?

@rolandwalker I don't mind.

@Peeja I agree with you

@phinze
Copy link
Contributor

phinze commented Jan 8, 2014

Hello good people!

Thanks so much for the work you're putting in to solve this problem! 👔

I have to admit; the hardlinks sort of make me nervous. If widgets are always self contained should we consider just doing a ditto into the directory and an rm -rf on uninstall?

Basically I'm talking about an Artifact::Copied type.

Perhaps that will be simpler and more reliable?

Though if others are convinced hardlinks are worth it I'm willing to be persuaded. 😀

@phinze
Copy link
Contributor

phinze commented Feb 8, 2014

Okay @rolandwalker has talked me into the merits of hardlinks (or file hardlinks at least) for solving problems like this.

Provided dir-hardlinks are properly supported in OS X, and since this would be limited to a small subset of Casks, I'd be willing to give this a shot.

What's the latest on this? @rolandwalker did you end up PR'ing that branch?

@rolandwalker
Copy link
Contributor

I remain interested but have not pursued it yet.

The fact that Ruby does dir-hardlinks without blinking is cool. Fonts using file-hardlinks has been working great.

However, using dir-hardlinks in production requires plenty of due diligence:

  • I don't think stat can return the same data structure as for file hardlinks. Currently we count number-of-hardlinks as a way of detecting whether a hardlink is managed by us. Will that work the same?
  • Must cover concerns on whether the user can delete dir-hardlinks using familiar tools such as Finder, command-line rmdir, etc. If not, that's a showstopper.
  • basically: explore all the many edge cases.

But widgets really don't work with symlinks. I have even tried duplicating the directory-tree of a widget and symlinking in each piece of content. Even that does not work.

So, please don't close!

@wamatt
Copy link
Contributor

wamatt commented Oct 24, 2014

Just throwing this out there, after researching dir hard links.

Considerations/potential pitfalls

I agree with the point earlier that we dealing with an exotic/esoteric feature
http://unix.stackexchange.com/questions/75225/forcibly-create-directory-hard-links

Apple also crippled LN to take away the directory functionality. (probably for good reason).
http://unix.stackexchange.com/questions/75225/forcibly-create-directory-hard-links

While it's certainly a super cool hack, how wise would it be, making it a mainstream option? Perhaps marking it 'experimental', would be more appropriate?

@rolandwalker
Copy link
Contributor

@wamatt yes, and "experimental" option is the current plan.

@fuzzy76
Copy link
Contributor

fuzzy76 commented Jan 20, 2015

I guess this can be closed because of #2206

@rolandwalker
Copy link
Contributor

If it's not too inconvenient, I'd like to leave this open, because I still want to do something like

$ brew cask --method=hardlink activate

@alebcay
Copy link
Member

alebcay commented Jan 23, 2015

Widget support has been removed as of #8751.

@alebcay alebcay closed this Jan 23, 2015
@adidalal adidalal removed the awaiting maintainer feedback Issue needs response from a maintainer. label Jan 3, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget installation doesn’t work
8 participants