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

Kiosk development environment for macOS #167

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

krksgbr
Copy link
Contributor

@krksgbr krksgbr commented Jun 10, 2024

Follow up on #159 to make the kiosk run without DBus.

The pyqt webengine bindings in nixpkgs are currently broken on darwin, so I created a separate development shell for macOS which makes use of virtualenv and poetry to manage dependencies.

I'm requesting two reviews to test on both nixOS and macOS.

To run the kiosk on macOS:

cd kiosk
nix-shell ./macos/shell.nix
bin/kiosk-browser http://localhost:8080/play.html http://localhost:3333

Checklist

  • [ ] Changelog updated
  • Code documented

knuton and others added 10 commits May 24, 2024 10:46
Executing another bash inside the shell hook seems to break running
commands with `nix-shell --run`, something we assumed to work in the CI
configuration.

It seems that the Qt wrapper is already set up at least in modern
Nixpkgs, so we can simply remove the code for spawning the wrapped bash.
We previously added support for using the kiosk without connman
installed, but it still crashed when started on systems without DBus
(i.e. any non-Linux platform).

With this change we add a stub implementation of the core proxy
abstraction, which is going to provide safe no-op responses on non-Linux
platforms, allowing to use the kiosk, albeit without proxy support.
To avoid pulling in dbus stuff on MacOS altogether.
This sets up a development environment for the kiosk on macOS, as the
default nix-shell is currently broken due to upstream issues with the
`pyqt6-webengine` package.

The environment is managed using virtualenv and the `poetry` package
manager instead.
@krksgbr krksgbr requested review from knuton and stoeffel June 10, 2024 08:04
@krksgbr krksgbr added reviewable Ready for initial or iterative review double-review Tricky or high stake, should receive two reviews labels Jun 10, 2024
Copy link
Member

@knuton knuton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

One small suggestion after code review. I am still going to perform practical tests.

Comment on lines 18 to 25
if platform.system() in ['Darwin']:
from kiosk_browser.proxy import Proxy
import os
system = System(name = "PlayOS",
version = os.getenv("PLAYOS_VERSION","1.0.0-dev"))
else:
from kiosk_browser.dbus_proxy import DBusProxy as Proxy
system = System()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we moved this branching to the system module/System class?

It could offer something like a def infer() -> System function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knuton knuton added changes suggested Asking for changes before next round of reviewing and removed reviewable Ready for initial or iterative review labels Jun 10, 2024
@krksgbr krksgbr added reviewable Ready for initial or iterative review and removed changes suggested Asking for changes before next round of reviewing labels Jun 10, 2024
@stoeffel
Copy link
Contributor

Yay! Works on my machine!

Copy link
Contributor

@stoeffel stoeffel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my machine!

I have no context on the code, but the changes look reasonable to me.

@knuton knuton added details needed Further information requested to better evaluate changes and removed reviewable Ready for initial or iterative review labels Jun 11, 2024
@knuton
Copy link
Member

knuton commented Jun 11, 2024

I seem to have found a problem on Linux, which is due to the Qt6 migration, not this PR. I am going to open a PR against the release branch. Otherwise this also looks good to me.

Looks like a one line fix, which we can then apply here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
details needed Further information requested to better evaluate changes double-review Tricky or high stake, should receive two reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants