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

v1.22.0 pkg fails usage test #17

Open
claybridges opened this issue Apr 24, 2021 · 6 comments
Open

v1.22.0 pkg fails usage test #17

claybridges opened this issue Apr 24, 2021 · 6 comments

Comments

@claybridges
Copy link
Contributor

claybridges commented Apr 24, 2021

On Big Sur 11.2.3.

Steps to reproduce:

  1. Follow instructions in README to uninstall existing.

  2. Follow instructions in README to install 1.22.0.pkg, basically like this:

git clone https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice.git
cd Karabiner-DriverKit-VirtualHIDDevice
open dist/Karabiner-DriverKit-VirtualHIDDevice-1.22.0.pkg
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
  1. Follow instructions in Usage section to test, basically like this:
cd examples/virtual-hid-device-service-client
make
make run

Expected results: Test works
Actual results:

$ make run
sudo ./build/Release/virtual-hid-device-service-client
Password:
Press control+c to quit.
connect_failed asio.system:2
connect_failed asio.system:2
connect_failed asio.system:2
^Cconnect_failed asio.system:2

Have confirmed tests work with pkg 1.15.0 and checked out at tag v1.15.0.

@claybridges claybridges changed the title Big Sur 11.2.3, v1.22.0 pkg fails install test v1.22.0 pkg fails Usage test Apr 24, 2021
@claybridges claybridges changed the title v1.22.0 pkg fails Usage test v1.22.0 pkg fails usage test Apr 24, 2021
@tekezo
Copy link
Member

tekezo commented Apr 25, 2021

I cannot reproduce this issue.
Are there any error messages in /var/log/karabiner/virtual_hid_device_service.log?

@claybridges
Copy link
Contributor Author

claybridges commented Apr 25, 2021

Just retried. Here's the log:

virtual_hid_device_service.log

And here's the command line:

$ make run
sudo ./build/Release/virtual-hid-device-service-client
Password:
Press control+c to quit.
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
^Cconnect_failed asio.system:61

Different asio error this time... ¯\_(ツ)_/¯ .

@claybridges
Copy link
Contributor Author

Test #2/more info:

  • load the generated .xcodeproj into Xcode
  • add default scheme
  • set to run as root
  • run

And it works fine. Still fails via make run.

@tekezo
Copy link
Member

tekezo commented Apr 25, 2021

Thank you for your confirmation!
It seems Karabiner-DriverKit-VirtualHIDDevice services works well on your machine.
So I guess this issue is caused by version mismatch of example code.

Although I try to avoid it, incompatible changes are sometimes made in the client libraries.
v1.16.0 changed the file name of the UNIX domain socket used for communication.
Due to this change, previous example code cannot communicate with the v1.22.0 driver.

Please upgrade to your repository and build examples again.

@claybridges
Copy link
Contributor Author

claybridges commented Apr 25, 2021

I always run the repo code vs. the correct package (per the commit tag), E.g. commit tag v1.22.0 vs. dist/Karabiner-DriverKit-VirtualHIDDevice-1.22.0.pkg.

This session is present master branch vs. 1.22.0, which should be OK, right?:

$ git show
commit 88d989a2cf0e4594f88fe995d7d74e3f958afe58 (HEAD -> master, upstream/master, upstream/HEAD, origin/master)
Merge: 39b1fca 682f76e
Author: Takayama Fumihiko <tekezo@pqrs.org>
Date:   Sun Apr 25 13:45:49 2021 +0900

    Merge pull request #16 from claybridges/claybridges-docs-add-xcodegen
    
    Fix README by adding `brew install xcodegen`

$ pwd
/Users/clay/dev/exo/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client
$ defaults read /Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/Info.plist CFBundleVersion
1.22.0
$ make
/usr/bin/python3 ../../scripts/update-version.py
xcodegen generate
⚙️  Generating plists...
⚙️  Generating project...
⚙️  Writing project...
Created project at /Users/clay/dev/exo/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/virtual-hid-device-service-client.xcodeproj
xcodebuild -configuration Release -alltargets SYMROOT="/Users/clay/dev/exo/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/build"
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release -alltargets SYMROOT=/Users/clay/dev/exo/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/build

Build settings from command line:
    SYMROOT = /Users/clay/dev/exo/Karabiner-DriverKit-VirtualHIDDevice/examples/virtual-hid-device-service-client/build

note: Using new build system
note: Planning build
note: Constructing build description
** BUILD SUCCEEDED ** [1.178 sec]

$ make run
sudo ./build/Release/virtual-hid-device-service-client
Press control+c to quit.
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
connect_failed asio.system:61
^C

Logs from this run:

[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] virtual_hid_device_service_clients_manager (pointing) client is removed (size: 0)
[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] terminate_virtual_hid_pointing_io_service_client
[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] driver_version_ is changed: std::nullopt
[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] virtual_hid_pointing_ready_ is changed: std::nullopt
[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] virtual_hid_device_service_clients_manager (keyboard) client is removed (size: 0)
[2021-04-25 13:21:09.630] [info] [virtual_hid_device_service] terminate_virtual_hid_keyboard_io_service_client
[2021-04-25 13:21:09.631] [info] [virtual_hid_device_service] driver_version_ is changed: std::nullopt
[2021-04-25 13:21:09.631] [info] [virtual_hid_device_service] virtual_hid_keyboard_ready_ is changed: std::nullopt

@tekezo
Copy link
Member

tekezo commented Apr 26, 2021

Thank you for detailed information!

Hmm, it seems the binary is not rebuilded.
Does executing make clean before make solves this issue?

make clean
make
make run

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

No branches or pull requests

2 participants