knazarov / homebrew-qemu-virgl

A homebrew tap for qemu with support for 3d accelerated guests
415 stars 68 forks source link

can't install libangle [m1, BigSur 11.3] #18

Closed troyfolger closed 3 years ago

troyfolger commented 3 years ago
$ brew install knazarov/qemu-virgl/libangle
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 3 formulae.

==> Installing libangle from knazarov/qemu-virgl
==> Cloning https://chromium.googlesource.com/chromium/tools/depot_tools.git
Updating /Users/tfolger/Library/Caches/Homebrew/libangle--depot_tools--git
==> Checking out revision 8e2667e04d9282b6cb24e1086a246247036393c5
HEAD is now at 8e2667e0 Roll recipe dependencies (trivial).
HEAD is now at 8e2667e0 Roll recipe dependencies (trivial).
==> Cloning https://github.com/google/angle.git
Updating /Users/tfolger/Library/Caches/Homebrew/libangle--git
==> Checking out revision a11d65a172f885042cf4fdab5bfd124d174f5190
HEAD is now at a11d65a17 Roll vulkan-deps from ea8c29e1ee20 to d70f9e670332 (4 revisions)
HEAD is now at a11d65a17 Roll vulkan-deps from ea8c29e1ee20 to d70f9e670332 (4 revisions)
/opt/homebrew/Library/Taps/knazarov/homebrew-qemu-virgl/Formula/libangle.rb:26: warning: conflicting chdir during another chdir block
==> python2 scripts/bootstrap.py
==> gclient sync
==> gn gen --args=use_custom_libcxx=false target_cpu="arm64" ./angle_build
Last 15 lines from /Users/tfolger/Library/Logs/Homebrew/libangle/03.gn:
  File "/private/tmp/libangle-20210502-30031-1phvtj5/build/config/apple/sdk_info.py", line 72, in FillXcodeVersion
    '-version']).decode('UTF-8').splitlines()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1

See //build/config/sysroot.gni:71:5: whence it was imported.
    import("//build/config/mac/mac_sdk.gni")
    ^--------------------------------------
See //build/config/linux/pkg_config.gni:5:1: whence it was imported.
import("//build/config/sysroot.gni")
^----------------------------------
See //BUILD.gn:8:3: whence it was imported.
  import("//build/config/linux/pkg_config.gni")
  ^-------------------------------------------

Do not report this issue to Homebrew/brew or Homebrew/core!

====================

I'm not sure the version of xcode matters, but:

$ xcode-select -version
xcode-select version 2384.
troyfolger commented 3 years ago

Hmmm ... perhaps this is the issue?

$ xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

I've done $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

... and I'll try the build again.

knazarov commented 3 years ago

Hmmm ... perhaps this is the issue?

$ xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Yes, it is the issue. You need a complete xcode installation. I’m not sure why libangle started to require it. But I probably need to add a check for it in the formula so people are not surprised.

You can google the error and find how to fix it. It’s not hard.

troyfolger commented 3 years ago

OK, thank you, the sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer did get me past the libangle build issue.

However, as the build/install proceeds, the configure step of qemu-virgl is failing:

...
==> Applying qemu-version-v01.diff
patching file Makefile
patching file QEMU_VERSION
patching file VERSION
patching file meson.build
==> ./configure --prefix=/opt/homebrew/Cellar/qemu-virgl/20210430.1 --cc=clang --host-cc=clang --disable-bsd-user --disable-guest-a
Last 15 lines from /Users/tfolger/Library/Logs/Homebrew/qemu-virgl/01.configure:
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program scripts/decodetree.py found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9 /private/tmp/qemu-virgl-20210502-71511-1ywb8xa/scripts/decodetree.py)
Program @INPUT@ found: NO

../target/hexagon/meson.build:33:0: ERROR: Program '@INPUT@' not found

A full log can be found at /private/tmp/qemu-virgl-20210502-71511-1ywb8xa/build/meson-logs/meson-log.txt

ERROR: meson setup failed
knazarov commented 3 years ago

Please try brew install -s qemu to check that it doesn’t have the same problem. I’ll take a look at meson meanwhile.

troyfolger commented 3 years ago

When do brew install -s qemu (actually, I had qemu installed so I did brew reinstall -s qemu), I encounter the error mentioned here: https://github.com/Homebrew/homebrew-core/pull/76318

The commits for that issue happened just 6 hours ago and aren't approved yet ... so maybe we're hitting that?

knazarov commented 3 years ago

When do brew install -s qemu (actually, I had qemu installed so I did brew reinstall -s qemu), I encounter the error mentioned here: Homebrew/homebrew-core#76318

The commits for that issue happened just 6 hours ago and aren't approved yet ... so maybe we're hitting that?

I’ve patched the version file problem so that it at least builds for me (as well as in github ci). Latest version of my formula already contains the patch.

This is something else. I’ll try to investigate and let you know if I find something. Is there a way to contact you via chat, if I have a need to run something in your environment?

StellarOrbit commented 3 years ago

I am following this because I am also having this issue mentioned above. Would be awesome to see what the solution is.

happyd8699 commented 3 years ago

OK, thank you, the sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer did get me past the libangle build issue.

However, as the build/install proceeds, the configure step of qemu-virgl is failing:

...
==> Applying qemu-version-v01.diff
patching file Makefile
patching file QEMU_VERSION
patching file VERSION
patching file meson.build
==> ./configure --prefix=/opt/homebrew/Cellar/qemu-virgl/20210430.1 --cc=clang --host-cc=clang --disable-bsd-user --disable-guest-a
Last 15 lines from /Users/tfolger/Library/Logs/Homebrew/qemu-virgl/01.configure:
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program /opt/homebrew/opt/python@3.9/bin/python3.9 found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9)
Program scripts/decodetree.py found: YES (/opt/homebrew/opt/python@3.9/bin/python3.9 /private/tmp/qemu-virgl-20210502-71511-1ywb8xa/scripts/decodetree.py)
Program @INPUT@ found: NO

../target/hexagon/meson.build:33:0: ERROR: Program '@INPUT@' not found

A full log can be found at /private/tmp/qemu-virgl-20210502-71511-1ywb8xa/build/meson-logs/meson-log.txt

ERROR: meson setup failed

Same issues.

Lunaticf commented 3 years ago

I came across same problem. ERROR: meson setup failed

knazarov commented 3 years ago

I’ve pulled the patch from upstream (see #20). After it passes CI checks, I’ll merge it and you all will be able to try again.

Thanks for your reports, it’s super important and keeps the project alive.

knazarov commented 3 years ago

Should be fixed now. Please run:

brew tap --force-auto-update knazarov/qemu-virgl
brew install qemu-virgl
troyfolger commented 3 years ago

OK, I didn't see your last comment - I did

brew uninstall qemu
brew uninstall qemu-virgl
brew install -d qemu-virgl 

... and it built! Thanks for your quick resolution. I'll continue with your install instructions from here.

troyfolger commented 3 years ago

I just wanted to leave one last comment - after the install of qemu-virgl, I followed your instructions for creating an Ubuntu VM, and it worked phenomenally well. I was even able to play a quick game of Wolfenstein from the Ubuntu app store. The desktop is very responsive on the M1 mini. Great work, and thank you for this!