Skip to content
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

Unable to start Xpra (arm64) on m1 #4017

Closed
pefribeiro opened this issue Sep 27, 2023 · 109 comments
Closed

Unable to start Xpra (arm64) on m1 #4017

pefribeiro opened this issue Sep 27, 2023 · 109 comments
Labels
bug Something isn't working macos packaging

Comments

@pefribeiro
Copy link

pefribeiro commented Sep 27, 2023

Describe the bug
Unable to start Xpra on M1.

To Reproduce
Steps to reproduce the behavior:

  1. Open Xpra, eg. via command line

System Information (please complete the following information):

Additional context

grep: /usr/share/locale/locale.alias: No such file or directory
xpra main error:
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 123, in main
    return run_mode(script_file, cmdline, err, options, args, mode, defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 457, in run_mode
    return do_run_mode(script_file, cmdline, error_cb, options, args, mode, defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 589, in do_run_mode
    return gui.main(cmdline)
           ^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/gtk_common/gui.py", line 262, in main
    from xpra.platform.darwin.gui import wait_for_open_handlers
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/platform/darwin/gui.py", line 16, in <module>
    import objc                         #@UnresolvedImport
    ^^^^^^^^^^^
  File "objc/__init__.pyc", line 6, in <module>
  File "objc/_objc.pyc", line 14, in <module>
  File "objc/_objc.pyc", line 10, in __load
  File "imp.pyc", line 343, in load_dynamic
ImportError: dlopen(/Applications/Xpra.app/Contents/Resources/lib/python/lib-dynload/objc/_objc.so, 0x0002): symbol not found in flat namespace '_ffi_find_closure_for_code_np'
@pefribeiro pefribeiro added the bug Something isn't working label Sep 27, 2023
@totaam
Copy link
Collaborator

totaam commented Sep 28, 2023

_ffi_find_closure_for_code_np

ffi problems again, see Xpra-org/gtk-osx-build#27 and Xpra-org/gtk-osx-build#22

FYI: I don't have direct access to M1 or M2 Apple hardware to test on so this may take a while.
Please considering sponsoring the hardware.

@pefribeiro
Copy link
Author

Thanks @totaam. How would I go about compiling it with --with-system-ffi ?

@totaam
Copy link
Collaborator

totaam commented Sep 28, 2023

totaam added a commit that referenced this issue Sep 28, 2023
@puremourning
Copy link

puremourning commented Oct 4, 2023

@totaam I'm seeing the same issue here with the apple silicon beta, and would like to try and help. I spent a good part of yesterday trying to build locally using the gtk-osx-build fork, but keep hitting problems (complication failures etc.)

To save your time, can you confirm that these instructions are right: https://github.com/Xpra-org/xpra/blob/master/docs/Build/MacOS.md and there are no changes required to ~/.config/jhbuildrc-custom ? I sort of guessed that changing architectures=["x86_64"] might be required (though changing it to arm64 resulted in build failure in pixman.


running on a almost-newly-installed macOS 13.6 with Xcode 15, commandlinetools installed.
In order to get past the first build problems I had to do cpan install XML::Parser (this may be because homebrew perl was in my path)

Detailed results of trying to get it built. First with architectures=['x86_64']:

  • gtk-osx-setup.sh: ok
  • jhbuild update - this fails as the zlib tarball is returning 404 (I fixed it by changing the repo URL; see below for error)
  • jhbuild bootstrap-gtk-osx : fails configuring m4
checking for socklen_t... no
checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t
*** Error during phase configure of m4: ########## Error running /Users/ben/gtk/source/m4-1.4.19/configure --prefix /Users/ben/gtk/inst    *** [2/15]

Next with architectures=['arm64']:

using the following:

setup_sdk(target="12", sdk_version="12", architectures=["arm64"])

I get the following results:

  • gtk-osx-setup.sh - ok
  • jhbuild update - this fails as the zlib tarball is returning 404 (I fixed it by changing the repo URL)
  • jhbuild bootstrap-gtk-osx - succeeds \o/
  • jhbuild build - fails building pixman with a screenful of errors, seemingly about some unrecognised asm block. perhaps this isn't building arm ?
/Users/ben/gtk/source/pixman-0.42.2/pixman/pixman-arma64-neon-asm.S:657:1: note: while in macro instantiation
generate_composite_function_single_scanline pixman_composite_scanline_add_asm_neon, 32, 0, 32, FLAG_DST_READWRITE, 8, default_init, default_cleanup, pixman_composite_add_8_8_process_pixblock_head, pixman_composite_add_8_8_process_pixblock_tail, pixman_composite_add_8888_8888_process_pixblock_tail_head
^
<instantiation>:13:9: error: expected absolute expression
    .if elem_size==32
        ^
<instantiation>:18:5: note: while in macro instantiation
    pixldst 4, st1, 32, basereg, mem_operand, abits
    ^
<instantiation>:37:5: note: while in macro instantiation
    pixst chunk_size, dst_w_bpp, dst_w_basereg, DST_W
    ^
<instantiation>:37:1: note: while in macro instantiation
.irp chunk_size, 16, 8, 4, 2, 1
^
<instantiation>:124:5: note: while in macro instantiation
    process_trailing_pixels 0, 1, process_pixblock_head, process_pixblock_tail, process_pixblock_tail_head
    ^
<instantiation>:1:1: note: while in macro instantiation
generate_composite_function_scanline 0, x
^

zlib issue. the URL is 404, so I changed the repo url to https://distfiles.macports.org/zlib/ based on quick google search for the tarball name :)

curl --continue-at - -L https://www.zlib.net/zlib-1.2.13.tar.xz -o /Users/ben/gtk/source/pkgs/zlib-1.2.13.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   315  100   315    0     0    569      0 --:--:-- --:--:-- --:--:--   570
*** Error during phase checkout of zlib: file hash is incorrect (expected d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98, got d5a89e26beae0bc03ad18a0b0d1d3d75f87c32047879d25da11970cb5c4662a3) *** [4/137]

@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

this may be because homebrew perl was in my path

That's likely as I never saw perl errors here on any arch.

this fails as the zlib tarball is returning 404

Perhaps it moved since I used that URL to download the source? (IIRC, this is from gtk-osx-build upstream)
Please submit a PR with the URL fixes. Not using macports.org URL.

fails building pixman with a screenful of errors

Looks like microsoft/vcpkg#29168

@puremourning
Copy link

zlib

Done - Xpra-org/gtk-osx-build#31

pixman

Good shout. Traced it through and there looks to be a workaround (disable neon), but also that it's fixed recently.

For now I will try the workaround --disable-arm-a64-neon --disable-arm-neon. If that works, perhaps I'll try upgrading pixman to whatever version fixes it.

@puremourning
Copy link

OK, now I am getting build failure with cairo, which is looking for a LZO header.

/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../../../../gtk/source/cairo-1.17.8/util/cairo-script -I. -I../../../../gtk/source/cairo-1.17.8 -Isrc -I../../../../gtk/source/cairo-1.17.8/src -I/Users/ben/gtk/inst/include/libpng16 -I/Users/ben/gtk/inst/include/freetype2 -I/Users/ben/gtk/inst/include/harfbuzz -I/Users/ben/gtk/inst/include/glib-2.0 -I/Users/ben/gtk/inst/lib/glib-2.0/include -I/opt/homebrew/Cellar/brotli/1.1.0/include -I/Users/ben/gtk/inst/include/pixman-1 -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Users/ben/gtk/inst/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -g -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=12 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -c ../../../../gtk/source/cairo-1.17.8/util/cairo-script/cairo-script-operators.c
../../../../gtk/source/cairo-1.17.8/util/cairo-script/cairo-script-operators.c:63:10: fatal error: 'lzo/lzo2a.h' file not found

I sollved this by adding 'lzo' as a new module (not 100% sure this is completely right, but it seems to work):

a/modulesets-stable/gtk-osx.modules b/modulesets-stable/gtk-osx.modules
index 276bd7b..dae834d 100644
--- a/modulesets-stable/gtk-osx.modules
+++ b/modulesets-stable/gtk-osx.modules
@@ -39,6 +39,9 @@
   <repository name="sourceforge"
               href="http://downloads.sourceforge.net/sourceforge/"
               type="tarball" />
+  <repository name="oberhummer"
+              href="https://www.oberhumer.com/opensource/lzo/download/"
+              type="tarball" />
   <repository name="system"
               type="system" />
   <!--
@@ -194,7 +197,7 @@
   <!--
     disable-arm-a64-neon and disable-arm-neon are reuquired when building on
     Apple Silicon. See https://gitlab.freedesktop.org/pixman/pixman/-/issues/59
-  -->
+  -->
   <autotools id="pixman"
              autogen-sh="configure"
              autogenargs="--disable-gtk --disable-mmx --disable-arm-a64-neon --disable-arm-neon">
@@ -206,6 +209,15 @@
       <dep package="meta-gtk-osx-bootstrap" />
     </after>
   </autotools>
+  <!---->
+  <autotools id="lzo"
+             autogen-sh="configure"
+             autogenargs="--disable-dependency-tracking">
+    <branch module="lzo-2.10.tar.gz"
+            version="2.10"
+            hash="sha1:4924676a9bae5db58ef129dc1cebce3baa3c4b5d"
+            repo="oberhummer" />
+  </autotools>
   <!--
     cairo doesn't really need fontconfig, but if Pango finds
     freetype it insists that it has to have fontconfig too and that
@@ -222,6 +234,7 @@
       <dep package="meta-gtk-osx-bootstrap" />
       <dep package="harfbuzz-no-cairo" />
       <dep package="fontconfig" />
+      <dep package="lzo" />
     </dependencies>
   </meson>
   <!---->

but, that moves on to the next error!

FAILED: gtk/gtkresources.c
/Users/ben/gtk/inst/bin/glib-compile-resources gtk/gtk.gresources.xml --sourcedir /Users/ben/.cache/jhbuild/build/gtk+-3.24.38/gtk --sourcedir /Users/ben/gtk/source/gtk+-3.24.38/gtk --sourcedir ../../../../gtk/source/gtk+-3.24.38/gtk --c-name _gtk --internal --generate --target gtk/gtkresources.c --manual-register --dependency-file gtk/gtkresources.c.d
dyld[35156]: Symbol not found: _jpeg_CreateCompress
  Referenced from: <8899F39C-F1B8-3AC7-8FAC-BFDD3BA67DE4> /Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
  Expected in:     <no uuid> unknown
gtk/gtk.gresources.xml: Child process killed by signal 6.
[18/1529] Generating demos/gtk-demo/gtkdemo_resources_h with a custom command
FAILED: demos/gtk-demo/gtkdemo_resources.h
/Users/ben/gtk/inst/bin/glib-compile-resources ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/demo.gresource.xml --sourcedir ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/. --sourcedir ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo --internal --generate --target demos/gtk-demo/gtkdemo_resources.h
dyld[35180]: Symbol not found: _jpeg_CreateCompress
  Referenced from: <8899F39C-F1B8-3AC7-8FAC-BFDD3BA67DE4> /Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
  Expected in:     <no uuid> unknown
../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/demo.gresource.xml: Child process killed by signal 6.
[19/1529] Generating gtk/gtkresources_h with a custom command
FAILED: gtk/gtkresources.h
/Users/ben/gtk/inst/bin/glib-compile-resources gtk/gtk.gresources.xml --sourcedir /Users/ben/.cache/jhbuild/build/gtk+-3.24.38/gtk --sourcedir /Users/ben/gtk/source/gtk+-3.24.38/gtk --sourcedir ../../../../gtk/source/gtk+-3.24.38/gtk --c-name _gtk --internal --generate --target gtk/gtkresources.h --manual-register
dyld[35155]: Symbol not found: _jpeg_CreateCompress
  Referenced from: <8899F39C-F1B8-3AC7-8FAC-BFDD3BA67DE4> /Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
  Expected in:     <no uuid> unknown
gtk/gtk.gresources.xml: Child process killed by signal 6.
[20/1529] Generating demos/gtk-demo/gtkdemo_resources_c with a custom command
FAILED: demos/gtk-demo/gtkdemo_resources.c
/Users/ben/gtk/inst/bin/glib-compile-resources ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/demo.gresource.xml --sourcedir ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/. --sourcedir ../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo --internal --generate --target demos/gtk-demo/gtkdemo_resources.c --dependency-file demos/gtk-demo/gtkdemo_resources.c.d
dyld[35179]: Symbol not found: _jpeg_CreateCompress
  Referenced from: <8899F39C-F1B8-3AC7-8FAC-BFDD3BA67DE4> /Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
  Expected in:     <no uuid> unknown
../../../../gtk/source/gtk+-3.24.38/demos/gtk-demo/demo.gresource.xml: Child process killed by signal 6.
[28/1529] Generating gtk/gtktypebuiltins.h with a custom command (wrapped by meson to capture output)
ninja: build stopped: subcommand failed.
*** Error during phase build of gtk+-3.0: ########## Error running ninja   *** [31/138]

@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

OK, now I am getting build failure with cairo, which is looking for a LZO header.

Oh odd. I have never seen this one!

dyld[35179]: Symbol not found: _jpeg_CreateCompress

Ah, this one may well be: Xpra-org/gtk-osx-build#19 (comment)
Just install_name_tool then force rebuild of anything linked with libjpeg.

@puremourning
Copy link

Very strange.

ben@Bens-MacBook-Pro gdk-pixbuf-2.42.10 % otool -L /Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
/Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib:
	/Users/ben/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.10.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)
	/Users/ben/gtk/inst/lib/libglib-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.3.0)
	/Users/ben/gtk/inst/lib/libintl.8.dylib (compatibility version 12.0.0, current version 12.0.0)
	/Users/ben/gtk/inst/lib/libgobject-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.3.0)
	/Users/ben/gtk/inst/lib/libgmodule-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.3.0)
	/Users/ben/gtk/inst/lib/libgio-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.3.0)
	/Users/ben/gtk/inst/lib/libpng16.16.dylib (compatibility version 57.0.0, current version 57.0.0)
	@rpath/libjpeg.62.dylib (compatibility version 62.0.0, current version 62.3.0)
	/Users/ben/gtk/inst/lib/libtiff.6.dylib (compatibility version 7.0.0, current version 7.2.0)

ben@Bens-MacBook-Pro gdk-pixbuf-2.42.10 % nm ~/gtk/inst/lib/libjpeg.62.dylib | grep Create
000000000000d628 T _jpeg_CreateCompress
000000000002e808 T _jpeg_CreateDecompress

@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

@rpath/libjpeg.62.dylib

That's the broken bit that needs install_name_tool then a rebuild of gdk-pixbuf.

@puremourning
Copy link

puremourning commented Oct 4, 2023

Yes, that did work. For the record I did this:

  • jhbuild shell
  • cd $JHBUILD_PREFIX/lib
  • install_name_tool -id $PWD/libjpeg.62.dylib libjpeg.62.3.0.dylib
  • install_name_tool -change @rpath/libjpeg.62.dylib $PWD/libjpeg.62.dylib libtiff.6.dylib
  • jhbuild buildone -f gdk-pixbuf
  • jhbuild buildone -f cairo
  • jhbuild build

I'll look to see if I can encourage cmake to actually do that, as the -DCMAKE_MACOSX_RPATH=TRUE/FALSE doesn't appear to do anything.

Anyway. Next problem, need to cpan install XML::Simple, again probably due to homebrew perl.

And on to the next one:

*** Configuring xxhash *** [46/138]
cmake -DCMAKE_INSTALL_PREFIX=/Users/ben/gtk/inst -DCMAKE_INSTALL_LIBDIR=lib -G Ninja -DCMAKE_INSTALL_PREFIX=  /Users/ben/gtk/source/xxHash-0.8.2
CMake Warning:
  Ignoring extra path from command line:

   "/Users/ben/gtk/source/xxHash-0.8.2"


CMake Error: The source directory "/Users/ben/gtk/source/xxHash-0.8.2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
*** Error during phase configure of xxhash: ########## Error running cmake -DCMAKE_INSTALL_PREFIX=/Users/ben/gtk/inst -DCMAKE_INSTALL_LIBDIR=lib -G Ninja -DCMAKE_INSTALL_PREFIX=  /Users/ben/gtk/source/xxHash-0.8.2 *** [46/138]

"Fixed" that:

index 2987b84..26321c9 100644
--- a/xpra-tools.modules
+++ b/xpra-tools.modules
@@ -96,7 +96,7 @@
                        repo="github.com"/>
        </cmake>
 
-       <cmake id="xxhash" cmakeargs="-DCMAKE_INSTALL_PREFIX=" autogen-sh="configure">
+       <cmake id="xxhash" cmakeargs="-DCMAKE_MACOSX_RPATH=FALSE" autogen-sh="configure" cmakedir="cmake_unofficial">
                <branch module="/Cyan4973/xxHash/archive/refs/tags/v0.8.2.tar.gz"
                        version="0.8.2" checkoutdir="xxHash-0.8.2"
                        hash="sha256:baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4"

And on to the next error...

*** Building python3-bcrypt *** [68/138]
python3 setup.py build --build-base /Users/ben/.cache/jhbuild/build/bcrypt-4.0.1

        =============================DEBUG ASSISTANCE==========================
        If you are seeing an error here please try the following to
        successfully install bcrypt:

        Upgrade to the latest pip and try again. This will fix errors for most
        users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
        =============================DEBUG ASSISTANCE==========================

Traceback (most recent call last):
  File "/Users/ben/gtk/source/bcrypt-4.0.1/setup.py", line 11, in <module>
    from setuptools_rust import RustExtension
  File "/Users/ben/gtk/inst/lib/python3.11/site-packages/setuptools_rust/__init__.py", line 1, in <module>
    from .build import build_rust
  File "/Users/ben/gtk/inst/lib/python3.11/site-packages/setuptools_rust/build.py", line 27, in <module>
    from typing_extensions import Literal
ModuleNotFoundError: No module named 'typing_extensions'

EDIT: Just realised this is documented in the build instructions. Will do that.!

totaam added a commit to Xpra-org/gtk-osx-build that referenced this issue Oct 4, 2023
@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

I'll look to see if I can encourage cmake to actually do that, as the -DCMAKE_MACOSX_RPATH=TRUE/FALSE doesn't appear to do anything.

Good, so it's not just me. I had tried to fix it and then gave up on it.

Error during phase configure of xxhash

Thanks! Applied.

@puremourning
Copy link

For the record. Next problem : libvorbis doesn't build due to an unsupported linker flag.

Homebrew fixes this with a patch: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/libvorbis.rb#L45C12-L45C12

I've manually edited configure for now, but will create a patch file to fix it later.

@puremourning
Copy link

puremourning commented Oct 4, 2023

Next, I had to remove --enable-runtime-cpu-detection for libvpx as that's not supported on this CPU. Ideally this would be switched in the config based on architecture.

Then, I changed the xar module to use the subdirectory as this was also failing:

	<autotools id="xar" autogen-sh="autogen.sh" supports-non-srcdir-builds="no">
		<branch repo="github" module="typeling1578/xar" subdir="xar"/>
	</autotools>

AND...

*** success *** [138/138]

\o/

Now to build Xpra!

ben@Bens-MacBook-Pro MacOS % ./make-app.sh
Building Xpra for Python 3.11
the xpra html5 client must be installed in /Users/ben/gtk/inst/share/xpra/www/

OK more homework for me!

CLIENT_ONLY=1 ./make-app.sh

Gets further and fails on py2app missing. I'll keep at it. So close now.

@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

Then, I changed the xar module to use the subdirectory as this was also failing:

Thanks!
Applied in Xpra-org/gtk-osx-build@53da4ea

*** success *** [138/138]

Nice!

CLIENT_ONLY=1 ./make-app.sh

There is a problem with CLIENT_ONLY=1 builds - I can't remember what it is, which is why there are none in the downloads folder. Try without?

@puremourning
Copy link

Without CLIENT_ONLY, I get 'the Xpra html5 client must be installed in ...' which I don't yet know how to solve.

With CLIENT_ONLY, I get this:

*******************************************************************************
py2app step:
./setup.py py2app  --without-server --without-shadow --without-proxy
 (see /Users/ben/repos/github/xpra/xpra/py2app.log for details - this may take a minute or two)
ERROR: py2app failed

* spng_encoder         : Y
* ssh                  : Y
* strict               : N
* tests                : N
* uinput               : N
* v4l2                 : N
* verbose              : N
* vpx                  : Y
* vsock                : N
* warn                 : Y
* webcam               : N
* webp                 : Y
* x11                  : N
* xdg_open             : N
* xinput               : N
Traceback (most recent call last):
  File "/Users/ben/repos/github/xpra/xpra/./setup.py", line 1938, in <module>
    import py2app    #@UnresolvedImport
    ^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'py2app'

is that what you were remembering?

@totaam
Copy link
Collaborator

totaam commented Oct 4, 2023

Just install the xpra-html5 client, that's really easy.

@puremourning
Copy link

I did that and get the same error:

ben@Bens-MacBook-Pro MacOS % ./make-app.sh 
Building Xpra for Python 3.11
*******************************************************************************
Deleting existing xpra modules and temporary directories

*******************************************************************************
Building and installing locally
~/repos/github/xpra/xpra ~/repos/github/xpra/xpra/packaging/MacOS
updated ./xpra/src_info.py with:
* BRANCH               = master
* COMMIT               = gda232585f
* LOCAL_MODIFICATIONS  = 0
* REVISION             = 34474
'nvcc --version' failed with return code 127
stderr: None
updated ./xpra/build_info.py with:
* BUILD_BIT            = 64bit
* BUILD_CPU            = arm
* BUILD_DATE           = 2023-10-04
* BUILD_MACHINE        = arm64
* BUILD_OS             = MacOS 13.6
* BUILD_TIME           = 16:55
* BUILT_BY             = ben
* BUILT_ON             = Bens-MacBook-Pro.local
* COMPILER_VERSION     = Apple clang version 15.0.0 (clang-1500.0.40.1)
* CYTHON_VERSION       = 3.0.2
* LINKER_VERSION       = LLVM version 15.0.0 (static support for 29, runtime is 29)
* PYTHON_VERSION       = 3.11.5
* lib_gobject_introspection = 1.76.1
* lib_gtk              = 3.24.38
* lib_py3cairo         = 1.24.0
* lib_pygobject        = 3.44.1
* lib_python3          = 3.11
* lib_vpx              = 1.13.1
* lib_x11              = 1.8.6
* lib_x264             = 0.164.x
* lib_xext             = 1.3.5
./setup.py clean
Xpra version 6.0
found Cython version 3.0.2
found pkg-config version: 0.29.2
ARCH='arm64'
using INCLUDE_DIRS=['/Users/ben/repos/github/xpra/devroot/.new_local/share/virtualenvs/etc-zZzKIFJg/include']
CC='/Applications/Xcode.app/Contents/Developer/usr/bin/gcc'
CPP='cpp'
found 10 logical CPUs
./setup.py build_ext  -j 10
 (see /Users/ben/repos/github/xpra/xpra/build_ext.log for details - this may take a minute or two)
./setup.py install 
 (see /Users/ben/repos/github/xpra/xpra/install.log for details)
OK

*******************************************************************************
py2app step:
./setup.py py2app 
 (see /Users/ben/repos/github/xpra/xpra/py2app.log for details - this may take a minute or two)
ERROR: py2app failed

* spng_encoder         : Y
* ssh                  : Y
* strict               : N
* tests                : N
* uinput               : N
* v4l2                 : N
* verbose              : N
* vpx                  : Y
* vsock                : N
* warn                 : Y
* webcam               : N
* webp                 : Y
* x11                  : N
* xdg_open             : N
* xinput               : N
Traceback (most recent call last):
  File "/Users/ben/repos/github/xpra/xpra/./setup.py", line 1938, in <module>
    import py2app    #@UnresolvedImport
    ^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'py2app'

@puremourning
Copy link

py2app.log

@puremourning
Copy link

OK I fixed that:

ben@Bens-MacBook-Pro MacOS % git diff
diff --git a/packaging/MacOS/make-app.sh b/packaging/MacOS/make-app.sh
index 171853b71..f212759b9 100755
--- a/packaging/MacOS/make-app.sh
+++ b/packaging/MacOS/make-app.sh
@@ -87,7 +87,7 @@ if [ "$?" != "0" ]; then
        exit 1
 fi
 #get the version and build info from the python build records:
-export PYTHONPATH="."
+export PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
 VERSION=`${PYTHON} -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
 REVISION=`${PYTHON} -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
 REV_MOD=`${PYTHON} -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
ben@Bens-MacBook-Pro MacOS % 

now gtk-mac-bundler failed. But more progress!

@puremourning
Copy link

it was my environment messing up the paths. I sorted this out so that ghbuild shell is cleaner and... it's built!

\o/

And it works!

Screenshot 2023-10-04 at 17 59 20

Or, well it looked like it...

Screenshot 2023-10-04 at 18 00 13

But it's not crashing with undefined symbols. Nearly there.

@puremourning
Copy link

OK this is why it failed:

2023-10-05 10:41:07,441 Warning: server connection failure:
2023-10-05 10:41:07,442  Connection failed: disconnected before the session could be established
2023-10-05 10:41:07,442  connection error
2023-10-05 10:41:07,442  client failed to specify any supported encodings

hmm...

ben@Bens-MacBook-Pro MacOS % ./image/Xpra.app/Contents/MacOS/Xpra  encoding
grep: /usr/share/locale/locale.alias: No such file or directory
<frozen importlib._bootstrap>:673: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
modules found:
* csc_cython           : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/csc_cython/converter.cpython-311-darwin.so
* csc_libyuv           : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/libyuv/converter.cpython-311-darwin.so
* dec_gstreamer        : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/gstreamer/decoder.py
* dec_jpeg             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/jpeg/decoder.cpython-311-darwin.so
* dec_openh264         : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/openh264/decoder.cpython-311-darwin.so
* dec_pillow           : dlopen(/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/python/lib-dynload/PIL/_imaging.so, 0x0002): Library not loaded: @executable_path/../Frameworks/libxcb.1.1.0.dylib
  Referenced from: <7851DF75-48C2-30F6-AC9D-D6BF464E5602> /Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/python3.11/lib-dynload/PIL/_imaging.so
  Reason: tried: '/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/libxcb.1.1.0.dylib' (no such file), '/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/Frameworks/libxcb.1.1.0.dylib' (no such file)
* dec_spng             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/spng/decoder.cpython-311-darwin.so
* dec_vpx              : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/vpx/decoder.cpython-311-darwin.so
* dec_webp             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/webp/decoder.cpython-311-darwin.so
* enc_gstreamer        : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/gstreamer/encoder.py
* enc_jpeg             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/jpeg/encoder.cpython-311-darwin.so
* enc_openh264         : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/openh264/encoder.cpython-311-darwin.so
* enc_pillow           : dlopen(/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/python/lib-dynload/PIL/_imaging.so, 0x0002): Library not loaded: @executable_path/../Frameworks/libxcb.1.1.0.dylib
  Referenced from: <7851DF75-48C2-30F6-AC9D-D6BF464E5602> /Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/python3.11/lib-dynload/PIL/_imaging.so
  Reason: tried: '/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/lib/libxcb.1.1.0.dylib' (no such file), '/Users/ben/repos/github/xpra/xpra/packaging/MacOS/image/Xpra.app/Contents/Resources/Frameworks/libxcb.1.1.0.dylib' (no such file)
* enc_rgb              : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/argb/encoder.py
* enc_spng             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/spng/encoder.cpython-311-darwin.so
* enc_vpx              : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/vpx/encoder.cpython-311-darwin.so
* enc_webp             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/webp/encoder.cpython-311-darwin.so
* enc_x264             : image/Xpra.app/Contents/Resources/lib/python/xpra/codecs/x264/encoder.cpython-311-darwin.so

codecs versions:
* cython                          : 4.2
* gstreamer                       : 5.0
* jpeg                            : 1.0
* libyuv                          : 1.0
* openh264                        : 2.3.1
* rgb                             : 4.3
* spng                            : 0.7.4
* vpx                             : 1.13.1
* webp                            : 1.3.2
* x264                            : 164
ben@Bens-MacBook-Pro MacOS %

I'll have to dig into it another time. Thanks for the help so far though!

@totaam
Copy link
Collaborator

totaam commented Oct 5, 2023

Library not loaded: @executable_path/../Frameworks/libxcb.1.1.0.dylib

That's most definitely wrong.
Nothing should be linked with X11 libraries.
And running without the pillow codecs is not supported - might work, might not.

I'll have to dig into it another time

Could be a compatibility error. You're building git master? What version is the server?

@puremourning
Copy link

It was indeed a compatibility error. Server was using v. old version. Upgraded to latest 5.x release and my Xpra client connects!

\o/

Going to have to find some solid time to polish up all of the changes to the build. But I guess we're not really closer to understanding why we are getting crashes in the released version and if we can mitigate that.

First though I need to work out why this is happening (DPI issue?)

Screenshot 2023-10-09 at 17 42 45

@totaam
Copy link
Collaborator

totaam commented Oct 9, 2023

First though I need to work out why this is happening (DPI issue?)

What am I looking at?
Is the xterm meant to cover the whole window?
If so, try force enabling opengl with --opengl=force.
IIRC, MacOS displays lie about their resolution and expect us to upscale things.

@totaam
Copy link
Collaborator

totaam commented Feb 8, 2024

The big remaining question is whether or not these builds will run on system that don't have the exact same version of libffi... Xpra-org/gtk-osx-build#27

cpatulea added a commit to cpatulea/gtk-osx-build that referenced this issue Feb 8, 2024
Looks like PyPi tarball doesn't have setup.py, which jhbuild needs. Add it back
using a patch.

Xpra-org/xpra#4017 (comment)
cpatulea added a commit to cpatulea/gtk-osx-build that referenced this issue Feb 8, 2024
Looks like PyPi tarball doesn't have setup.py, which jhbuild needs:
*** Checking out python3-setuptools_rust *** [66/137]
*** Building python3-setuptools_rust *** [66/137]
python3 setup.py build --build-base /Users/runner/.cache/jhbuild/build/setuptools-rust-1.8.1
python3: can't open file '/Users/runner/gtk/source/setuptools-rust-1.8.1/setup.py': [Errno 2] No such file or directory
*** Error during phase build of python3-setuptools_rust: ########## Error running python3 setup.py build --build-base /Users/runner/.cache/jhbuild/build/setuptools-rust-1.8.1 *** [66/137]

Add it back using a patch.

Xpra-org/xpra#4017 (comment)
cpatulea added a commit to cpatulea/gtk-osx-build that referenced this issue Feb 8, 2024
Looks like PyPi tarball doesn't have setup.py, which jhbuild needs:

2024-02-06T16:42:10.5816920Z *** Building python3-idna *** [90/137]
2024-02-06T16:42:10.5822330Z python3 setup.py build --build-base /Users/runner/.cache/jhbuild/build/idna-3.6
2024-02-06T16:42:10.7839920Z python3: can't open file '/Users/runner/gtk/source/idna-3.6/setup.py': [Errno 2] No such file or directory
2024-02-06T16:42:10.8055060Z *** Error during phase build of python3-idna: ########## Error running python3 setup.py build --build-base /Users/runner/.cache/jhbuild/build/idna-3.6 *** [90/137]

https://github.com/cpatulea/gtk-osx-build/actions/runs/7802110330/job/21278777736

Add it back using a patch.

Xpra-org/xpra#4017 (comment)
cpatulea added a commit to cpatulea/gtk-osx-build that referenced this issue Feb 8, 2024
Fixes build failure:
2024-02-07T00:13:44.1632550Z In file included from Modules/_AVFoundation.m:12:
2024-02-07T00:13:44.1634070Z Modules/_AVFoundation_protocols.m:80:28: error: cannot find protocol declaration for 'AVCapturePhotoOutputReadinessCoordinatorDelegate'
2024-02-07T00:13:44.1635400Z     p = PyObjC_IdToPython(@protocol(AVCapturePhotoOutputReadinessCoordinatorDelegate));
2024-02-07T00:13:44.1636240Z                            ^
2024-02-07T00:13:44.1667560Z 1 error generated.
2024-02-07T00:13:44.1769500Z error: command '/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' failed with exit code 1
2024-02-07T00:13:44.2675810Z *** Error during phase build of python3-pyobjc-framework-avfoundation: ########## Error running python3 setup.py build --build-base /Users/runner/.cache/jhbuild/build/pyobjc-framework-AVFoundation-10.0 *** [101/137]

CI log: https://github.com/cpatulea/gtk-osx-build/actions/runs/7806902536/job/21294198714

Issue: ronaldoussoren/pyobjc#572

Cc: Xpra-org/xpra#4017
@totaam
Copy link
Collaborator

totaam commented Feb 9, 2024

@pefribeiro / @puremourning / @sejtam does the latest build work for you guys (6.0-r35120 or later):

https://xpra.org/beta/MacOS/arm64/
Edit: and now also x86_64 builds:
https://xpra.org/beta/MacOS/x86_64/

@m-dahl
Copy link

m-dahl commented Feb 12, 2024

I can confirm that 6.0-r35120 fixed it for me on my m1.

@sejtam
Copy link

sejtam commented Feb 13, 2024 via email

@Xpra-org Xpra-org deleted a comment from sejtam Feb 13, 2024
@sejtam
Copy link

sejtam commented Feb 19, 2024

This seems to work also now on my M2. I say seems, because I have not yet figured out how to make the GUI clients on OSX use SSH with a public-key (ie passwordless).

@totaam
Copy link
Collaborator

totaam commented Feb 19, 2024

@sejtam is this the same issue as #4142 ?

@pefribeiro
Copy link
Author

@pefribeiro / @puremourning / @sejtam does the latest build work for you guys (6.0-r35120 or later):

https://xpra.org/beta/MacOS/arm64/

Thanks for all the efforts, but I'm afraid it doesn't seem to work here:

$ /Applications/Xpra.app/Contents/MacOS/Xpra --ssh=ssh start ssh://xxx@yyy --start=xfce4-terminal
grep: /usr/share/locale/locale.alias: No such file or directory

2024-02-19 09:45:57,765 Xpra GTK3 client version 6.0-r35120 (g48bb2e952) beta
2024-02-19 09:45:57,783  running on Mac OS X
2024-02-19 09:45:57,783  cpython 3.11
grep: /usr/share/locale/locale.alias: No such file or directory
grep: /usr/share/locale/locale.alias: No such file or directory
2024-02-19 09:45:58,251 GStreamer version 1.22.9
2024-02-19 09:45:58,269 created unix domain sockets:
2024-02-19 09:45:58,269  '/Users/pfr500/.xpra/clients/UOY22M036-51653'

(Xpra:51653): Gtk-CRITICAL **: 09:45:58.354: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
2024-02-19 09:45:58,371  keyboard settings: layout=gb
2024-02-19 09:45:58,376  desktop size is 1920x2062:
2024-02-19 09:45:58,376   uoy22m036.local (404x4679 mm - DPI: 121x11)
2024-02-19 09:45:58,376     1                1920x1080 at    0x0    (507x288 mm - DPI: 96x95) workarea: 1920x1055 at    0x25
2024-02-19 09:45:58,376     monitor 2        1512x982  at  195x1080 (301x195 mm - DPI: 128x128) workarea: 1512x944  at  195x1118
...
Entering daemon mode; any further errors will be reported to:
  '/run/user/54155/xpra/S541809/server.log'
Actual display used: :4
Actual log file name is now: '/run/user/54155/xpra/4/server.log'
2024-02-19 09:46:19,072 removing unix domain socket '/Users/pfr500/.xpra/clients/UOY22M036-51653'
2024-02-19 09:46:21,068 Warning: server connection failure:
2024-02-19 09:46:21,069  Connection failed: disconnected before the session could be established
2024-02-19 09:46:21,069  connection error
2024-02-19 09:46:21,069  error accepting new connection

Any help much appreciated.

@totaam
Copy link
Collaborator

totaam commented Feb 19, 2024

@pefribeiro this looks fine, only the server failed to accept your connection. Perhaps it is out of date.

@pefribeiro
Copy link
Author

@pefribeiro this looks fine, only the server failed to accept your connection. Perhaps it is out of date.

Ok, thanks. What server versions does the Xpra client v6 handle? Is v4 too old?

@totaam
Copy link
Collaborator

totaam commented Feb 21, 2024

Ok, thanks. What server versions does the Xpra client v6 handle? Is v4 too old?

Yes: https://github.com/Xpra-org/xpra/wiki/Versions

@ilyagr
Copy link

ilyagr commented May 11, 2024

I'm having a similar problem with Xpra 6, downloaded today from https://xpra.org/dists/MacOS/arm64/Xpra.pkg, on Mac OS Sonoma 14.4.1 with Apple silicon:

$  uname -a
Darwin macaw.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64 arm Darwin

$ xpra
grep: /usr/share/locale/locale.alias: No such file or directory

(Xpra:30292): Gtk-WARNING **: 19:45:15.029: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/source/gtk+-3.24.38/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /Applications/Xpra.app/Contents/Resources/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: dlopen(/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so, 0x0001): tried: '/Applications/Xpra.app/Contents/Resources/lib/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xpra.app/Contents/Resources/bin/
../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file) (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../../../../gtk/source/gtk+-3.24.38/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /Applications/Xpra.app/Contents/Resources/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixb
uf-2.0/2.10.0/loaders/libpixbufloader-svg.so: dlopen(/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-
pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so, 0x0001): tried: '/Applications/Xpra.app/Contents/Resources/lib/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file) (gdk-pixbuf-error-quark, 5)
fish: Job 1, 'xpra' terminated by signal SIGABRT (Abort)

I'm not entirely sure if it's exactly the same problem, since the other messages here do not mention ensure_surface_for_gicon

@ilyagr
Copy link

ilyagr commented May 12, 2024

I'll ping @dehesselle, just in case this is interesting to you (if the ping even goes through). I know of them addressing vaguely similar problems in https://gitlab.gnome.org/GNOME/meld/-/issues/804.

@totaam
Copy link
Collaborator

totaam commented May 13, 2024

Gtk:ERROR: (..) '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file),
'/System/Volumes/Preboot/Cryptexes/OS/Applications/Xpra.app/Contents/Resources/bin/

Not sure what the /System/Volumes/Preboot/Cryptexes/OS prefix is doing here.

This looks like a packaging issue with missing pixbuf loaders. I'll take a look.
I don't know why this would cause:

fish: Job 1, 'xpra' terminated by signal SIGABRT (Abort)

Or perhaps this is unrelated?

@dehesselle
Copy link

@ilyagr Yes, pings come through (any reason they should not?).

There's a lot going on here, did you want to point me at something specific?
In regards to your error with the svg pixbuf loader, there is a duplicate Resources in that path, making it invalid.

@ilyagr
Copy link

ilyagr commented May 13, 2024

@dehesselle This is another GTK Python project that seems to have some trouble with packaging on Mac OS (to run on Apple Silicon and recent Mac OS especially), and with signing. I thought these problems might interest you, but I might have guessed wrong, and I might be overstepping (especially since I haven't been involved with this project at all).

As for the ping, I didn't know whether GitHub pings people who haven't participated in a project before.

@lhotari
Copy link

lhotari commented May 27, 2024

I'm having a similar problem with Xpra 6, downloaded today from https://xpra.org/dists/MacOS/arm64/Xpra.pkg, on Mac OS Sonoma 14.4.1 with Apple silicon:

$  uname -a
Darwin macaw.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64 arm Darwin

$ xpra
grep: /usr/share/locale/locale.alias: No such file or directory

(Xpra:30292): Gtk-WARNING **: 19:45:15.029: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/source/gtk+-3.24.38/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /Applications/Xpra.app/Contents/Resources/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: dlopen(/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so, 0x0001): tried: '/Applications/Xpra.app/Contents/Resources/lib/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xpra.app/Contents/Resources/bin/
../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file) (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../../../../gtk/source/gtk+-3.24.38/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /Applications/Xpra.app/Contents/Resources/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixb
uf-2.0/2.10.0/loaders/libpixbufloader-svg.so: dlopen(/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-
pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so, 0x0001): tried: '/Applications/Xpra.app/Contents/Resources/lib/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file), '/Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so' (no such file) (gdk-pixbuf-error-quark, 5)
fish: Job 1, 'xpra' terminated by signal SIGABRT (Abort)

I'm not entirely sure if it's exactly the same problem, since the other messages here do not mention ensure_surface_for_gicon

I was able to work around this issue about missing /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so:

cd /Applications/Xpra.app/Contents/Resources
sudo ln -s ../Resources Resources

This will make the errors go away and xpra works well! (MacOS 14.5 on M3 Max)

@ilyagr
Copy link

ilyagr commented May 27, 2024

I was able to work around this issue about missing /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so:

cd /Applications/Xpra.app/Contents/Resources
sudo ln -s ../Resources Resources

That workaround worked great for me, Xpra started at least. Thank you very much!

It seems like this should be quite fixable then.

@totaam
Copy link
Collaborator

totaam commented May 28, 2024

I've added this symlink to the build script: 03de726 :

#fix for:
# /Applications/Xpra.app/Contents/Resources/bin/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
pushd $RSCDIR
ln -sf ../Resources ./Resources
popd

And since this problem was critical, I've pushed this change to v6.x and the latest stable downloads have been updated to point to this version: 6.0.1-r3
Or you can also grab 6.1-r35837 or later from the beta repo: https://xpra.org/beta/

Can I close this ticket?

@ilyagr
Copy link

ilyagr commented May 28, 2024

Thank you! AFAIC, feel free to close this, or to wait until somebody gets down to the underlying problem that caused the path to be wrong. In principle, there could be more wrong paths causing more subtle issues.

I am still having trouble, but of a different kind. Xpra can start, show a splash screen on the xpra start ssh://host --start xterm command, and claims to connect to the Linux remote (running inside https://lima-vm.io/), but the requested xterm screen never shows. I'll check if there's another bug filed about that.

$ # On the host
$ xpra start ssh://lima-debian --ssh="ssh -F /Users/ilyagr/.lima/debian/ssh.config" --start meld
grep: /usr/share/locale/locale.alias: No such file or directory
grep: /usr/share/locale/locale.alias: No such file or directory

2024-05-28 13:57:11,502 Xpra GTK3 client version 6.0.1-r0
2024-05-28 13:57:11,518  running on Mac OS X 14.4.1
2024-05-28 13:57:11,518  cpython 3.11
grep: /usr/share/locale/locale.alias: No such file or directory
2024-05-28 13:57:11,840 GStreamer version 1.22.9
2024-05-28 13:57:11,864 created unix domain sockets:
2024-05-28 13:57:11,864  '/Users/ilyagr/.xpra/clients/macaw.local-19733'
2024-05-28 13:57:11.935 Xpra[19733:22195690] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

(Xpra:19733): Gtk-CRITICAL **: 13:57:11.940: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
2024-05-28 13:57:11,952  keyboard settings: layout=us
2024-05-28 13:57:11,957  desktop size is 2592x1920:
2024-05-28 13:57:11,957   macaw.local (320x4834 mm - DPI: 205x10)
2024-05-28 13:57:11,957     1                1080x1920 at 1512x0    (340x598 mm - DPI: 81x82) workarea: 1080x1895 at 1512x25
2024-05-28 13:57:11,957     monitor 2        1512x982  at    0x643  (301x195 mm - DPI: 128x128) workarea: 1456x944  at   56x681
Entering daemon mode; any further errors will be reported to:
  /run/user/501/xpra/S2910.log
Actual display used: :1
Actual log file name is now: /run/user/501/xpra/:1.log
$ # On the remote
$ tail /run/user/501/xpra/:1.log
2024-05-28 13:57:23,719  failed to parse bencode packet
2024-05-28 13:57:23,822 13.6GB of system memory
2024-05-28 13:57:24,609 New unix-domain connection received
2024-05-28 13:57:24,609  on '/home/ilyagr.linux/.xpra/lima-debian-1'
2024-05-28 13:57:24,609 New unix-domain connection received
2024-05-28 13:57:24,610  on '/run/user/501/xpra/lima-debian-1'
2024-05-28 13:57:25,231 Warning: remote clipboard request timed out
2024-05-28 13:57:25,231  request id 0, selection=CLIPBOARD, target=TARGETS
2024-05-28 13:57:25,233 Warning: remote clipboard request timed out
2024-05-28 13:57:25,233  request id 1, selection=PRIMARY, target=TARGETS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macos packaging
Projects
None yet
Development

No branches or pull requests