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

Fix #1333: arch Linux build fails #1353

Merged
merged 6 commits into from
Nov 5, 2022
Merged

Fix #1333: arch Linux build fails #1353

merged 6 commits into from
Nov 5, 2022

Conversation

aryoda
Copy link
Contributor

@aryoda aryoda commented Nov 4, 2022

I have fixed all known issues on our side an try to contact the package maintainer now asking

  • to fix the missing dependencies
  • to reconsider setting LC_ALL=C for makeing

On my arch VM the build & unit tests are working now (after manually installing the required dependencies)...

Fixes #1333

* The name indicates the active Qt platform plugin
  which determines if X11 or wayland is used
* AttributeError: 'dict' object has no attribute 'strip'
* getlocale() returns (None, None) causing join() to throw this RTE:
  TypeError: sequence item 0: expected str instance, NoneType found
… to #1333)

* Bug was introduced with #1337 (write all log output to stderr)
@buhtz
Copy link
Member

buhtz commented Nov 4, 2022

I cloned directly from "aryoda:issue/1333_Arch_build_fails".

Testing on Debian 11 (stable) via ./configure && make && make install && make test runs fine (even in an SSH terminal without X11 or Wayland involved).

I also used my Manjaro VM for testing. When I'm on a temrinal emulator in the desktop environment make test is fine.
But when I log into that same machine via SSH in a real terminal (without X11/Wayland involved) I got an error about QPainter which polutes the output and make a test fail.

I was wondering why Qt is involved here. But I saw that Qt is imported in diagnostics.py.

user@Alf ~/sfd/backintime/common $ make test
python3 -m unittest  -b test/test_applicationinstance.py
...................
----------------------------------------------------------------------
Ran 19 tests in 0.048s

OK
python3 -m unittest  -b test/test_argparser.py
.....................
----------------------------------------------------------------------
Ran 21 tests in 3.355s

OK
python3 -m unittest  -b test/test_backintime.py
WARNING: Failed to connect to Udev serviceHelper daemon via D-Bus: org.freedesktop.DBus.Error.Spawn.ChildExited
WARNING: D-Bus message: Launch helper exited with unknown return code 1
WARNING: Udev-based profiles cannot be changed or checked due to Udev serviceHelper connection failure
.Fs
======================================================================
FAIL: test_local_snapshot_is_successful (test.test_backintime.TestBackInTime)
end to end test - from BIT initialization through snapshot
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/sf_Downloads/backintime/common/test/test_backintime.py", line 146, in test_local_snapshot_is_successful
    self.assertRegex(filtered_log_output, re.compile(r'''INFO: Lock
AssertionError: Regex didn't match: 'INFO: Lock\nINFO: Take a new snapshot. Profile: 1 Main profile\nINFO: Call rsync to take the snapshot\nINFO: Save config file\nINFO: Save permissions\nINFO: Create info file\nINFO: Unlock\n' not found in 'INFO: Lock\nINFO: Take a new snapshot. Profile: 1 Main profile\nINFO: Call rsync to take the snapshot\nINFO: Save config file\nINFO: Save permissions\nINFO: Create info file\nQPainter::begin: Paint device returned engine == 0, type: 2\nQWidget::render: Cannot render with an inactive painter\nINFO: Unlock\n'

----------------------------------------------------------------------
Ran 3 tests in 4.166s

FAILED (failures=1, skipped=1)
make: *** [Makefile:570: unittest] Fehler 1

@aryoda
Copy link
Contributor Author

aryoda commented Nov 4, 2022

Very good test, this looks like a new bug.

But when I log into that same machine via SSH in a real terminal (without X11/Wayland involved)
I got an error about QPainter which polutes the output and make a test fail.

Did I introduce this with my PR or does it happen with master too?

I can't see a line number for this QPainter message so I need a way to reproduce this.
Do you have a minimal setup to reproduce this (eg. without ssh?).
Meanwhile I will try to boot Linux into a console instead of a desktop environment, perhaps this is showing the message too...

I was wondering why Qt is involved here. But I saw that Qt is imported in diagnostics.py

Yes, diagnostics does show the PytQt5 version number, but only when "--diagnostics" is called.
And this is the most plausible reason since some unit tests do use "--diagnostics".

# Qt
try:
import PyQt5.QtCore
except ImportError:
qt = '(Can not import PyQt5)'
else:
qt = 'PyQt {} / Qt {}'.format(PyQt5.QtCore.PYQT_VERSION_STR,
PyQt5.QtCore.QT_VERSION_STR)
finally:
result['python-setup']['qt'] = qt

Perhaps it would be better to use PyQt5 only if --diagnostics was started from backintime-qt
(I saw a "flag" to recognize this in the code - I am searching...)

Could you please do a quick check via the console that printed the "QPainter" message:

python3 -c "import PyQt5.QtCore; print(PyQt5.QtCore.PYQT_VERSION_STR)"

If this also writes the QPainter message we would have found the culprit.

@aryoda
Copy link
Contributor Author

aryoda commented Nov 4, 2022

When I boot into a Manjaro console via run-level 3 in grub the same unit test fails but with another actual/expected difference:
One line too much in the output:

WARNING: Inhibit Suspend failed.

If I ignore this warning by filtering it like the DBus warnings (test_backintime staring line 147) the unit tests succeed.

Edit: This warning is shown when the DBus communication with a service does fail (I bet the service is only running when a desktop environment is running). I will add this warning to the filter...

I could not yet reproduce the above mentioned QPainter messages (I am seaching the web for the same message ATM):

QPainter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter

@buhtz
Copy link
Member

buhtz commented Nov 5, 2022

I'm still confused and not sure if "my problem" is relevant here or should block the merge.
I tend to merge that PR and see what happens in the wildlife out there. 🐅

I agree, but give me one more day to try to reproduce the issue in a new VM since it may
hurt using BiT in CLI-only mode on "embedded" devices.

The error happens in a unittest where --diagnostics isn't called. That confuse me, too.

Yes, you are right. --diagnostics was the only place where I could see the import PyQt5.
But I have a new suspect: The pluginmanager! It seems to load all plugins (even from the qt/plugins folder)

How I reproduce
pytest test/test_backintime.py::TestBackInTime::test_local_snapshot_is_successful
It is Manjaro on a tty terminal, on a ssh terminal and on a tmux terminal.

I am setting up a new console-only VM to test this. It looks like a plain backintime check-config could suffice to trigger the QPainter output...

Do you get the QPainter message also when running BiT master instead of my PR version?

@buhtz
Copy link
Member

buhtz commented Nov 5, 2022

Btw: It seems that you edited my own comment instead of quote and answer it. ;)

Do you get the QPainter message also when running BiT master instead of my PR version?

Yes I can reproduce this with master also. This indicates to me that it isn't a serious problem because it was there before but no one noticed or reported about it.

@aryoda
Copy link
Contributor Author

aryoda commented Nov 5, 2022

Btw: It seems that you edited my own comment instead of quote and answer it. ;)

Damn it, I shouldn't do two things in parallel :-)

Do you get the QPainter message also when running BiT master instead of my PR version?

Yes I can reproduce this with master also. This indicates to me that it isn't a serious problem
because it was there before but no one noticed or reported about it.

OK, then I suggest to merge now and I do the analysis until EoW.

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.

[Arch] Backintime fails to build
2 participants