Ok, so in my previous previous post I wrote about not being able to restore my build in time. Given the fact that reinstalling the OS would take more time, I took a shot at rebuilding gnome-shell (with the beloved jhbuild, of course) inside a virtual machine, on a Fedora26 OS.
This was the first step towards fixing my issue. As you will see, this post aims at helping newcomers install gnome-shell on their machines by describing all the issues that I encountered while building.
First thing you want to do is read the jhbuild guide that can be found here and then install jhbuild.
Before going further, we have some things to take out of the way. To start with, comands that are bolded are run as a normal user, while the ones that are red are run with root privileges (the only commands that use root privileges are the ones that start with ‘dnf’). Another important color is this weird one (called magenta) which is used for errors (also, the error strings begin with some variation of the ‘error’ string or ‘package not found’).
The next thing you need to know is that whenever some jhbuild command fails, (usually) you will be presented with the following menu (sometimes you get just some of the options, but the ones we’ll use are available everytime):
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase “wipe directory and start over”
[7] Go to phase “clean”
[8] Go to phase “distclean”
Ending up here, you will need to run some commands in order to fix the issue. After the problem is fixed, you’ll need to resume and rerun the command that failed. So, how do you do that? Well, you have two options (a complex one, and an easier one):
- (The complex option) You choose the ‘Start shell’ option from the menu above, that will spawn another shell nested inside the current one. You will then run the command that fixes the issue in this new nested shell, then (after the command has finished running) exit this shell (press CTRL+D or use the exit command). Exiting the nested shell will bring you back to the previous shell (the one inside of which you first ran a command, and then it failed giving you the above menu) which will prompt you with the above menu again. Since you now fixed the problem, you need to choose the ‘Rerun phase configure’ one.
- (The easy option) Instead of using a nested shell, you simply open another terminal and run the command that should fix your problem. Then you return to the first shell, which will still have the menu as the last thing it printed back to you, and you will just choose ‘Rerun phase configure’.
Option 2 is more straight-forward, as option 1 can confuse you a bit (having a million nested shells isn’t quite helpful, either).
Also, keep a separate tab for the commands that are run as root, as you will only use it for commands starting with ‘dnf’ (which require root privileges). This will make the workflow a bit smoother (you won’t have to log as root a million times).
So, This is where the ‘things you need to know’ section ends, and where the ‘let’s build gnome-shell already, dude’ section starts. Commands will be run in sequence:
- Use the command: jhbuild sysdeps (this command will show you information about the packages needed, and whether the packages are ok, out-of-date or uninstalled).
- Use the command: jhbuild sysdeps –install (this command will install any of the packages that are uninstalled, or will try to update those that are out-of-date).
- This command may fail with the following error: Error: python-gobject package not found. If this happens, you need to use the following command: dnf install pygobject2.x86_64.
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild sysdeps –install command.
- This command may fail with the following error: Error: dbus-python package not found. If this happens, you need to use the following command: dnf install dbus-python-devel.x86_64.
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild sysdeps –install command which will succeed.
- Now we need to install the system dependencies for gnome-shell specifically, using the command: jhbuild sysdeps –install gnome-shell.
- Now we’ll begin installing gnome-shell with the jhbuild build gnome-shell command.
- This command may fail with the following error: *** Error during phase build of gobject-introspection: ########## Error running make -j 2 *** [6/71]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error: gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory. If this happens, you need to use the following command: dnf install redhat-rpm-config.
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild build gnome-shell command.
- This command may fail with the following error: *** Error during phase configure of geoclue: ########## Error running ~/jhbuild/checkout/geoclue/autogen.sh –prefix ~/jhbuild/install –disable-Werror –with-systemdsystemunitdir=no –disable-static –disable-gtk-doc *** [32/71]. If we scroll up a bit, just above the previous error, we’ll see two more detailed errors:
- Package ‘avahi-client’, required by ‘virtual:world’, not found
- Package ‘avahi-glib’, required by ‘virtual:world’, not found
- Fix the two erros by running: dnf install avahi-glib-devel.x86_64.
- This command may fail with the following error: *** Error during phase configure of geoclue: ########## Error running ~/jhbuild/checkout/geoclue/autogen.sh –prefix ~/jhbuild/install –disable-Werror –with-systemdsystemunitdir=no –disable-static –disable-gtk-doc *** [32/71]. If we scroll up a bit, just above the previous error, we’ll see two more detailed errors:
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild build gnome-shell command.
- This command may fail with the following error: *** Error during phase build of WebKit: ########## Error running ninja *** [40/71]. No need to fix this, go to step 9.
- Since we don’t need to build Webkit, we pick the ‘Give up on module’ option from the menu. This will simply skip building WebKit and will build the next module in the list of modules built by the jhbuild build gnome-shell command.
- This command may fail with the following error: *** Error during phase configure of gnome-desktop: ########## Error running ~/jhbuild/checkout/gnome-desktop/autogen.sh –prefix ~/jhbuild/install –disable-Werror –with-gnome-distributor=JHBuild –disable-static –disable-gtk-doc *** [51/71]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error: Package ‘libseccomp’, required by ‘virtual:world’, not found. If this happens, you need to use the following command: dnf install libseccomp-devel.x86_64.
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild build gnome-shell command.
- This command may fail with the following error: *** Error during phase configure of libinput: ########## Error running meson –prefix ~/jhbuild/install –libdir lib –buildtype=debugoptimized -Ddisable_gtkdoc=true ~/jhbuild/checkout/libinput *** [66/71]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error:
-
- Meson encountered an error in file meson.build, line 513, column 1:
- Program “valgrind” not found or not executable
-
- Fix the error by running: dnf install valgrind-devel.x86_64.
- This command may fail with the following error: *** Error during phase configure of libinput: ########## Error running meson –prefix ~/jhbuild/install –libdir lib –buildtype=debugoptimized -Ddisable_gtkdoc=true ~/jhbuild/checkout/libinput *** [66/71]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error:
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild build gnome-shell command. And it will succeed with the following message:
-
- *** the following modules were not built *** [71/71]
- WebKit gnome-online-accounts libgdata evolution-data-server gnome-shell
-
- Now we’ll use the following command: jhbuild buildone gnome-shell.
- This command may fail with the following error: *** Error during phase configure of gnome-shell: ########## Error running meson –prefix ~/jhbuild/install –libdir lib –buildtype=debugoptimized -Ddisable_gtkdoc=true ~/jhbuild/checkout/gnome-shell *** [1/1]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error:
-
- Meson encountered an error in file meson.build, line 72, column 0:
- Native dependency ‘libecal-1.2’ not found
-
- Fix the error by running: dnf search evolution-data-server-devel.
- This command may fail with the following error: *** Error during phase configure of gnome-shell: ########## Error running meson –prefix ~/jhbuild/install –libdir lib –buildtype=debugoptimized -Ddisable_gtkdoc=true ~/jhbuild/checkout/gnome-shell *** [1/1]. If we scroll up a bit, just above the previous error, we’ll see a more detailed error:
- From the menu, choose ‘Rerun phase configure’, which will resume the jhbuild buildone gnome-shell command. And it will succeed.
Wow. Congratz! You built gnome-shell! Now let’s try to run it. Before that, another thing you should know is that gnome-shell can rely one of the two backends: X11 or Wayland. The default is Wayland. The question that you may ask youself is: how the hell am I going to choose which one of them to use? Well, you’re in luck, there’s an answer for that too.
When you power up your pc/laptop (or after restarting, for that matter), you will have to choose which account to log into, after you do that, you’ll have to type in the password for that account. Just near the ‘Sing In’ button, you have a small gear that you can click on. Upon clicking, a popup pops up (duh), having (by default, unless you altered this somehow) 3 choices: GNOME, GNOME Classic, GNOME on Xorg. The predefined choice usually is GNOME.
GNOME uses Wayland, while GNOME on Xorg uses X11.
Running gnome-shell:
- On Wayland: jhbuild run gnome-shell -r –nested
- A new window will open and there you’ll have your gnome-shell instance.
- Just closing the new window will terminate the new gnome-shell instance.
- On X11: jhbuild run gnome-shell -r
- This will basically replace your current gnome-shell instance with the one built with jhbuild.
- In order to replace it back with the default gnome-shell (not the one built with jhbuild) run the following command from within another terminal: /usr/bin/gnome-shell -r.
So, I hope I covered most of the build issues that can occur (the ones above are the ones that I experienced, but there is a pretty big chance that you’re going to run into them as well). Have fun breaking the build! 🙂
P.S. Just noticed that the single (–) and double (—) dashes appear awkward when bolded… Sorry about that.