Skip to content

Conversation

@darthShadow
Copy link
Member

cmount: Add optional brew tag to throw an error when using mount in the binaries installed via Homebrew - Fixes #4775

What is the purpose of this change?

Add optional brew tag to throw an error when using mount in the binaries installed via Homebrew

Was the change discussed in an issue or in the forum before?

#4775

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@darthShadow
Copy link
Member Author

This is the error message thrown when using mount or cmount with the brew build tag:

2020/11/17 22:34:05 Fatal error: failed to mount FUSE fs: mount is not supported on MacOS when installed via Homebrew. Please install the binaries available at https://rclone.org/downloads/ instead if you want to use the mount command

@ivandeex
Copy link
Member

@ncw @darthShadow

#4775 (comment) suggests a macos caveat note in https://github.com/rclone/rclone/blob/master/docs/content/commands/rclone_mount.md#limitations

[...] the right thing to do is [...] add something in the caveats stanza that mentions that mount won't work without fuse and leave it up to the user to decide how they want to handle.

@darthShadow
Copy link
Member Author

Yep, I intend to add this caveat to the homebrew formula and not to the rclone docs.

@darthShadow
Copy link
Member Author

Just to clarify on this, my thought process has always been to reflect the limitations etc. of the actual binaries available on the website on the respective pages. The package-specific or OS-specific limitations should always be present in those docs, especially since Homebrew provides an easy way to add caveats in the formula.

@xaocon
Copy link

xaocon commented Nov 17, 2020

I may not understand something. Why not just fail gracefully if fuse isn't available in all builds rather than take functionality out for some builds?

… the

binaries installed via Homebrew - Fixes rclone#4775

Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK.

Query about whether we expect brew + cmount inline

// Build for macos with the brew tag to handle the absence
// of fuse and print an appropriate error message

// +build brew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to mention the cmount tag? Or do we do this regardless of the cmount tag?

If we can expect cmount and brew to be set then we need to adjust the constraints for cmount/{fs,mount}.go something like:

// +build cmount
// +build cgo
// +build linux darwin,!brew freebsd windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will just be replacing the cmount tag with the brew tag in Homebrew so this case probably won't happen there but I can add it anyway to be safe if you want?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think that is fine. Adding too many build constraints makes my head explode anyway as there are too many combinations to think through.

@ncw
Copy link
Member

ncw commented Nov 23, 2020

As far as I can see we now have two options for building with brew

  1. build with brew build tag - rclone mount gives a nice error message
  2. build with cmount build tag. Since the rclone binary doesn't depend on fuse being installed then it doesn't need to have a FUSE dependency in brew.

Option 2) would be my preference if that is OK with the brew developers, but it might not be possible as they will need FUSE installed on the dev machine to build rclone with the cmount tag.

I note that removing OSXFUSE from brew will break rclone's build

brew cask install osxfuse

So we'll have to fix that too at some point!

@darthShadow
Copy link
Member Author

darthShadow commented Nov 23, 2020

I note that removing OSXFUSE from brew will break rclone's build

I don't think that's the end goal. Based on my understanding of the discussions at Homebrew/homebrew-core#64491, it is just that they are removing any formula that depends on a Cask and not the cask itself. Anyway, I will confirm this understanding once.

@darthShadow
Copy link
Member Author

This change has been accepted in the homebrew repository too so this PR can be merged now.

@ncw
Copy link
Member

ncw commented Nov 26, 2020

Thank you @darthShadow - I'll merge this now

@ncw ncw merged commit 07dee18 into rclone:master Nov 26, 2020
@darthShadow darthShadow deleted the add-brew-tag branch November 27, 2020 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Homebrew depreciation

4 participants