jeffreywildman / homebrew-virt-manager

A set of homebrew formulae to install virt-manager and virt-viewer on MAC OSX
1k stars 266 forks source link

bump virt-manager/view-viewer and deps #166

Closed jouve closed 1 year ago

doomedraven commented 3 years ago

oh i was just starting to look to get latest virt-manager, can verify this works on mac os x 11.3 beta

fkpwolf commented 3 years ago

I tried this pr and it can open virt-manager UI but when I open Spice view, I got error:

spice-client-error-quark: Could not auto-redirect USB Device at 20-22: could not claim interface 0(configuration 1): LIBUSB_ERROR_ACCESS(0)

Edit: restart machine and this issue disappeared.

rafaelreis-r commented 2 years ago

PR #166 on a Air M1

virt-viewer builds fine and works.

virt-manager fails on:

==> /opt/homebrew/Cellar/virt-manager/3.2.0_3/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--PyGObject-2021
Last 15 lines from /Users/rafaelreisr/Library/Logs/Homebrew/virt-manager/07.pip:
  ERROR: Failed building wheel for PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_3/libexec/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_3/libexec/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_3/libexec/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 360, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.1.1; however, version 21.1.3 is available.
You should consider upgrading via the '/opt/homebrew/Cellar/virt-manager/3.2.0_3/libexec/bin/python3.9 -m pip install --upgrade pip' command.
Removed build tracker: '/private/tmp/pip-req-tracker-25m6ew6y'

I read somewhere that this seems to be an issue with that version of pip and M1 Macs. Version 21.1.3 works fine. I have updated pip to the latest version on home-brew, but don't know exactly how to do it on virt-manager build environment.

jouve commented 2 years ago

I can only test on catalina

jouve commented 2 years ago

@rafaelreis-r can you try the following ?

curl -O https://files.pythonhosted.org/packages/51/2f/4d5d5afb7000b9151e33952b59163c9389bd867ac6fe85d62f85831fa061/PyGObject-3.40.1.tar.gz
tar xf PyGObject-3.40.1.tar.gz
cd PyGObject-3.40.1/
python3.9 -m venv .venv
./.venv/bin/pip install --upgrade pip==21.1.1
./.venv/bin/pip wheel -v .
rafaelreis-r commented 2 years ago

@rafaelreis-r can you try the following ?

Commands worked fine, but build process still presents same error.

  Created wheel for PyGObject: filename=PyGObject-3.40.1-cp39-cp39-macosx_11_0_arm64.whl size=236939 sha256=56d3126adf1682b0c9a82acbc655e8f7ce1fa48753c71d5967a8db246a5b74ab
  Stored in directory: /Users/rafaelreisr/Library/Caches/pip/wheels/22/64/50/c8c8c647d3bf799e350edaba27905aa28e0a093f0f9d2e9ac6
Successfully built PyGObject
WARNING: You are using pip version 21.1.1; however, version 21.1.3 is available.
You should consider upgrading via the '/opt/homebrew/Library/Taps/jeffreywildman/homebrew-virt-manager/PyGObject-3.40.1/.venv/bin/python3.9 -m pip install --upgrade pip' command.
Removed build tracker: '/private/var/folders/_1/41hvxkq93p71_s_g6_6d4mnr0000gn/T/pip-req-tracker-ugm2rck7' 

Installation:

==> Installing jeffreywildman/virt-manager/virt-manager
==> Patching
==> python3 -m venv --system-site-packages /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--certifi-20210715-14749-4ogwsh/certifi-2021.5.30
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--charset-normalizer-20210715-14749-tufesi/charset-normalizer
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--idna-20210715-14749-1dtint7/idna-3.2
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--libvirt-python-20210715-14749-bpb72i/libvirt-python-7.5.0
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--pycairo-20210715-14749-1etdh6y/pycairo-1.20.1
==> /opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manager--PyGObject-20210715-14749-10sxwp4/PyGObject-3.40.1
Last 15 lines from /Users/rafaelreisr/Library/Logs/Homebrew/virt-manager/07.pip:
  error: command '/opt/homebrew/Library/Homebrew/shims/mac/super/clang' failed with exit code 1
  Building wheel for PyGObject (PEP 517): finished with status 'error'
  ERROR: Failed building wheel for PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/opt/homebrew/Cellar/virt-manager/3.2.0_4/libexec/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 360, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
Removed build tracker: '/private/tmp/pip-req-tracker-nhy48g95'

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

I noticed pyGobject is part of Homebrew already. I was able to go further by adding it to the rb file instead of compiling it in the install process. That compiles, but it leads me to a segmentation fault documented on this comment: https://github.com/jeffreywildman/homebrew-virt-manager/issues/173#issuecomment-866003100

theranger commented 2 years ago

I can confirm that using replacing PyGobject resource with depends_on "pygobject3" makes it possible to complete the installation on BigSur (Intel CPU). Application runs, connects to server, but opening any of the virtual instances throws Python memory management exception:

Python(78266,0x10b117e00) malloc: error for object 0x7fb9c904e450: pointer being freed was not allocated Python(78266,0x10b117e00) malloc: set a breakpoint in malloc_error_break to debug

Have not yet managed to dig deeper into this.

One more note, this error happened already even if only libvirt-python was updated to the latest version and all other dependencies were not touched.

Damenly commented 2 years ago

Well, thanks to Jouve, I fixed the pygobject installation issue in my branch but there is a segmentation fault issue: https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 It seems a bug of pygobject but no one fixed it in the past 7 moths.

jouve commented 2 years ago

pypi and homebrew-core/pyobject3 are the same archive (3.40.1):

there are not a lot of changes between 3.40.1 and master, so it might be the same bug : https://gitlab.gnome.org/GNOME/pygobject/-/compare/3.40.1...master?from_project_id=416

Damenly commented 2 years ago

I just fixed segmentation faults with some hacks in my branch. Anyone who interests in it could look at this.

Tested it in arm64 only:

Screen Shot 2021-09-04 at 14 27 02
rafaelreis-r commented 2 years ago

@Damenly I can confirm your branch compiles and runs fine on my M1 Air!

However I gave up on homebrew virt-manager for arm64 months ago since this hadn't had a solution all this time.

In case anybody is interested I went the docker way using https://github.com/m-bers/docker-virt-manager on the host. Virt-manager on a webpage :)

krishjainx commented 2 years ago

@jouve Should probably close this pull request. My pull request upgrades the libvirt-python version to a more suitable one.

k0ste commented 2 years ago

I just fixed segmentation faults with some hacks in my branch. Anyone who interests in it could look at this.

Tested it in arm64 only: Screen Shot 2021-09-04 at 14 27 02

Can't fill issue to your repo

?1 ~ % brew install damenly/virt-manager/virt-manager
==> Downloading https://files.pythonhosted.org/packages/6d/78/f8db8d57f520a54f0b8a438319c342c61c22759d8f9a1cd2e2180b5e5ea9/certifi-2021.5.30.
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/e7/4e/2af0238001648ded297fb54ceb425ca26faa15b341b4fac5371d3938666e/charset-normalizer
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/cb/38/4c4d00ddfa48abe616d7e572e02a04273603db446975ab46bbcd36552005/idna-3.2.tar.gz
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/a0/24/a8eefb64e4c7baf5a0006dd3b2c5ce6aef334ff15c9c29066c6791a72fe1/libvirt-python-7.6
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/bc/3f/64e6e066d163fbcf13213f9eeda0fc83376243335ea46a66cefd70d62e8f/pycairo-1.20.1.tar
######################################################################## 100.0%
==> Cloning https://github.com/Damenly/pygobject.git
Cloning into '/Users/k0ste/Library/Caches/Homebrew/virt-manager--PyGObject--git'...
==> Checking out branch arm64e_tmp_fix
Already on 'arm64e_tmp_fix'
Your branch is up to date with 'origin/arm64e_tmp_fix'.
==> Downloading https://files.pythonhosted.org/packages/e7/01/3569e0b535fb2e4a6c384bdbed00c55b9d78b5084e0fb7f4d0bf523d7670/requests-2.26.0.ta
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/4f/5a/597ef5911cb8919efe4d86206aa8b2658616d676a7088f0825ca08bd7cb8/urllib3-1.26.6.tar
######################################################################## 100.0%
==> Downloading https://virt-manager.org/download/sources/virt-manager/virt-manager-3.2.0.tar.gz
Already downloaded: /Users/k0ste/Library/Caches/Homebrew/downloads/076c9cd7ebc326805adadb4c0525544e05ef6183614a8937cd21a39364835fe6--virt-manager-3.2.0.tar.gz
==> Installing virt-manager from damenly/virt-manager
==> Patching
==> python3 -m venv --system-site-packages /usr/local/Cellar/virt-manager/3.2.0_5/libexec
==> python3 -m venv --upgrade-deps /usr/local/Cellar/virt-manager/3.2.0_5/libexec
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
Last 15 lines from /Users/k0ste/Library/Logs/Homebrew/virt-manager/06.pip:
    Running setup.py install for libvirt-python: started
    Running command /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"'; __file__='"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-yov7xi17/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/virt-manager/3.2.0_5/libexec/include/site/python3.9/libvirt-python
    running install
    running build
    /usr/local/Homebrew/Library/Homebrew/shims/mac/super/pkg-config --print-errors --atleast-version=0.9.11 libvirt
    /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python generator.py libvirt /usr/local/Cellar/libvirt/7.8.0/share/libvirt/api/libvirt-api.xml
    Found 492 functions in /usr/local/Cellar/libvirt/7.8.0/share/libvirt/api/libvirt-api.xml
    Found 0 functions in libvirt-override-api.xml
    Generated 402 wrapper functions
    Missing type converters:
    int *:1
    ERROR: failed virNodeDeviceGetAutostart
    error: command '/usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python' failed with exit code 1
    Running setup.py install for libvirt-python: finished with status 'error'
ERROR: Command errored out with exit status 1: /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"'; __file__='"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-yov7xi17/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/virt-manager/3.2.0_5/libexec/include/site/python3.9/libvirt-python Check the logs for full command output.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/damenly/homebrew-virt-manager/issues
Damenly commented 2 years ago

I just fixed segmentation faults with some hacks in my branch. Anyone who interests in it could look at this. Tested it in arm64 only: Screen Shot 2021-09-04 at 14 27 02

Can't fill issue to your repo

?1 ~ % brew install damenly/virt-manager/virt-manager
==> Downloading https://files.pythonhosted.org/packages/6d/78/f8db8d57f520a54f0b8a438319c342c61c22759d8f9a1cd2e2180b5e5ea9/certifi-2021.5.30.
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/e7/4e/2af0238001648ded297fb54ceb425ca26faa15b341b4fac5371d3938666e/charset-normalizer
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/cb/38/4c4d00ddfa48abe616d7e572e02a04273603db446975ab46bbcd36552005/idna-3.2.tar.gz
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/a0/24/a8eefb64e4c7baf5a0006dd3b2c5ce6aef334ff15c9c29066c6791a72fe1/libvirt-python-7.6
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/bc/3f/64e6e066d163fbcf13213f9eeda0fc83376243335ea46a66cefd70d62e8f/pycairo-1.20.1.tar
######################################################################## 100.0%
==> Cloning https://github.com/Damenly/pygobject.git
Cloning into '/Users/k0ste/Library/Caches/Homebrew/virt-manager--PyGObject--git'...
==> Checking out branch arm64e_tmp_fix
Already on 'arm64e_tmp_fix'
Your branch is up to date with 'origin/arm64e_tmp_fix'.
==> Downloading https://files.pythonhosted.org/packages/e7/01/3569e0b535fb2e4a6c384bdbed00c55b9d78b5084e0fb7f4d0bf523d7670/requests-2.26.0.ta
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/4f/5a/597ef5911cb8919efe4d86206aa8b2658616d676a7088f0825ca08bd7cb8/urllib3-1.26.6.tar
######################################################################## 100.0%
==> Downloading https://virt-manager.org/download/sources/virt-manager/virt-manager-3.2.0.tar.gz
Already downloaded: /Users/k0ste/Library/Caches/Homebrew/downloads/076c9cd7ebc326805adadb4c0525544e05ef6183614a8937cd21a39364835fe6--virt-manager-3.2.0.tar.gz
==> Installing virt-manager from damenly/virt-manager
==> Patching
==> python3 -m venv --system-site-packages /usr/local/Cellar/virt-manager/3.2.0_5/libexec
==> python3 -m venv --upgrade-deps /usr/local/Cellar/virt-manager/3.2.0_5/libexec
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
==> /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/virt-manage
Last 15 lines from /Users/k0ste/Library/Logs/Homebrew/virt-manager/06.pip:
    Running setup.py install for libvirt-python: started
    Running command /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"'; __file__='"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-yov7xi17/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/virt-manager/3.2.0_5/libexec/include/site/python3.9/libvirt-python
    running install
    running build
    /usr/local/Homebrew/Library/Homebrew/shims/mac/super/pkg-config --print-errors --atleast-version=0.9.11 libvirt
    /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python generator.py libvirt /usr/local/Cellar/libvirt/7.8.0/share/libvirt/api/libvirt-api.xml
    Found 492 functions in /usr/local/Cellar/libvirt/7.8.0/share/libvirt/api/libvirt-api.xml
    Found 0 functions in libvirt-override-api.xml
    Generated 402 wrapper functions
    Missing type converters:
    int *:1
    ERROR: failed virNodeDeviceGetAutostart
    error: command '/usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python' failed with exit code 1
    Running setup.py install for libvirt-python: finished with status 'error'
ERROR: Command errored out with exit status 1: /usr/local/Cellar/virt-manager/3.2.0_5/libexec/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"'; __file__='"'"'/private/tmp/virt-manager--libvirt-python-20211021-44666-nme0am/libvirt-python-7.6.0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-yov7xi17/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/virt-manager/3.2.0_5/libexec/include/site/python3.9/libvirt-python Check the logs for full command output.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/damenly/homebrew-virt-manager/issues

Thanks for the report! I just bumped my repo. Try:

brew untap damenly/virt-manager brew tap damenly/virt-manager brew install virt-manager --HEAD

k0ste commented 2 years ago

@Damenly nice, thanks! Currently the only issue I was get - virt-manager don't ask for password. I check on linux laptop and virt-manager prompt for password before connection image

In archlinux this is solved via x11-ssh-askpass optdependency https://github.com/archlinux/svntogit-community/blob/packages/virt-manager/trunk/PKGBUILD#L16

doomedraven commented 2 years ago

To solve the password problem you can run it with flag - - no-fork and it will ask pass in terminal, i had this issue for long time so i just added my ssh key to autorized_keys

El vie., 22 oct. 2021 10:55, Konstantin Shalygin @.***> escribió:

@Damenly https://github.com/Damenly nice, thanks! Currently the only issue I was get - virt-manager don't ask for password. I check on linux laptop and virt-manager prompt for password before connection [image: image] https://user-images.githubusercontent.com/7759548/138423036-a45854d9-c9ee-495c-b86f-641af09b1171.png

In archlinux this is solved via x11-ssh-askpass https://archlinux.org/packages/community/x86_64/x11-ssh-askpass/ optdependency

https://github.com/archlinux/svntogit-community/blob/packages/virt-manager/trunk/PKGBUILD#L16

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeffreywildman/homebrew-virt-manager/pull/166#issuecomment-949422489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOFH3ZHBGEBSGDRQ32N7STUIERHTANCNFSM4XTOJPDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jouve commented 2 years ago

https://github.com/Homebrew/homebrew-core/pull/91218