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

Partial support for macOS and Windows #1971

Merged
merged 13 commits into from
Nov 28, 2023
Merged

Conversation

markopy
Copy link
Contributor

@markopy markopy commented Jan 22, 2023

This PR is related to #1244 and #1586 and adds support for macOS and potentially Windows (untested, see below) by using a platform independent library (https://github.com/libusb/hidapi) for device access. Solaar will be able to pair and configure devices but the rule and diversion system will not work because it is Linux specific and not really portable.

macOS

For macOS all dependencies can be installed via homebrew: brew install hidapi gtk+3 pygobject3

Windows

This PR should also support Windows without any further changes but I don't have the environment to test this. If someone wants to give this a try the first step would be to obtain the hdiapi DLL from https://github.com/libusb/hidapi/releases and check that the command line interface works.

Getting the GUI to work requires GTK which seems non-trivial to install on windows. The starting point for this would be https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-getting-started

This was referenced Jan 24, 2023
@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

Please fix up the style errors caught by the pre-commit scripts. Ideally you should set up git to run them when you check in changes on your machine.

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

It would be useful to see whether this port can detect devices on USB and Bluetooth and devices that are not described in lib/logitech_receiver/descriptors.py. Also whether the port can handle devices connected after Solaar start.

@markopy
Copy link
Contributor Author

markopy commented Jan 24, 2023

Please fix up the style errors caught by the pre-commit scripts. Ideally you should set up git to run them when you check in changes on your machine.

I will look into that. I ran isort and flake8 manually but maybe it didn't pick up the right settings for the project.

It would be useful to see whether this port can detect devices on USB and Bluetooth and devices that are not described in lib/logitech_receiver/descriptors.py.

I don't have such devices. Can I test this by just commenting out my devices there and see if they still get picked up?

Also whether the port can handle devices connected after Solaar start.

This works for my usb receiver connected devices. Unplugging the receiver makes the devices disappear and plugging it in again makes them appear correctly.

There is no hotplug notification support in hdiapi at the moment (thought they have semi recent issues about it and some preliminary code). I have implemented this by using a separate thread which enumerates devices periodically and raises events for newly found ones. The polling delay is 5 seconds at the moment which I felt was a good compromise between usability and resource usage. We can change this if you think some other value is better or maybe make it configurable with a command line switch.

@markopy
Copy link
Contributor Author

markopy commented Jan 24, 2023

It would be useful to see whether this port can detect devices on USB and Bluetooth and devices that are not described in lib/logitech_receiver/descriptors.py.

I removed my devices from descriptors.py and they were still picked up while being connected to the receiver which I guess is unsurprising since it doesn't involve the OS.

If I remove my receiver from base_usb.py it still gets picked up correctly as "unknown receiver" in filter_receivers().

Unfortunately I cannot pair my devices directly via bluetooth (seems to be a known issue for my particular MAC) so we will need someone else to test direct Bluetooth and USB connections.

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

One thing to try is to start up Solaar with the receiver disconnected, assuming you can do this, and then plug in the receiver. Will Solaar pick up the receiver?

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

The udev code that Solaar uses has some local edits. I'm planning on cleaning up the udev code to remove these edits and take the functionality back into the main Solaar code. This should help with ports.

@markopy
Copy link
Contributor Author

markopy commented Jan 24, 2023

One thing to try is to start up Solaar with the receiver disconnected, assuming you can do this, and then plug in the receiver. Will Solaar pick up the receiver?

Yes, this works. There is a random delay of up to 5 seconds of course, until the next check for new devices happens.

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

Recognition of newly active devices is done without a timed loop in the current version of Solaar. Where did you add the timed loop?

@markopy
Copy link
Contributor Author

markopy commented Jan 24, 2023

It's in the _DeviceMonitor class in hdiapi.py. I consider this a platform specific implementation detail and once the hdiapi library supports native notifications we can remove the separate monitoring thread.
From Solaar's point of view everything works as it does with udev.py by registering a callback via monitor_glib().

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

Solaar requires R/W access to the raw interface for receivers and devices. How are permissions given to Solaar to allow it to do this?

@pfps
Copy link
Collaborator

pfps commented Jan 24, 2023

Some parts of rules should work in MacOS. As far as I can tell the "only" thing that doesn't work but that works under Wayland is simulating user input. Of course this is a big gap.

@markopy
Copy link
Contributor Author

markopy commented Jan 30, 2023

Solaar requires R/W access to the raw interface for receivers and devices. How are permissions given to Solaar to allow it to do this?

On macOS only keyboard and mouse input devices have special protection. Trying to open them causes a popup with the option to give the application access. I don't think Solaar actually needs to access the keyboard and mouse input though so I have added a check which filters these devices out. No special permissions are then needed to run Solaar and it can still access the Logitech HID++ usage pages.

@markopy
Copy link
Contributor Author

markopy commented Jan 30, 2023

Some parts of rules should work in MacOS. As far as I can tell the "only" thing that doesn't work but that works under Wayland is simulating user input. Of course this is a big gap.

I think that's right. I haven't really looked into the rules code because I didn't have an immediate need for it but it might be possible to support most or even all of it without much effort. I might look into this when I have a bit more time.

@pfps
Copy link
Collaborator

pfps commented Feb 16, 2023

It would be good to have someone else run this PR on a mac.

@mahfoozm
Copy link

When trying to run the PR on a mac (M2 air, 13.1), I would receive the following error:

solaar: missing required system package python3-pyudev

After adding a platform check before loading the module, it appears that basic functionality is working on Mac.

Screenshot 2023-02-19 at 6 40 24 PM

I can change DPI, enable/disable onboard profiles, and change polling rate. Battery Level also matches up with values reported on Linux and in G Hub. Devices are discovered as they are plugged in and disappear when removed from the system, seamlessly.

@pfps
Copy link
Collaborator

pfps commented Feb 20, 2023

Excellent.

@Dak0r
Copy link

Dak0r commented Feb 21, 2023

Hi, I just gave it a shot.
With the current version, I also get the solaar: missing required system package python3-pyudev error on my Intel Mac.
@mahfoozm s fork is broken for me, due to a missing hidapi.py file in the hidapi lib folder.

So I quickly hacked together, his platform checks with this branch and now the CLI is working fine for me :)
I didn't go far enough to get the UI, running, yet.

@pfps
Copy link
Collaborator

pfps commented Feb 21, 2023

@markopy I have a suggested change to leave the rules button in, as rules will partly work.

@mahfoozm
Copy link

Hi, I just gave it a shot. With the current version, I also get the solaar: missing required system package python3-pyudev error on my Intel Mac. @mahfoozm s fork is broken for me, due to a missing hidapi.py file in the hidapi lib folder.

So I quickly hacked together, his platform checks with this branch and now the CLI is working fine for me :) I didn't go far enough to get the UI, running, yet.

  • Oops, forgot to track that file before committing. Fixed.

@Dak0r
Copy link

Dak0r commented Feb 22, 2023

@mahfoozm fork is now working fine!

The CLI & Ui now seems to work right away on macOS with devices connected via a unifying receiver.
It currently doesn't seem to pick up the same devices if connected via Bluetooth (MX Keys and original MX Master).

To get the UI working, I had to install psutil via pip pip3 install psutil.
If I switch my devices between bluetooth and unifying receiver, i can see the ui being updated in real time.
Battery level seems to work, and I can also edit settings and see them take effect right away.

On Windows, I'm getting this error after adding hidapi.dll to PATH:

PS C:\Dev\Solaar-macOS-support-master\bin> python.exe .\solaar show
solaar: error: Traceback (most recent call last):
  File "C:\Dev\Solaar-macOS-support-master\lib\solaar\cli\__init__.py", line 202, in run
    c = list(_receivers_and_devices(hidraw_path))
  File "C:\Dev\Solaar-macOS-support-master\lib\solaar\cli\__init__.py", line 118, in _receivers_and_devices
    from logitech_receiver import Device, Receiver
  File "C:\Dev\Solaar-macOS-support-master\lib\logitech_receiver\__init__.py", line 33, in <module>
    from . import listener, status  # noqa: F401
  File "C:\Dev\Solaar-macOS-support-master\lib\logitech_receiver\listener.py", line 25, in <module>
    from . import base as _base
  File "C:\Dev\Solaar-macOS-support-master\lib\logitech_receiver\base.py", line 33, in <module>
    import hidapi as _hid
  File "C:\Dev\Solaar-macOS-support-master\lib\hidapi\__init__.py", line 7, in <module>
    from hidapi.hidapi import close  # noqa: F401
  File "C:\Dev\Solaar-macOS-support-master\lib\hidapi\hidapi.py", line 165, in <module>
    _hidapi.hid_darwin_set_open_exclusive.argtypes = [ctypes.c_int]
  File "C:\Dev\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "C:\Dev\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'hid_darwin_set_open_exclusive' not found

@pfps
Copy link
Collaborator

pfps commented Feb 22, 2023

Solaar detects devices connected to a Logitech receiver by means of messages the receiver emits, so Solaar can see these devices as soon as they are connected. Solaar on Linux detects receivers and devices that connect via USB or Bluetooth by listening for udev notifications. This Mac port uses polling for this and may only poll USB connections, not Bluetooth.

Please try removing and reinserting your receiver and see whether it is removed after a short delay and then reappears, again after a short delay.

@Dak0r
Copy link

Dak0r commented Feb 22, 2023

Please try removing and reinserting your receiver and see whether it is removed after a short delay and then reappears, again after a short delay.

This works as you described it, the receiver disappears and re-appears almost immediately after I reconnected it. I can then also see my kb & mouse reconnecting in the ui

@pfps
Copy link
Collaborator

pfps commented Feb 22, 2023

Good.

But Bluetooth devices don't show up at all in Solaar even if they are actually working on your Mac?

@pfps
Copy link
Collaborator

pfps commented Apr 17, 2023

The logging errors in show.txt may have been fixed. Please download the PR again.

@DaPutzy
Copy link

DaPutzy commented Apr 17, 2023

Indeed.

show.txt
error.txt

Screenshot:

Screenshot 2023-04-17 at 17 59 45

@pfps
Copy link
Collaborator

pfps commented Apr 17, 2023

@DaPutzy Thanks. That's looking quite good.

@pfps
Copy link
Collaborator

pfps commented Apr 17, 2023

@markopy Can you provide @sndri with instructions for Windows?

@markopy
Copy link
Contributor Author

markopy commented Apr 17, 2023

I don't have any specific instructions for Windows beyond the starting points in my initial message for this PR. I don't use Windows and haven't run it there myself.

@rafalbednarczuk
Copy link

On M1 MacBook MacOS 12.6 I built and ran this PR with following:

brew install python3
brew install hidapi
brew install gtk+3 pygobject3
git clone git@github.com:markopy/Solaar.git
cd Solaar
git checkout macos_support 
pip3 install --user '.[report-descriptor,git-commit]'
./bin/solaar

It works both via CLI and GUI.
It detected my K400+ keyboard and allowed me to set fn-swap to 0 both in CLI and GUI which I finally could do after 2 years of having to click on FN button.
If you need any more testing let me know.

@DaPutzy
Copy link

DaPutzy commented Apr 17, 2023

This step is a bit unnecessary when you run it via ./bin/solaar anyway:

pip3 install --user '.[report-descriptor,git-commit]'

Since it installs solaar to ~/.local/bin/, which ideally is in your $PATH and you should be able to it run from everywhere with solaar.

I needed these as well to run it:

pip3 install pyyaml
pip3 install xlib

This is a good starting point: https://pwr-solaar.github.io/Solaar/installation

@rafalbednarczuk
Copy link

One thing that doesn't work for me on MacOS is --restart-on-wake-up option.
When I execute solaar --restart-on-wake-up config 1 fn-swap 0 and the computer sleeps and wakes up, after I login into my profile the config is reverted to default.
Is there any way to fix it on MacOS?

@pfps
Copy link
Collaborator

pfps commented Apr 30, 2023

--restart-on-wake-up should only be used for the Solaar GUI.

If you are not running the GUI then devices will reset to their default state whenever they come back from a power-saving mode. What you should be doing is running solaar and using the Solaar main window to change settings. As long as the Solaar GUI is running, Solaar should monitor devices and push settings to them when they reconnect after going into power-saving modes.

@rafalbednarczuk
Copy link

--restart-on-wake-up should only be used for the Solaar GUI.

If you are not running the GUI then devices will reset to their default state whenever they come back from a power-saving mode. What you should be doing is running solaar and using the Solaar main window to change settings. As long as the Solaar GUI is running, Solaar should monitor devices and push settings to them when they reconnect after going into power-saving modes.

Thanks, I solved my issue by executing Solaar twice on startup, first time without GUI to switch my setting and second time with --window=hide to keep it running in the background.

@pfps
Copy link
Collaborator

pfps commented Apr 30, 2023

It should be the case that only the GUI should be needed as the GUI remembers the last value for settings and applies them at startup and at other points where this might be needed.

@vdurante
Copy link

vdurante commented Aug 7, 2023

The application runs, but no devices are detected. I am trying to connect a G512 through a USB hub.

./solaar -dd show

2023-08-07 13:44:42,365,365     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968753' (None/05AC/8104) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,365,365     INFO [MainThread] hidapi.hidapi: Found device BID None VID 05AC PID 8104 HID++ False False
2023-08-07 13:44:42,366,366     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968751' (None/05AC/8104) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,366,366     INFO [MainThread] hidapi.hidapi: Found device BID None VID 05AC PID 8104 HID++ False False
2023-08-07 13:44:42,372,372     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294969607' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002BC) (iokit/common) general error
2023-08-07 13:44:42,372,372     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,373,373     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968754' (None/05AC/8104) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,373,373     INFO [MainThread] hidapi.hidapi: Found device BID None VID 05AC PID 8104 HID++ False False
2023-08-07 13:44:42,374,374     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968741' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,374,374     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,375,375     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968756' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,375,375     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,376,376     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294970660' (3/05AC/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,376,376     INFO [MainThread] hidapi.hidapi: Found device BID 3 VID 05AC PID 0000 HID++ False False
2023-08-07 13:44:42,376,376     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968755' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,377,377     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,377,377     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294969029' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C2) (iokit/common) invalid argument
2023-08-07 13:44:42,377,377     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,383,383     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294969623' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002BC) (iokit/common) general error
2023-08-07 13:44:42,384,384     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,384,384     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968752' (None/05AC/8104) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,384,384     INFO [MainThread] hidapi.hidapi: Found device BID None VID 05AC PID 8104 HID++ False False
2023-08-07 13:44:42,385,385     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294968757' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,385,385     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,386,386     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294969053' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002C7) (iokit/common) unsupported function
2023-08-07 13:44:42,386,386     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
2023-08-07 13:44:42,392,392     INFO [MainThread] hidapi.hidapi: Error opening device b'DevSrvsID:4294969606' (None/0000/0000) for hidpp check: IOHIDDeviceGetReport failed: (0xE00002BC) (iokit/common) general error
2023-08-07 13:44:42,392,392     INFO [MainThread] hidapi.hidapi: Found device BID None VID 0000 PID 0000 HID++ False False
solaar: error: Traceback (most recent call last):
  File "/Users/vitor/Library/Python/3.11/lib/python/site-packages/solaar/cli/__init__.py", line 206, in run
    raise Exception('No devices found')
Exception: No devices found

@pfps
Copy link
Collaborator

pfps commented Aug 7, 2023

Unfortunately I don't have a Mac to try this PR out on so I can only provide limited assistance.

The messages output do show attempts to connect to various devices but they are failing for some reason that I do not understand.

You might want to try solaar -ddd show to get even more messages.

@vdurante
Copy link

vdurante commented Aug 8, 2023

@pfps thanks for the help. Yeah, it shows the same errors with -ddd. I will maybe attempt to debug the code locally later.

@alexey-chernikov
Copy link

alexey-chernikov commented Aug 23, 2023

PR works fine with Unifying Receiver (devices MX Keys keyboard, M720 Triathlon mouse).
But Solaar doesn't show devices if they are connected via Bluetooth, not via Unifying Receiver

@pfps
Copy link
Collaborator

pfps commented Aug 23, 2023

The interface that is used is only for USB. As I didn't do the port, I don't know what would be required to add Bluetooth support.
I expect that the port will be merged in in the near future so maybe that will get some attention and someone will add Bluetooth support.

@pfps pfps merged commit 29ff35d into pwr-Solaar:master Nov 28, 2023
1 check failed
pfps added a commit to pfps/Solaar that referenced this pull request Nov 28, 2023
* Add support for macOS via hidapi

* Style fixes

* Ignore keyboard and mouse input devices

* Don't require pyudev on mac and windows

* Fix debug log format error

* More logging for failed hidpp checks

* Don't try to load hid_darwin_set_open_exclusive on windows

* Bring back button for rule editor since some rules will work

---------

Co-authored-by: markopy <(none)>
Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
@pfps
Copy link
Collaborator

pfps commented Nov 28, 2023

OK I finally got around to checking that this PR doesn't do anything bad on Linux and then merged it.

@WWWFWWW
Copy link

WWWFWWW commented Dec 26, 2023

Can't get it to build on Mac OS (Sonoma, M1).

Cloned the main repo, tried pip3 install --user '.[report-descriptor,git-commit]'

and it broke on patchelf:

        [ 11%] Creating directories for 'build_patchelf'
        [ 22%] No download step for 'build_patchelf'
        [ 33%] No update step for 'build_patchelf'
        [ 44%] Performing patch step for 'build_patchelf'
        ./bootstrap.sh: line 2: autoreconf: command not found
        make[2]: *** [build_patchelf-prefix/src/build_patchelf-stamp/build_patchelf-patch] Error 127
        make[1]: *** [CMakeFiles/build_patchelf.dir/all] Error 2
        make: *** [all] Error 2
        Traceback (most recent call last):
          File "/private/var/folders/r5/.../T/pip-build-env-hvendzem/overlay/lib/python3.12/site-packages/skbuild/setuptools_wrap.py", line 674, in setup
            cmkr.make(make_args, install_target=cmake_install_target, env=env)
          File "/private/var/folders/r5/g48wy3597sb5pk1y078hdjy80000gn/T/pip-build-env-hvendzem/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 697, in make
            self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
          File "/private/var/folders/r5/g48wy3597sb5pk1y078hdjy80000gn/T/pip-build-env-hvendzem/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 742, in make_impl
            raise SKBuildError(msg)
              An error occurred while building with CMake.
          Command:
            /opt/homebrew/bin/cmake --build . --target install --config Release --
          Install target:
            install
          Source directory:
            /private/var/folders/r5/g48wy3597sb5pk1y078hdjy80000gn/T/pip-install-hoouzb5t/patchelf_bd2d5cc251d44de581a28ab6c415bcbf
          Working directory:
            /private/var/folders/r5/g48wy3597sb5pk1y078hdjy80000gn/T/pip-install-hoouzb5t/patchelf_bd2d5cc251d44de581a28ab6c415bcbf/_skbuild/macosx-14.0-arm64-3.12/cmake-build
        Please check the install target is valid and see CMake's output for more information.
  
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for patchelf
  Failed to build patchelf
  ERROR: Could not build wheels for patchelf, which is required to install pyproject.toml-based projects
  [end of output]

Am I doing something wrong? I even tried it in a completely clean Sonoma virtual install, with just Homebrew and Python, no change. Cheers.

@pfps
Copy link
Collaborator

pfps commented Dec 26, 2023

@markopy Can you figure out what is going wrong here?

@alexey-chernikov
Copy link

alexey-chernikov commented Dec 27, 2023

Can't get it to build on Mac OS (Sonoma, M1).

Cloned the main repo, tried pip3 install --user '.[report-descriptor,git-commit]'
...
./bootstrap.sh: line 2: autoreconf: command not found
make[2]: *** [build_patchelf-prefix/src/build_patchelf-stamp/build_patchelf-patch] Error 127
make[1]: *** [CMakeFiles/build_patchelf.dir/all] Error 2
....


Am I doing something wrong? I even tried it in a completely clean Sonoma virtual install, with just Homebrew and Python, no change. Cheers.

@WWWFWWW You are missing autoreconf command on your machine,

brew install automake autoconf

should help with it

@WWWFWWW
Copy link

WWWFWWW commented Jan 18, 2024

@WWWFWWW You are missing autoreconf command on your machine,

brew install automake autoconf

should help with it

@alexey-chernikov

Thanks, but I am still at a loss. Even after that, I get errors with patchelf:

foo.c:5:65: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma

I'd pretty much love to get it working, as I suspect plenty of Mac users would love using Solaar (the Logitech app for Mac is really abysmal, and that's an understatement). Yet I think the few people here who apparently got it working are not running a default environment, but are devs so their homebrew and python installed packages might somewhat differ.

I'd love to help testing it and getting it to run, but at this point I am simply at a dead end, sorry.

@barrett7212
Copy link

@WWWFWWW

Thanks, but I am still at a loss. Even after that, I get errors with patchelf:

foo.c:5:65: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma

I'm seeing the same on an M2 Max running Sonoma 14.2.1.

If anyone needs me to test a fix, let me know, but also hit a speed bump here.

@kocoman2
Copy link

kocoman2 commented Feb 6, 2024

what to dl for windows? thx

@pfps
Copy link
Collaborator

pfps commented Feb 6, 2024

Someone will have to do some work to get the windows port working. See PR #2165 for more information.

@widewing
Copy link

widewing commented Feb 8, 2024

@WWWFWWW You are missing autoreconf command on your machine,

brew install automake autoconf

should help with it

@alexey-chernikov

Thanks, but I am still at a loss. Even after that, I get errors with patchelf:

foo.c:5:65: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma

I'd pretty much love to get it working, as I suspect plenty of Mac users would love using Solaar (the Logitech app for Mac is really abysmal, and that's an understatement). Yet I think the few people here who apparently got it working are not running a default environment, but are devs so their homebrew and python installed packages might somewhat differ.

I'd love to help testing it and getting it to run, but at this point I am simply at a dead end, sorry.

I'm in the same boat.

@MattHag
Copy link
Contributor

MattHag commented Feb 11, 2024

I'll play around with with extending the GitHub CI tests to run on Mac, which has the nice side effect, that necessary dependencies are documented. The installation can be simplified to a make command at the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.