Skip to content

Commit 715f452

Browse files
BertalanDADKaster
authored andcommitted
Documentation: Hide Meta/serenity.sh rebuild-toolchain
Unless a new toolchain update has been merged, users should not need to rebuild their toolchain. Yet, the first thing they see in the build documentation is to run `Meta/serenity.sh rebuild-toolchain`, which might incorrectly lead them to use it whenever they encounter an error. This is a waste of time and causes frustration. Move any mentions of this option to `Troubleshooting.md` and add a note to `BuildInstructions.md` about the toolchain build being a one-time endeavor.
1 parent 9cd3477 commit 715f452

File tree

4 files changed

+36
-21
lines changed

4 files changed

+36
-21
lines changed

Documentation/BuildInstructions.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,6 @@ There is also documentation for installing the build prerequisites for some less
9292

9393
## Build
9494

95-
In order to build SerenityOS you will first need to build the toolchain by running the following command:
96-
97-
```console
98-
Meta/serenity.sh rebuild-toolchain
99-
```
100-
101-
Later on, when you use `git pull` to get the latest changes, there's (usually) no need to rebuild the toolchain.
102-
10395
Run the following command to build and run SerenityOS:
10496

10597
```console
@@ -109,6 +101,11 @@ Meta/serenity.sh run
109101
This will compile all of SerenityOS and install the built files into the `Build/x86_64/Root` directory inside your Git
110102
repository. It will also build a disk image and start SerenityOS using QEMU.
111103

104+
The first time this command is executed, it will also download some required database files from the internet and build
105+
the SerenityOS cross-compiler toolchain. These steps only have to be done once, so the next build will go much faster.
106+
When we update to a newer compiler, you might be prompted to re-build the toolchain; see the [troubleshooting guide](Troubleshooting.md#the-toolchain-is-outdated)
107+
for what to do when this happens.
108+
112109
If, during build, an error like `fusermount: failed to open /etc/mtab: No such file or directory` appears, you have installed `fuse2fs` but your system does not provide the mtab symlink for various reasons. Simply create this symlink with `ln -sv /proc/self/mounts /etc/mtab`.
113110

114111
Note that the `anon` user is able to become `root` without a password by default, as a development convenience.

Documentation/NvimConfiguration.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ NVim can be configured to use the [COC-clangd](https://github.com/clangd/coc-cla
44
plugin to provide code-completion as well as inline
55
[git blame](https://github.com/f-person/git-blame.nvim) using [vim-plug](https://github.com/junegunn/vim-plug).
66

7-
Make sure you ran `./Meta/serenity.sh rebuild-toolchain` as well as
8-
`./Meta/serenity.sh run`.
7+
Make sure you ran `Meta/serenity.sh run` at least once already.
98

109
# Install vim-plug
1110

Documentation/RunningOnRaspberryPi.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ Currently only UART output is supported, no display.
1414

1515
Please follow [build instructions](BuildInstructions.md) to download and build Serenity. Make sure everything builds successfully for x86.
1616

17-
### Step 2: Build Aarch64 toolchain
17+
### Step 2: Build and run in emulator
1818

19-
Use following the command to build the toolchain for Aarch64:
20-
21-
```console
22-
Meta/serenity.sh rebuild-toolchain aarch64
23-
```
24-
25-
### Step 3: Build and run in emulator
26-
27-
Use the following command to build and run the Aarch64 kernel:
19+
Use the following command to build and run the AArch64 version of the system:
2820

2921
```console
3022
Meta/serenity.sh run aarch64

Documentation/Troubleshooting.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,33 @@ version of CMake, you can download a binary release from the [CMake website](htt
1414
Ensure your [QEMU](https://www.qemu.org/) version is >= 5 with `qemu-system-i386 -version`. Otherwise,
1515
install it. You can also build it using the `Toolchain/BuildQemu.sh` script.
1616

17+
### The toolchain is outdated
18+
19+
We strive to use the latest compilers and build tools to ensure the best developer experience; so every
20+
few months, the toolchain needs to be updated. When such an update is due, an error like the following
21+
will be printed during the build:
22+
23+
```
24+
CMake Error at CMakeLists.txt:28 (message):
25+
GNU version (13.1.0) does not match expected compiler version (13.2.0).
26+
27+
Please rebuild the GNU Toolchain
28+
```
29+
30+
Or like this one:
31+
32+
```
33+
Your toolchain has an old version of binutils installed.
34+
installed version: "GNU ld (GNU Binutils) 2.40"
35+
expected version: "GNU ld (GNU Binutils) 2.41"
36+
Please run Meta/serenity.sh rebuild-toolchain x86_64 to update it.
37+
```
38+
39+
Run `Meta/serenity.sh rebuild-toolchain x86_64` to perform the update.
40+
41+
CMake might cache the compiler version in some cases and print an error even after the toolchain has been rebuilt.
42+
If this happens, run `Meta/serenity.sh rebuild x86_64` to start over from a fresh build directory.
43+
1744
### GCC is missing or is outdated
1845

1946
Ensure your gcc version is >= 12 with `gcc --version`. Otherwise, install it. If your gcc binary is not
@@ -78,5 +105,5 @@ extensions, or you try to use VirtualBox without using a x64 virtualization mode
78105

79106
### Boot fails with "KVM doesn't support guest debugging"
80107
- Update your host kernel to at least version `5.10`. This is the oldest kernel which properly supports the required KVM capability `KVM_CAP_SET_GUEST_DEBUG` (see corresponding [kernel commit](https://github.com/torvalds/linux/commit/b9b2782cd5)).
81-
- Make sure that your distro has the qemu debug feature actually enabled (the corresponding check is [here](https://gitlab.com/qemu-project/qemu/-/blob/222059a0fccf4af3be776fe35a5ea2d6a68f9a0b/accel/kvm/kvm-all.c#L2540)).
108+
- Make sure that your distro has the qemu debug feature actually enabled (the corresponding check is [here](https://gitlab.com/qemu-project/qemu/-/blob/222059a0fccf4af3be776fe35a5ea2d6a68f9a0b/accel/kvm/kvm-all.c#L2540)).
82109
- Or, disable KVM debugging by setting this env var when running serenity: `SERENITY_DISABLE_GDB_SOCKET=1`

0 commit comments

Comments
 (0)