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

Setup KDE4 build environment, build and run KDE4. #11

Closed
midenok opened this issue Apr 18, 2014 · 11 comments
Closed

Setup KDE4 build environment, build and run KDE4. #11

midenok opened this issue Apr 18, 2014 · 11 comments
Assignees
Labels

Comments

@midenok
Copy link
Member

midenok commented Apr 18, 2014

Please, follow the instructions to build KDE4. Feel free to correct or supplement them if needed. When you will have successfully built KDE4, ask for the further instructions. Don't hesitate to ask for help if any problems occur.

@mechanician
Copy link

I have successfuly built kde-baseapps, kde-workspace and kdelibs. But it turned out that scripts
'kde-run-env' and 'kde-build-env' from instructions were useless (also I didn't understand what
is 'cmakekde'). So I just satisfied all dependencies and used only cmake (and, of course, make).
What is the next move?

@midenok
Copy link
Member Author

midenok commented Apr 25, 2014

Try to install and run your built version under Xnest. kde-run-env will show you what env vars are required to setup. Pay special attention to these variables: HOME, KDEHOME, PATH, LD_LIBRARY_PATH.

Also, please take into account, that to debug successfully you need optimization turned off. So, if it was compiled with optimization (-O3 f.ex.), you will have to rebuild with flags -g -O0 (last flags override previous ones).

Please, message me when you start successfully under Xnest (or Xephyr).

@mechanician
Copy link

Hi!
I have successfully run kde4 (previously built) under Xnest. But again I did not understand how
to use kde-run-env and kde-build-env scripts. To prevent some errors 'lnusertemp' was copied from $HOME/src/kdelibs/kdelibs-build/bin/ to $HOME/.kde/lib/kde4/libexec and 'kde-config' was copied from $HOME/src/kdelibs/kdelibs-build/bin/ to $HOME/src/kde-workspace/build/. Those actions are not from instructions, so I wonder if they are correct. About environment variables: it was sufficient to redefine HOME variable (HOME=$HOME/kde4)

@midenok
Copy link
Member Author

midenok commented May 5, 2014

Hmm... I guess, that not specifying LD_LIBRARY_PATH, KDEHOME, PATH can interfere with your system KDE. Are you sure that libraries (LD_LIBRARY_PATH), plugins (KDEHOME) and executables (PATH) was loaded from your custom KDE?

Regarding kde-run-env and kde-build-env isn't it enough to just read them? kde-run-env will show which envvars are required (or maybe required) to run. kde-build-env is meant to setup shell environment for build. Both must be sourced into your shell from which you run or build. kde-build-env defines a command to build (cmakekde). But since you have already built without it, that's fine -- you can be on your own.

About your errors, they may be custom to your specific setup. So, let's just don't think about them for now.

@mechanician
Copy link

No, I am not sure (I suspect variables from system KDE were used)...
I think I get the point, and I will check it.
So what to do next?

@midenok
Copy link
Member Author

midenok commented May 5, 2014

Let's just ensure that all is well. The most reliable way is to look at backtrace of some KDE process. Please, examine following stack backtrace:

#0  0x00007ffaa9de84ed in poll () from /lib64/libc.so.6
#1  0x00007ffaa6565aa4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ffaa6565bc4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffaabba72e6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#4  0x00007ffaaada6c1e in ?? () from /usr/lib64/libQtGui.so.4
#5  0x00007ffaabb77adf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () from /usr/lib64/libQtCore.so.4
#6  0x00007ffaabb77d68 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/libQtCore.so.4
#7  0x00007ffaabb7ca08 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#8  0x00007ffa96c26ea5 in kdemain (argc=1, argv=0x1000790)
    at /home/test/kde/sources/jeka/KDE/kde-workspace/plasma/desktop/shell/main.cpp:126
#9  0x0000000000407378 in launch (argc=1, _name=
    0x116f198 "/home/test/kde/installs/jeka/bin/plasma-desktop", args=0x116f1c8 "", cwd=
    0x0, envc=0, envs=0x116f1d0 "", reset_env=false, tty=0x0, avoid_loops=false, 
    startup_id_str=0x40d85f "0")
    at /home/test/kde/sources/jeka/KDE/kdelibs/kinit/kinit.cpp:726
#10 0x000000000040847a in handle_launcher_request (sock=8, who=0x40dafc "launcher")
    at /home/test/kde/sources/jeka/KDE/kdelibs/kinit/kinit.cpp:1218
#11 0x0000000000408d32 in handle_requests (waitForPid=0)
    at /home/test/kde/sources/jeka/KDE/kdelibs/kinit/kinit.cpp:1411
#12 0x000000000040a8f4 in main (argc=4, argv=0x7fff0e11c698, envp=0x7fff0e11c6c0)
    at /home/test/kde/sources/jeka/KDE/kdelibs/kinit/kinit.cpp:1899
(gdb)

Here we see, that paths go from custom build directory (for kinit and plasma-desktop executables). Except for QT, which is system-wide in that stack and system libs (libc, libglib). I would recommend you to reproduce this stack in your GDB session.

What you will need to do, to achieve it:

  1. find PID of plasma-desktop process of your custom KDE4 (it was exec-ed from kinit, how to highlight newly started processes);
  2. run GDB and attach to this PID (attach command);
  3. put breakpoint on some frequent system call (like poll() -- b poll);
  4. continue execution until breakpoint (c or continue command);
  5. examine stack (bt).

You may wish to get predefined .gdbinit with human-usable settings. Also, if you are new to GDB, you may read some quickstart guides.

Also, would be good, to reproduce some stack with .so libraries from KDE (the stack above doesn't contain any).

Meanwhile I will prepare instructions for KDE3 setup.

@midenok
Copy link
Member Author

midenok commented May 5, 2014

Btw, some executables paths are visible in ps so this is mainly for training purposes (and for checking paths of .so libraries if you will get into some useful stack).

@mechanician
Copy link

Hi!
I had found error in my previous actions, so I've rebuilt everything with cmakekde and all environment variables were set by kde4-build-env. In particular:

KDEHOME=/home/mechanician/.kde4
KDE_INSTALL_PREFIX=/home/mechanician/kde/installs/trunk
KDE_PREFIX=/home/mechanician/kde4
KDE_HOME=/home/mechanician/kde4/opt/etc
LD_LIBRARY_PATH=/home/mechanician/kde/installs/trunk/:/root/kde/installs/trunk/:

Output of

ps aux | grep 'plasma-desktop' 

is

mechani+  1813  0.0  3.7 486388 71740 ?        Sl   мая04   2:27 /usr/bin/plasma-desktop
root     30091  0.6  1.3 251952 26740 ?        Sl   20:40   0:00 /home/mechanician/kde/installs/trunk/bin/plasma-desktop
mechani+ 30132  0.0  0.0   5912   824 pts/7    S+   20:41   0:00 grep --color=auto plasma-desktop

So, I think, the previous problem is solved. But now when I run startkde under Xnest, ugly black desktop appears on the screen https://www.dropbox.com/s/zt757kb75rikd6k/my_kde4_desktop.png
and here is output I got https://www.dropbox.com/s/ht0cv1bg6s5e9on/startx_output.txt in terminal (from stderr)

It seems to me that something is wrong...

@midenok
Copy link
Member Author

midenok commented May 14, 2014

I guess, that it's because we installing not all KDE4 components something must be missing. Like:

plasma-desktop(29785): Couldn't start kglobalaccel from kglobalaccel.desktop:  "Could not find service 'kglobalaccel.desktop'." 

or

plasma-netbook(29779)/libplasma Plasma::PackagePrivate::isValid: Could not find required directory images

It's Ok for us for now. Errors which begin with X Error: are OK too:

X Error: BadValue (integer parameter out of range for operation) 2
  Major opcode: 53 (X_CreatePixmap)
  Resource id:  0x20

because Xnest doesn't support all contemporary features. Though, if you want, you can try Xephyr which is more modern and presumably will look better.

I don't know about other errors. In particular DBus errors. Maybe it conflicts with your parent session (by trying to connect to same socket). You can investigate and if it is true -- organize separate DBus session for it.

@midenok
Copy link
Member Author

midenok commented May 27, 2014

mechanician

But just in case, I'm posting here output of backtrace (from gdb):

Breakpoint 1, poll () at ../sysdeps/unix/syscall-template.S:81
81      in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0  poll () at ../sysdeps/unix/syscall-template.S:81
#1  0xb1d0120b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0xb1cf23e8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb1cf2528 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb5df293b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
#5  0xb53845de in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#6  0xb5dc1823 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
#7  0xb5dc1b49 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
#8  0xb5dc78fe in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#9  0xb52cda24 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#10 0xb76b4f18 in kdemain (argc=1, argv=0xbfbe6fd4)
    at /home/mechanician/kde4/src/kde-workspace/plasma/desktop/shell/main.cpp:126
#11 0x08048672 in main (argc=1, argv=0xbfbe6fd4)
    at /home/mechanician/kde4/src/kde-workspace/plasma/desktop/shell/plasma-desktop_dummy.cpp:3

It seems all right...

@midenok
Copy link
Member Author

midenok commented May 27, 2014

Yes, it's fine! So, here is the next task...

@midenok midenok closed this as completed May 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants