neovide / neovide

No Nonsense Neovim Client in Rust
https://neovide.dev
MIT License
12.71k stars 515 forks source link

hdiutil: attach failed - no mountable file systems #2714

Open alexventuraio opened 1 month ago

alexventuraio commented 1 month ago

Describe the bug Not sure if this belongs here but just in case some else if facing the same thing, I got this error when trying to install Neovide using brew in MacOS.

I've opened an issue in the brew formula as well but from what I have seen in some forums the error seems to be due to a corrupted/broken DMG file, so maybe the build/packaging step is not working properly.

To Reproduce Steps to reproduce the behavior:

  1. Go to the terminal
  2. Make sure you have brew installed
  3. Run this brew install --cask neovide
  4. See error

Expected behavior I should be able to install Neovide correctly

Screenshots N/A

Desktop (please complete the following information):

Please run neovide --log and paste the contents of the .log file created in the current directory here:

Additional context

╰─ brew install --cask neovide
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################################################################################################################################################### 100.0%
==> Downloading https://github.com/neovide/neovide/releases/download/0.13.3/Neovide-aarch64-apple-darwin.dmg
Already downloaded: /Users/alex/Library/Caches/Homebrew/downloads/abdde5d9c9edafccc0347beec1156221e54e78ff7a0c999d0b85a8b473fd0539--Neovide-aarch64-apple-darwin.dmg
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################################################################################################################################################### 100.0%
All dependencies satisfied.
==> Installing Cask neovide
hdiutil: attach failed - no mountable file systems
==> Purging files for version 0.13.3 of Cask neovide
Error: Failure while executing; `/usr/bin/env hdiutil attach -plist -nobrowse -readonly -mountrandom /private/tmp/homebrew-dmg20240716-29248-ku0izz /private/tmp/homebrew-dmg20240716-29248-ku0izz/abdde5d9c9edafccc0347beec1156221e54e78ff7a0c999d0b85a8b473fd0539--Neovide-aarch64-apple-darwin.cdr` exited with 1. Here's the output:
hdiutil: attach failed - no mountable file systems
fredizzimo commented 1 month ago

It's possible that my updates to MinimumSystemVersion here is not valid https://github.com/neovide/neovide/pull/2713/commits/91a333bcc265ecf05b78ed6bf6eeac5bd9af60db#diff-971b2ac9922c3c9ca5b99bb2125e7bfdd78cd3175e349608c4d723f7aba023d8

But I don't own a mac to verify myself.

fredizzimo commented 1 month ago

You could also check if the dmg files from the CI has the same problem, in case something got corrupted when I uploaded the release.

From here https://github.com/neovide/neovide/actions/runs/9953932239

alexventuraio commented 1 month ago

I downloaded the Neovide-aarch64-apple-darwin.dmg as a zip file and extracted the DMG file. Then opened it up and move the Neovide.app file to the Application folder and double clicking on it seems to work fine.

Just wondering what else I need to do to open it from the CLI from my project directory? Installing it with brew it all work by default and I was able to open a folder from there with neovide . command.

fredizzimo commented 1 month ago

I downloaded the zip from the CI build and extracted it, and then dmg from the release https://github.com/neovide/neovide/releases/tag/0.13.3

They both seem to be the same with the same sha256sum d17883a1ab1694c24d670986cd4f5856dfede9134cbb4904260e7e76e614dea0

So I'm not sure what's going on, can you try to download the release dmg and install it.

Just wondering what else I need to do to open it from the CLI from my project directory? Installing it with brew it all work by default and I was able to open a folder from there with neovide . command.

Yes, homebrew adds the neovide command for you. I'm not completely sure, but I think you can run it with /Applications/Neovide.app/Contents/MacOS/neovide or open neovide from the terminal.

alexventuraio commented 1 month ago

Thanks this one worked fine /Applications/Neovide.app/Contents/MacOS/neovide . from within my project folder but what a mess. Hopefully this will get fixed soon, if there is anything I can help with since I have a Mac, just let me know.

fredizzimo commented 1 month ago

It would be good if you could test the dmg from the releases page as well https://github.com/neovide/neovide/releases/tag/0.13.3

It's possible that the homebrew formula needs to update the minimum macOS version as well https://github.com/Homebrew/homebrew-core/blob/a5643c4c1b3d4b685e5d47b0ae77d6b045b46e7c/Formula/n/neovide.rb#L22

I just noticed that we declared compatibility with macOS 10, while it does in fact not work with OS versions less than 12, so I changed it to that on our side.

alexventuraio commented 1 month ago

I confirm the DMG from releases works fine as well. Should I download the formula file and change something and test it locally?

fredizzimo commented 1 month ago

I think I see what the problem is now.

The formula builds from source and use cargo bundle, which we no longer use https://github.com/Homebrew/homebrew-core/blob/a5643c4c1b3d4b685e5d47b0ae77d6b045b46e7c/Formula/n/neovide.rb

So, they don't use the dmg from our releases. I still don't know why it does not work though, I don't think we have removed that compatibility yet.

But it will be missing the bug fixes for https://github.com/neovide/neovide/issues/2555, and some other things.

fredizzimo commented 1 month ago

We have some scripts for creating the dmg file here https://github.com/neovide/neovide/tree/main/macos-builder, which I guess the homebrew formula should also be updated to use.

alexventuraio commented 1 month ago

So, which one would you say is better approach? To use the existing DMG files or build it from source using the scripts you have for Mac?

fredizzimo commented 1 month ago

I have no idea how homebrew prefers to handle it and what kind of policy they have. But if I had to guess, I would say that they want to build from source, since that's what they did before.

alexventuraio commented 1 month ago

Hmm, I've never created a formula before, but I'd love to have it fixed. So, can you point me where to start learning about the scripts to build for Mac if there's any documentation for it? Or do you have a bare minimum idea where can I start looking at to update the formula if possible?

fredizzimo commented 1 month ago

Not really, but I think this is the documentation https://docs.brew.sh/Cask-Cookbook

And this part need to be changed https://github.com/Homebrew/homebrew-core/blob/a5643c4c1b3d4b685e5d47b0ae77d6b045b46e7c/Formula/n/neovide.rb#L39-L40

fredizzimo commented 1 month ago

And @falcucci and @9mm, should be able to give more information about the scripts in the macos-builder folder. Our documentation should probably also be updated as asked here https://github.com/neovide/neovide/issues/2555#issuecomment-2226851226 by @xzbdmw

alexventuraio commented 1 month ago

Oh, I see, that would be great to have updated.

So, do you think a good starting point is to open up and new issue in the homebrew-core repo?

fredizzimo commented 1 month ago

Yes, that looks like the correct place to report the problem and coordinate the fix.