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

tokodon: init at 22.11.2 #170466

Merged
merged 2 commits into from
Jan 14, 2023
Merged

tokodon: init at 22.11.2 #170466

merged 2 commits into from
Jan 14, 2023

Conversation

matthiasbeyer
Copy link
Contributor

Description of changes
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Fits CONTRIBUTING.md.

nix builds some bash script that sets some environment variables before the application is execd. The execution of the application itself then segfaults.

If I start the binary directly from the store it works.

Maybe someone with more KDE+nixpkgs knowledge can help me out here?

pkgs/applications/misc/tokodon/default.nix Outdated Show resolved Hide resolved
pkg-config
];

buildInputs = with libsForQt5; [
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to add this package to pkgs/top-level/qt5-packages.nix and remove the need for libsForQt5 prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would that make the libsForQt5 obsolete?

Copy link
Contributor

Choose a reason for hiding this comment

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

As you can see here https://github.com/NixOS/nixpkgs/blob/350fd0044447ae8712392c6b212a18bdf2433e71/pkgs/development/libraries/signond/default.nix this package is added to pkgs/top-level/qt5-packages.nix. It's referencing qmake without the libsForQt5 prefix

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a native QT application it would be better to go there

@onny
Copy link
Contributor

onny commented Sep 5, 2022

If ready for review please squash both commits into one

@onny
Copy link
Contributor

onny commented Sep 5, 2022

@ofborg build tokodon

Copy link
Contributor

@onny onny left a comment

Choose a reason for hiding this comment

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

Running the app from inside nixpkgs-review fails for me but this could depend on my missing local Qt configuration

[nix-shell:~/.cache/nixpkgs-review/pr-170466-2]$ ./results/libsForQt5.tokodon/bin/tokodon 
QApplication: invalid style override 'adwaita-dark' passed, ignoring it.
	Available styles: Windows, Fusion
Loading any accounts from settings.
Segmentation fault (core dumped)

pkgs/top-level/qt5-packages.nix Outdated Show resolved Hide resolved
pkgs/applications/misc/tokodon/default.nix Outdated Show resolved Hide resolved
@onny
Copy link
Contributor

onny commented Sep 6, 2022

@ofborg build tokodon

@onny
Copy link
Contributor

onny commented Sep 6, 2022

It's building but doesn't run for me. Maybe someone else could take a look @SuperSandro2000

@uninsane
Copy link
Contributor

it's failing in a similar way for me on sway. 22.09 is out (this PR is for 22.04). i tried updating version = "22.09"; and hash = "sha256-wHE8HPnjXd+5UG5WEMd7+m1hu2G3XHq/eVQNznvS/zc="; -- no dice.

for me it takes a good 2 minutes of hanging after "Loading any accounts from settings" until it segfaults. i don't know if that's just how long it takes to coredump, or if maybe it just needs some accounts file for it to work?

@uninsane
Copy link
Contributor

uninsane commented Oct 31, 2022

regarding the segfault:

(gdb) thread 5
(gdb) bt
#0  0x00007ffff74bcaa0 in QQmlType::QQmlType(QQmlType const&) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#1  0x00007ffff75239bc in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#2  0x00007ffff75265b1 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#3  0x00007ffff752694c in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#4  0x00007ffff7527174 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#5  0x00007ffff752206b in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#6  0x00007ffff7471995 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#7  0x00007ffff74778d7 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#8  0x00007ffff7465415 in QQmlDataBlob::tryDone() () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#9  0x00007ffff74c56e5 in QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) ()
   from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#10 0x00007ffff74c5e32 in QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#11 0x00007ffff74c7200 in QQmlTypeLoader::loadThread(QQmlDataBlob*) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#12 0x00007ffff7480fad in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#13 0x00007ffff75407cf in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#14 0x00007ffff7540f92 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#15 0x00007ffff691976f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Widgets.so.5
#16 0x00007ffff5dc04fa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#17 0x00007ffff5dc3617 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#18 0x00007ffff5e18cf3 in ?? () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#19 0x00007ffff517496b in g_main_context_dispatch () from /nix/store/52c73s4b53szj1wf9ai43ignvgnq8scz-glib-2.74.0/lib/libglib-2.0.so.0
#20 0x00007ffff5174c18 in g_main_context_iterate.constprop () from /nix/store/52c73s4b53szj1wf9ai43ignvgnq8scz-glib-2.74.0/lib/libglib-2.0.so.0
#21 0x00007ffff5174ccf in g_main_context_iteration () from /nix/store/52c73s4b53szj1wf9ai43ignvgnq8scz-glib-2.74.0/lib/libglib-2.0.so.0
#22 0x00007ffff5e18354 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#23 0x00007ffff5dbee7b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#24 0x00007ffff5bcaacb in QThread::exec() () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#25 0x00007ffff7540465 in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#26 0x00007ffff5bcbde1 in ?? () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#27 0x00007ffff5663e86 in start_thread () from /nix/store/g8d5bnh9mh1364x17mjyc731fsi9a61m-glibc-2.35-163/lib/libc.so.6
#28 0x00007ffff56eac60 in clone3 () from /nix/store/g8d5bnh9mh1364x17mjyc731fsi9a61m-glibc-2.35-163/lib/libc.so.6

(gdb) thread 1
(gdb) bt
#0  0x00007ffff56607d5 in __futex_abstimed_wait_common () from /nix/store/g8d5bnh9mh1364x17mjyc731fsi9a61m-glibc-2.35-163/lib/libc.so.6
#1  0x00007ffff5663202 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/g8d5bnh9mh1364x17mjyc731fsi9a61m-glibc-2.35-163/lib/libc.so.6
#2  0x00007ffff5bd1e2b in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /nix/store/hnii4vframpg90xzq0x4l8s7sn4sdm09-qtbase-5.15.6/lib/libQt5Core.so.5
#3  0x00007ffff7540bac in ?? () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#4  0x00007ffff74c75c1 in QQmlTypeLoader::load(QQmlDataBlob*, QQmlTypeLoader::Mode) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#5  0x00007ffff74c7f00 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#6  0x00007ffff74a057d in QQmlComponentPrivate::loadUrl(QUrl const&, QQmlComponent::CompilationMode) ()
   from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#7  0x00007ffff7505633 in QQmlApplicationEnginePrivate::startLoad(QUrl const&, QByteArray const&, bool) ()
   from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#8  0x00007ffff75056fd in QQmlApplicationEngine::load(QUrl const&) () from /nix/store/npf34d0v9za7snrrnsppp2mxvspd2jji-qtdeclarative-5.15.6/lib/libQt5Qml.so.5
#9  0x000000000041099f in main ()

the other 3 threads appear to be event handlers idling in poll or futex_wait.

that line in main which calls QQmlApplicationEngine::load is:

engine.load(QUrl(QStringLiteral("qrc:/content/ui/main.qml")));

stracing the app, i see no fs request for anything close to content/ui/main.qml. QQmlDataBlob::SourceCodeData hints that the resource file was compiled into the app. i don't see any similar upstream issue. but it's hard for me to see what we could do wrong that would cause a segfault here unless the nix wrappers somehow break the embedded resource file?

@matthiasbeyer
Copy link
Contributor Author

Updated for the 22.09 release, but the crash still exists.

@uninsane
Copy link
Contributor

uninsane commented Nov 4, 2022

i got this further along (maybe all the way?). try adding kitemmodels and pimcommon to buildInputs.


without these, nix log '.#tokodon' showed this during the cmake invocation:

-- The following RUNTIME packages have not been found:
 
 * org.kde.kitemmodels-QMLModule, QML module 'org.kde.kitemmodels' is a runtime dependency.

these new buildInputs don't actually make that warning go away, but the application does start now and shows me a login page. actually, grepping for kitem in the Tokodon source doesn't give any results except for a single reference to it in CMakeLists.txt. i tried removing that reference and it still builds/runs -- but only if i keep kitemmodels and pimcommon in the buildInputs.

so i'm not sure what the deal with that dep is. maybe some input into this package should have specified them as propagatedBuildInputs. i'll toy around with the app later & see if it's in a good state with this.

@matthiasbeyer
Copy link
Contributor Author

For me it still segfaults with these.

@uninsane
Copy link
Contributor

uninsane commented Nov 5, 2022

For me it still segfaults with these.

try clearing ~/.cache/KDE/tokodon (or ~/.config/KDE/tokodon) if it exists. i found that if i launch Tokodon but do not sign in, the app leaves data there that causes a crash-on-launch for future runs.

@matthiasbeyer
Copy link
Contributor Author

Now I get at least:

$ ./result/bin/tokodon 
Loading any accounts from settings.
Cannot mix incompatible Qt library (5.15.3) with this library (5.15.5)
segfault

I guess we're at a point where we should open issues in their bugtracker, don't you think?

samueldr added a commit to samueldr/nixpkgs that referenced this pull request Dec 22, 2022
This commit is artificially built over the end-results of the Nixpkgs
PR NixOS#170466 with the package now
being built in the way Plasma Mobile Gear packages are built.

Main differences:

 - `mkDerivation` from the Plasma Mobile Gear package set, and related
    changes (dropping redundant wrapQtAppsHook).
 - inputs re-ordered and split by usage like sibling packages.

The actual work though was by @matthiasbeyer, I only mechanically
rehashed the changes.

Co-authored-by: Matthias Beyer <mail@beyermatthias.de>
@samueldr
Copy link
Member

samueldr commented Dec 22, 2022

@matthiasbeyer before somewhat rudely force-pushing this on top of this PR, here's the equivalent changes:

One caveat, since it's in the depths of Qt packaging, it is currently exposed as plasma5Packages.tokodon. I'm now looking into the correct way to alias this.

@matthiasbeyer
Copy link
Contributor Author

Do I have to do something, or is this done and I can close this PR?

@onny
Copy link
Contributor

onny commented Jan 12, 2023

Maybe you can create a new PR with the changes mentioned by @samueldr , I would be happy to review :)

@matthiasbeyer
Copy link
Contributor Author

@onny I meant because tokodon is in the plasma mobile gear derivation... so there's no point in keeping this PR, as far as I understand.

@onny
Copy link
Contributor

onny commented Jan 12, 2023

tokodon is there in the srcs.nix file but missing a derivation. I can't find it in master nor staging yet

@samueldr
Copy link
Member

Oh, I was waiting for a comment to continue with this. I suppose the 👍 here means it's alright then, right?

@matthiasbeyer
Copy link
Contributor Author

matthiasbeyer commented Jan 12, 2023 via email

samueldr added a commit to matthiasbeyer/nixpkgs that referenced this pull request Jan 12, 2023
This commit is artificially built over the end-results of the Nixpkgs
PR NixOS#170466 with the package now
being built in the way Plasma Mobile Gear packages are built.

Main differences:

 - `mkDerivation` from the Plasma Mobile Gear package set, and related
    changes (dropping redundant wrapQtAppsHook).
 - inputs re-ordered and split by usage like sibling packages.

The actual work though was by @matthiasbeyer, I only mechanically
rehashed the changes.

Co-authored-by: Matthias Beyer <mail@beyermatthias.de>
@samueldr
Copy link
Member

samueldr commented Jan 12, 2023

This force push:

  • Rebases on current nixos-unstable
  • Changes to the Plasma Mobile Gear owned tokodon build (which is largely as it was)

@onny onny changed the title tokodon: init at 22.04 tokodon: init at 22.11.2 Jan 12, 2023
@onny
Copy link
Contributor

onny commented Jan 12, 2023

I'm getting following error while trying to build it with nixpkgs-review

error: undefined variable 'src'

       at /home/onny/.cache/nixpkgs-review/pr-170466/nixpkgs/pkgs/applications/plasma-mobile/tokodon.nix:55:16:

           54|     description = "A Mastodon client for Plasma and Plasma Mobile";
           55|     homepage = src.meta.homepage;
             |                ^
           56|     license = licenses.gpl3Plus;

       … while evaluating the attribute 'homepage'

@samueldr
Copy link
Member

samueldr commented Jan 12, 2023

Right, this was tested on my end with nix-build, and the ofborg check also fails that way. This is one part of why this had to go through the PR lifecycle: it needed to be tested the same way as any other changes.

So this is something I didn't know: there is an implicit homepage on fetchFromGitHub, huh!

nix-repl> (fetchFromGitHub { rev = ""; owner = "samueldr"; repo = "foo"; }).meta.homepage
"https://github.com/samueldr/foo"

Anyway, let's fix it for the actual project page, as listed on their project page.

samueldr added a commit to matthiasbeyer/nixpkgs that referenced this pull request Jan 12, 2023
This commit is artificially built over the end-results of the Nixpkgs
PR NixOS#170466 with the package now
being built in the way Plasma Mobile Gear packages are built.

Main differences:

 - `mkDerivation` from the Plasma Mobile Gear package set, and related
    changes (dropping redundant wrapQtAppsHook).
 - inputs re-ordered and split by usage like sibling packages.

The actual work though was by @matthiasbeyer, I only mechanically
rehashed the changes.

Co-authored-by: Matthias Beyer <mail@beyermatthias.de>
@onny
Copy link
Contributor

onny commented Jan 13, 2023

Thank you @samueldr for fixing this! When I try to run tokodon via nixpkgs-review it runs for a few seconds but then crashes.

[nix-shell:~/.cache/nixpkgs-review/pr-170466-2]$ ./results/libsForQt5.tokodon/bin/tokodon 
Loading any accounts from settings.
qrc:/content/ui/main.qml:74: TypeError: Cannot read property 'instanceName' of null
Segmentation fault (core dumped)

@samueldr
Copy link
Member

Working on it. Explanation is simple: the gear release only has 22.11, this was for 22.11.2. That escaped me initially.

samueldr and others added 2 commits January 13, 2023 17:54
This commit is artificially built over the end-results of the Nixpkgs
PR NixOS#170466 with the package now
being built in the way Plasma Mobile Gear packages are built.

Main differences:

 - `mkDerivation` from the Plasma Mobile Gear package set, and related
    changes (dropping redundant wrapQtAppsHook).
 - inputs re-ordered and split by usage like sibling packages.

The actual work though was by @matthiasbeyer, I only mechanically
rehashed the changes.

Co-authored-by: Matthias Beyer <mail@beyermatthias.de>
@onny
Copy link
Contributor

onny commented Jan 14, 2023

Result of nixpkgs-review pr 170466 run on x86_64-linux 1

1 package built:
  • libsForQt5.tokodon (plasma5Packages.tokodon)

@onny onny merged commit 9533845 into NixOS:master Jan 14, 2023
@onny
Copy link
Contributor

onny commented Jan 14, 2023

Thank you know it worked for me! Thank you @matthiasbeyer and @samueldr

@matthiasbeyer matthiasbeyer deleted the add-tokodon branch January 14, 2023 19:27
drunkod pushed a commit to drunkod/colinix-files that referenced this pull request Feb 1, 2024
this hangs and then segfaults at start. i suppose i should `gdb` it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants