-
Notifications
You must be signed in to change notification settings - Fork 266
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
bump virt-manager/view-viewer and deps #166
Conversation
oh i was just starting to look to get latest virt-manager, can verify this works on mac os x 11.3 beta |
With libvirt-python-7.1.0 it is possible install virt-manager on M1 Macs
update libvirt-python to version 7.1.0
I tried this pr and it can open virt-manager UI but when I open Spice view, I got error:
Edit: restart machine and this issue disappeared. |
PR #166 on a Air M1 virt-viewer builds fine and works. virt-manager fails on:
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. |
I can only test on catalina |
@rafaelreis-r can you try the following ?
|
Commands worked fine, but build process still presents same error.
Installation:
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: #173 (comment) |
I can confirm that using replacing PyGobject resource with
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. |
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 |
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 : |
There is one bugs in py. The api only returns the address of exec not closure. On linux arm64 and x86_64 platforms, exec adrress is same as closre. However, on Macos arm64, it is not true. Then segmentation fault happens while calling g_callable_info_free_closure() on exec ptr. Try the C code: ======================================================================== void puts_binding(ffi_cif *cif, void *ret, void* args[], void *stream) { *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); } typedef int (*puts_t)(char *); int main() { ffi_cif cif; ffi_type *args[1]; ffi_closure *closure; void *bound_puts; int rc; /* Allocate closure and bound_puts */ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); if (closure) { /* Initialize the argument info vectors */ args[0] = &ffi_type_pointer; /* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK) { /* Initialize the closure, setting stream to stdout */ if (ffi_prep_closure_loc(closure, &cif, puts_binding, stdout, bound_puts) == FFI_OK) { rc = ((puts_t)bound_puts)(""); /* rc now holds the result of the call to fputs */ } } printf("closure:%p exec: %p\n", closure, bound_puts); /* Deallocate both closure, and bound_puts */ ffi_closure_free(closure); return 0; } ======================================================================== I tried to fix it but there are some bugs in pyobject which also cause segmentation faults. I'm not a pundit in these messy code so just do hacks in pyobject to fix it. Link: https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 Link: jeffreywildman/homebrew-virt-manager#166 (comment) Signed-off-by: Su Yue <[email protected]>
There are bugs in pyobject and gobject-introspection. The API g_callable_info_prepare_closure() only returns the address of exec not closure. On linux arm64 and x86_64 platforms, exec address is same as closure. However, on Macos arm64, it is not true. Then segmentation fault happens while calling g_callable_info_free_closure() on exec ptr. Try the C code: ======================================================================== void puts_binding(ffi_cif *cif, void *ret, void* args[], void *stream) { *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); } typedef int (*puts_t)(char *); int main() { ffi_cif cif; ffi_type *args[1]; ffi_closure *closure; void *bound_puts; int rc; /* Allocate closure and bound_puts */ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); if (closure) { /* Initialize the argument info vectors */ args[0] = &ffi_type_pointer; /* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK) { /* Initialize the closure, setting stream to stdout */ if (ffi_prep_closure_loc(closure, &cif, puts_binding, stdout, bound_puts) == FFI_OK) { rc = ((puts_t)bound_puts)(""); /* rc now holds the result of the call to fputs */ } } printf("closure:%p exec: %p\n", closure, bound_puts); /* Deallocate both closure, and bound_puts */ ffi_closure_free(closure); return 0; } ======================================================================== I tried to fix it but there are some bugs in pyobject which also cause segmentation faults. I'm not a pundit in these messy code so just do hacks in pyobject to fix it. Link: https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 Link: jeffreywildman/homebrew-virt-manager#166 (comment) Signed-off-by: Su Yue <[email protected]>
There are bugs in pyobject and gobject-introspection. The API g_callable_info_prepare_closure() only returns the address of exec not closure. On linux arm64 and x86_64 platforms, exec address is same as closure. However, on Macos arm64, it is not true. Then segmentation fault happens while calling g_callable_info_free_closure() on exec ptr. Try the C code: ======================================================================== void puts_binding(ffi_cif *cif, void *ret, void* args[], void *stream) { *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); } typedef int (*puts_t)(char *); int main() { ffi_cif cif; ffi_type *args[1]; ffi_closure *closure; void *bound_puts; int rc; /* Allocate closure and bound_puts */ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); if (closure) { /* Initialize the argument info vectors */ args[0] = &ffi_type_pointer; /* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK) { /* Initialize the closure, setting stream to stdout */ if (ffi_prep_closure_loc(closure, &cif, puts_binding, stdout, bound_puts) == FFI_OK) { rc = ((puts_t)bound_puts)(""); /* rc now holds the result of the call to fputs */ } } printf("closure:%p exec: %p\n", closure, bound_puts); /* Deallocate both closure, and bound_puts */ ffi_closure_free(closure); return 0; } ======================================================================== I tried to fix it but there are some bugs in pyobject which also cause segmentation faults. I'm not a pundit in these messy code so just do hacks in pyobject to fix it. Link: https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 Link: jeffreywildman/homebrew-virt-manager#166 (comment) Signed-off-by: Su Yue <[email protected]>
@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 :) |
@jouve Should probably close this pull request. My pull request upgrades the libvirt-python version to a more suitable one. |
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 |
@Damenly nice, thanks! In archlinux this is solved via x11-ssh-askpass optdependency |
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
<#166 (comment)>,
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>.
|
No description provided.