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

Allow using the kiosk on platforms without DBus #159

Closed
wants to merge 3 commits into from

Conversation

knuton
Copy link
Member

@knuton knuton commented May 2, 2024

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.

Checklist

  • Changelog updated
  • Code documented
  • User manual updated

@knuton
Copy link
Member Author

knuton commented May 2, 2024

@krksgbr Are you able to run the kiosk on macOS with these changes?

@knuton knuton force-pushed the multi-platform-kiosk branch 10 times, most recently from 06fe495 to 8511097 Compare May 3, 2024 09:22
@knuton
Copy link
Member Author

knuton commented May 3, 2024

I tried to add a simple smoke test to verify that the kiosk can run on macOS, but there seems to be another error after the proxy/DBus issue is resolved.

I am not sure whether this is due to something in the GitHub runner env, or an additional problem with running on macOS.

This PR is blocked until a macOS user looks at it on their machine.

@knuton knuton added the details needed Further information requested to better evaluate changes label May 3, 2024
@krksgbr
Copy link
Contributor

krksgbr commented May 16, 2024

Strangely, I can't build the nix-shell of the kiosk on macOS. I'm not sure what's different in my environment from GitHub's runner's, but it's already surprising that it matters.

I tried different versions of nixpkgs: 24.05-pre, the 23.11-darwin branch, but they also didn't work.

What's also strange is that attempting to build the shell produced two different errors for the same derivation on two different attempts.

First run:

> Running phase: pythonImportsCheckPhase
> Executing pythonImportsCheckPhase
> Check whether the following modules can be imported: PyQt6.QtWebEngineCore PyQt6.QtWebEngineQuick PyQt6.QtWebEngineWidgets
> /nix/store/4gj9qic1i6dd004f2zgqlmjjxd0qsclc-python-imports-check-hook.sh/nix-support/setup-hook: line 10:  4118 Killed: 9               /nix/store/2inzdrr9fql5512ykfzp32zgr4ss7bma-python3-3.11.8/bin/python3.11 -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ["pythonImportsCheck"].split()))'
For full logs, run 'nix log /nix/store/lghg9h6h7h42nn30bd3xb3kciab09zr0-python3.11-PyQt6_WebEngine-6.6.0.drv'.

Second run:

ERROR Backend subprocess exited when trying to invoke build_wheel
error: builder for '/nix/store/lghg9h6h7h42nn30bd3xb3kciab09zr0-python3.11-PyQt6_WebEngine-6.6.0.drv' failed with exit code 1;
       last 10 log lines:
       > rm -f QtWebEngineCore
       > clang++ -stdlib=libc++ -undefined dynamic_lookup -bundle -o QtWebEngineCore sipQtWebEngineCorecmodule.o sipQtWebEngineCoreQMap0100QByteArray0100QByteArray.o sipQtWebEngineCoreQHash0100QByteArray0100QByteArray.o sipQtWebEngineCoreQList0100QWebEngineScript.o sipQtWebEngineCoreQMultiMap0100QByteArray0100QByteArray.o sipQtWebEngineCoreQMap0100QString0100QString.o sipQtWebEngineCoreQList0100QWebEngineHistoryItem.o sipQtWebEngineCoreQFlags0100QWebEngineUrlSchemeFlag.o sipQtWebEngineCoreQFlags0100QWebEnginePageFindFlag.o sipQtWebEngineCoreQFlags0100QWebEngineFileSystemAccessRequestAccessFlag.o sipQtWebEngineCoreQFlags0100QWebEngineContextMenuRequestMediaFlag.o sipQtWebEngineCoreQFlags0100QWebEngineContextMenuRequestEditFlag.o sipQtWebEngineCoreQWebEngineUrlSchemeHandler.o sipQtWebEngineCoreQWebEngineUrlScheme.o sipQtWebEngineCoreQWebEngineUrlRequestJob.o sipQtWebEngineCoreQWebEngineUrlRequestInterceptor.o sipQtWebEngineCoreQWebEngineUrlRequestInfo.o sipQtWebEngineCoreQWebEngineSettings.o sipQtWebEngineCoreQWebEngineScriptCollection.o sipQtWebEngineCoreQWebEngineScript.o sipQtWebEngineCoreQWebEngineRegisterProtocolHandlerRequest.o sipQtWebEngineCoreQWebEngineQuotaRequest.o sipQtWebEngineCoreQWebEngineProfile.o sipQtWebEngineCoreQWebEnginePage.o sipQtWebEngineCoreQWebEngineNotification.o sipQtWebEngineCoreQWebEngineNewWindowRequest.o sipQtWebEngineCoreQWebEngineNavigationRequest.o sipQtWebEngineCoreQWebEngineLoadingInfo.o sipQtWebEngineCoreQWebEngineHttpRequest.o sipQtWebEngineCoreQWebEngineHistory.o sipQtWebEngineCoreQWebEngineHistoryModel.o sipQtWebEngineCoreQWebEngineHistoryItem.o sipQtWebEngineCoreQWebEngineGlobalSettingsDnsMode.o sipQtWebEngineCoreQWebEngineGlobalSettings.o sipQtWebEngineCoreQWebEngineFullScreenRequest.o sipQtWebEngineCoreQWebEngineFindTextResult.o sipQtWebEngineCoreQWebEngineFileSystemAccessRequest.o sipQtWebEngineCoreQWebEngineDownloadRequest.o sipQtWebEngineCoreQWebEngineCookieStoreFilterRequest.o sipQtWebEngineCoreQWebEngineCookieStore.o sipQtWebEngineCoreQWebEngineContextMenuRequest.o sipQtWebEngineCoreQWebEngineClientCertificateStore.o sipQtWebEngineCoreQWebEngineClientCertificateSelection.o sipQtWebEngineCoreQWebEngineCertificateError.o  -F/nix/store/0dc1zcczqabfhxvk6drdm27ynrzq83bf-qtwebengine-6.6.1/lib -F/nix/store/hfds24mlnlvrpjqg3sqmp9r9fdk2zwzb-qtdeclarative-6.6.1/lib -F/nix/store/vc0w6gjdvhhvdny563bd86vazcgny96d-qtbase-6.6.1/lib -F/nix/store/zkhizkq76s7zlf39a4wji93mdkgx1mih-qtwebchannel-6.6.1/lib -F/nix/store/achvrh9q66lkwi22lmn8f661f3z4lkws-qtpositioning-6.6.1/lib -framework QtWebEngineCore /nix/store/hfds24mlnlvrpjqg3sqmp9r9fdk2zwzb-qtdeclarative-6.6.1/lib/QtQuick.framework/Versions/A/QtQuick /nix/store/hfds24mlnlvrpjqg3sqmp9r9fdk2zwzb-qtdeclarative-6.6.1/lib/QtQmlModels.framework/Versions/A/QtQmlModels /nix/store/zkhizkq76s7zlf39a4wji93mdkgx1mih-qtwebchannel-6.6.1/lib/QtWebChannel.framework/Versions/A/QtWebChannel /nix/store/hfds24mlnlvrpjqg3sqmp9r9fdk2zwzb-qtdeclarative-6.6.1/lib/QtQml.framework/Versions/A/QtQml /nix/store/achvrh9q66lkwi22lmn8f661f3z4lkws-qtpositioning-6.6.1/lib/QtPositioning.framework/Versions/A/QtPositioning -framework QtQuick -framework QtOpenGL -framework QtGui -framework AppKit -framework ImageIO -framework Metal -framework QtQmlModels -framework QtWebChannel -framework QtQml -framework QtNetwork -framework QtPositioning -framework QtCore -framework IOKit -framework DiskArbitration -framework AGL -framework OpenGL
       > /nix/store/c4nif4ydhhsdnjal038wkmi4x3mz88ff-clang-wrapper-16.0.6/bin/ld: line 269:  7182 Killed: 9               /nix/store/8kkn9qqg1mnny41cc8i33ws9ilmxyww1-cctools-binutils-darwin-16.0.6-973.0.1/bin/ld @<(printf "%q\n" ${extraBefore+"${extraBefore[@]}"} ${params+"${params[@]}"} ${extraAfter+"${extraAfter[@]}"})
       > clang-16: error: linker command failed with exit code 137 (use -v to see invocation)
       > make[1]: *** [Makefile:367: QtWebEngineCore.plugin/Contents/MacOS/QtWebEngineCore] Error 1
       > make[1]: Leaving directory '/private/tmp/nix-build-python3.11-PyQt6_WebEngine-6.6.0.drv-0/tmpr8tnaost/QtWebEngineCore'
       > make: *** [Makefile:52: sub-QtWebEngineCore-make_first-ordered] Error 2
       > _in_process.py: 'make' failed returning 2
       >
       > ERROR Backend subprocess exited when trying to invoke build_wheel
       For full logs, run 'nix log /nix/store/lghg9h6h7h42nn30bd3xb3kciab09zr0-python3.11-PyQt6_WebEngine-6.6.0.drv'.

I'll continue investigating.

@krksgbr
Copy link
Contributor

krksgbr commented May 16, 2024

The same issue is reported here:
NixOS/nixpkgs#275464

According to one of the comments it's an aarch64-darwin specific problem.
Unfortunately there's not enough information to get further with this and currently it doesn't seem pressing for us to dig deeper.

@krksgbr
Copy link
Contributor

krksgbr commented May 16, 2024

clang-16: error: linker command failed with exit code 137 (use -v to see invocation)
This seems to be an out of memory error. I'm building on a machine with 32GB of RAM so that's interesting.

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.
@knuton
Copy link
Member Author

knuton commented May 24, 2024

I rebased after #164 being merged, maybe this helps somehow.

@krksgbr
Copy link
Contributor

krksgbr commented May 29, 2024

I rebased after #164 being merged, maybe this helps somehow.

Unfortunately this didn't help as it's the webengine bindings that fail to build.

@krksgbr
Copy link
Contributor

krksgbr commented Jun 7, 2024

@knuton I've amended your work here and created a separate shell for running the kiosk on macOS:

knuton/playos@multi-platform-kiosk...krksgbr:playos:kiosk-on-macos

This gets the job done until the upstream issues are fixed. How should we proceed? Should I push my changes to this PR or should I open a new one?

@knuton
Copy link
Member Author

knuton commented Jun 10, 2024

Cool 👌

As your approach goes well beyond the goal of this PR, which only aimed to address the proxy issue, I think a new PR would make sense.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants