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

Does not work on Chromebook Linux VM #1676

Closed
rumplestilzken opened this issue Jan 28, 2024 · 14 comments
Closed

Does not work on Chromebook Linux VM #1676

rumplestilzken opened this issue Jan 28, 2024 · 14 comments
Labels
bug Issue: Something isn't working

Comments

@rumplestilzken
Copy link

I have tried the appimage, the .deb and remotely using novelWriter over ssh on a machine where novelWriter has proven to work.

After the application fails to boot, i pressed CTRL+C to end it and get this message.

Environment:
novelWriter Version: 2.2
Host OS: linux (5.15.0-91-generic)
Python: 3.10.12 (0x30a0cf0)
Qt: 5.15.3, PyQt: 5.15.6
enchant: 3.2.0

KeyboardInterrupt:

Traceback:
File "/usr/lib/python3/dist-packages/novelwriter/guimain.py", line 1269, in _timeTick
@pyqtSlot()

@rumplestilzken rumplestilzken added the bug Issue: Something isn't working label Jan 28, 2024
@rumplestilzken
Copy link
Author

I also needed to install the font package from https://fonts.google.com/specimen/Ubuntu?query=ubuntu to ~/.fonts to get past an "unknown font ''" exception.

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

The traceback is just recording your Ctrl+C keyboard interrupt , so it is not telling me anything at all. I have nothing to go on here. I'm not familiar with Chromebooks and the Linux running on it, so I have no idea how to proceed here. It is not an officially supported platform, but I'm happy to fix issues if we can figure out what the problem is.

If the AppImage fails, I'm suspecting it has some issue with some resource. Could you try to run novelWriter from the command line in debug mode?

./novelWriter-2.2.AppImage --debug

One thing I know novelWriter cannot work with is a mounted Google Drive.

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

I also needed to install the font package from https://fonts.google.com/specimen/Ubuntu?query=ubuntu to ~/.fonts to get past an "unknown font ''" exception.

That's curious. If no font is set in the config, novelWriter loads the font your system is claiming is the default font via the Qt library as reported by QApplication.font(). It is surprising if it isn't available.

The font it tries to load should be printed to the debug log output as GUI Font Family, near the top of the output.

@rumplestilzken
Copy link
Author

rumplestilzken commented Jan 28, 2024 via email

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

Correction about the font:

It relies on QFontDatabase.systemFont(QFontDatabase.GeneralFont). It is handled here:

def _setGuiFont(self) -> None:
"""Update the GUI's font style from settings."""
theFont = QFont()
fontDB = QFontDatabase()
if CONFIG.guiFont not in fontDB.families():
if CONFIG.osWindows and "Arial" in fontDB.families():
# On Windows we default to Arial if possible
theFont.setFamily("Arial")
theFont.setPointSize(10)
else:
theFont = fontDB.systemFont(QFontDatabase.GeneralFont)
CONFIG.guiFont = theFont.family()
CONFIG.guiFontSize = theFont.pointSize()
else:
theFont.setFamily(CONFIG.guiFont)
theFont.setPointSize(CONFIG.guiFontSize)
qApp.setFont(theFont)
return

@rumplestilzken
Copy link
Author

I reopened the terminal, and had previously tried the pip installation as well, but it did not reload the path. I had not uninstalled it as i did the others.

The pip installation works without an issue, i ran it in debug mode, and it started right up.
I ran it in regular mode, and it started right up.

If you want to pursue this issue further, i am happy to test, I'm more familiar with running linux applications on a chromebook than most and am also dev.

@rumplestilzken
Copy link
Author

rumplestilzken commented Jan 28, 2024

Correction about the font:

It relies on QFontDatabase.systemFont(QFontDatabase.GeneralFont). It is handled here:

def _setGuiFont(self) -> None:
"""Update the GUI's font style from settings."""
theFont = QFont()
fontDB = QFontDatabase()
if CONFIG.guiFont not in fontDB.families():
if CONFIG.osWindows and "Arial" in fontDB.families():
# On Windows we default to Arial if possible
theFont.setFamily("Arial")
theFont.setPointSize(10)
else:
theFont = fontDB.systemFont(QFontDatabase.GeneralFont)
CONFIG.guiFont = theFont.family()
CONFIG.guiFontSize = theFont.pointSize()
else:
theFont.setFamily(CONFIG.guiFont)
theFont.setPointSize(CONFIG.guiFontSize)
qApp.setFont(theFont)
return

The curious part is, when i pressed CTRL+C the application booted to the main window (not the initial window on new installations for release notes) and had to be forcibly closed. Even when it said it couldn't find the font. You just couldn't use it.

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

So, there's only an issue with the AppImage then? Which may be resource access, or system defaults or something like that. I am not very familiar with AppImages myself. It was a contributed feature to novelWriter.

I'm glad the pip install works. Perhaps it integrates better with the system?

@rumplestilzken
Copy link
Author

No, the .deb didn't work either.

I was very pleasantly surprised to see it boot up from the pip installation.

As far as the google drive goes, i went a separate route and am tracking my projects with git and private github repositories. I like the idea of using a proper version manager, and having it off site is a plus.

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

The curious part is, when i pressed CTRL+C the application booted to the main window (not the initial window on new installations for release notes) and had to be forcibly closed. Even when it said it couldn't find the font. You just couldn't use it.

Yeah, the Qt library is C++ and novelWriter is Python, so depending on which side of the divide an issue arises, only a part of it may crash. Since novelWriter usually traps exceptions, it is rare for it to fully crash. I have a custom exception hook that will try to save your data and shut down in a controlled manner when an unhandled exception occurs, which includes a Ctril+C. However, if the Qt GUI thread is unresponsive, it may get stuck.

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

No, the .deb didn't work either.

I was very pleasantly surprised to see it boot up from the pip installation.

Did you install in a venv or Conda env? The .deb install is essentially the same as a root pip install.

As far as the google drive goes, i went a separate route and am tracking my projects with git and private github repositories. I like the idea of using a proper version manager, and having it off site is a plus.

Yeah, the virtual file system implementation has some weird mapping between filename and some underlying ID that causes issues in novelWriter. I tried to debug it at some point, but I can't remember what the actual problem was.

@rumplestilzken
Copy link
Author

Feel free to close the ticket, thanks for your help and quick response.

If you'd like a little bit of help with some of the development contact me, I have a working knowledge of Python, C++ and PyQt5

@rumplestilzken
Copy link
Author

Did you install in a venv or Conda env? The .deb install is essentially the same as a root pip install.

Nope, just used the command that was on the site pip install --user novelwriter

@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

Feel free to close the ticket, thanks for your help and quick response.

Ok, will do.

If you'd like a little bit of help with some of the development contact me, I have a working knowledge of Python, C++ and PyQt5

Thanks. This here is the exact kind of issues I need assistance with. I use Debian myself, and have Ubuntu and Windows VMs for testing. Anything else, I rely on help from users.

@vkbo vkbo closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants