Add a variant of auto formatting using clang-format that doesn't use
additional packages. It works by adding a buffer-local hook to
`'before-save` for all C++ project files.
The current compilerArgs will cause an error when VSCode's C++ extension
queries the compiler for defaults, causing it to revert to the system's
default compiler.
The generate-manpages script needs to be updated again to handle the new
PNGs in section 1. (I'm intentionally not making this a multi-directory
glob.)
This PR includes information that highlights the importance of
updating Xcode on MacOS. I ran into problems building serenity
on MacOS because I had Xcode installed but not updated in a while.
This triggered seemingly unrelated errors that were easily solved
by updating Xcode.
Even though we tell the user to change the version manually if it
doesn't match with the current
`Toolchain/Local/i686/i686-pc-serenity/include/XX.X.X` version, it
doesn't hurt to update it properly now that versions differ by major
version.
This commit bumps the required QEMU version to 6.2 and updates the
version checking logic in Meta/run.sh to support checking against
major and minor version numbers instead of checking against the major
version only
By default we enable the Kernel Undefined Behavior Sanitizer, which
checks for undefined behavior at runtime. However, sometimes a developer
might want to turn that off, so now there is a easy way to do that.
The qemu-emulators-full package installs qemu backends for *all*
supported architectures, but we only need x86 and AArch64.
This decreases the installed size of dependencies by 800 MiB.
- Delete the part about removing `[Exposed=Window]` since that's not
necessary and we may want that information there to generate the
Window object.
- Mention adding `#import`s.
- Outline the requirements for the implementation class.
- Mention the non-Event wrapper factories that need to know about
certain types.
I tend to refer to this document every time I add an IDL type so it's
helpful if it's comprehensive.
This option sets -fprofile-instr-generate -fcoverage-mapping for Clang
builds only on almost all of Userland. Loader and LibTimeZone are
exempt. This can be used for generating code coverage reports, or even
PGO in the future.
Now that clang-format-14 ubuntu packages are available, it's time to
finally upgrade our clang-format version. This version brings with it
a bunch of useful features with const-placement being the most notable.
These will be enabled in the following commits.
Moves the nix script to setup the build environment from Documentation
into the Toolchain as a callable script. I also modified the script
to accept a "pkgs" argument to make it easy to override the nixpkgs
version from the command-line when calling the script.
This document is meant to cover every significant step in the journey
from giving a page URL to LibWeb, and pixels showing up on screen.
It's by no means complete, but I wrote a fair chunk already, so I'll
commit at this stage and we can expand on it in-tree.
This should prevent a build issue caused by a potential
conflicting zstd installation on M1 Mac.
This was manifested in a linker error when building
the GNU toolchain:
```
Undefined symbols for architecture arm64:
[gcc/build] "_ZSTD_compress", referenced from:
```
This commit adds support for building the SerenityOS userland with the
new [mold linker].
This is not enabled by default yet; to link using mold, run the
`Toolchain/BuildMold.sh` script to build the latest release of mold, and
set the `ENABLE_MOLD_LINKER` CMake variable to ON. This option relies on
toolchain support that has been added just recently, so you might need
to rebuild your toolchain for mold to work.
[mold linker]: https://github.com/rui314/mold
It's not at all obvious how we need three different array-like types.
This change to the Patterns documentation attempts to explain why they
exist, how they differ (mostly in allocation behavior) and what their
use cases are. This builds on #11844 which fixates and tests the
hereby-described allocation behavior of FixedArray.
Some archive tools can open ext2 images like an archive, which is very
convenient for people that already have such tools like 7zip.
This also contains information for WSL users on where to find the
_disk_image in Explorer.
Remove note about CMake Tools as version 1.9.0 has shipped and no longer
needed. Update details for files to latest versions and allow easier
copy and paste into an empty file.
We used to build with -Os in order to fit within a certain size, but
there isn't really a good reason for that kind of restriction.
Switching to -O2 yields a significant improvement in throughput,
for example `test-js` is roughly 20% faster on my machine. :^)
As of qemu 6.0.0, it should already have the entitlement to access the
Hypervior.framework by default, so re-codesigning the binary is
no-longer necessary.
8a74ce618b
I intentionally don't document the format specifics, to prevent this
file from becoming outdated. Hence, only a list with pointers to where
to find details.
Apparently, qemu-system-* changed its name.
On Debian/Ubuntu, genext2fs does not make a difference: The only user of
this command, Meta/build-image-qemu.sh, runs as root anyway, and tries
to do 'mount _disk_image mnt/' first. Debian/Ubuntu always have drivers
for ext2 available, so this command has no good reason to fail, and
trying to use genext2fs might only obscure any problems that mount
encountered.
Finally, Debian Bullseye (released 2021-08-14) contains gcc-10, so the
instructions on how to upgrade are now obsolete.
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
After setting up the toochain on manjaro linux (new install) the build
of the toolchain failed as unzip was not found. The unzip package is
listed in the documentation for debian (apt) but is was missing for arch
linux.
This was straight up the wrong CMake variable to set. We care about
where the project will find Lagom, not where it wants to install its own
binaries to.
Extra configure options may need passed to CLion in order for it not to
choke on the new CMake setup. In particular, it's now a very bad idea to
pass CMAKE_CXX_COMPILER and CMAKE_C_COMPILER to the target build.
People seem to easily miss the "Setting up build tools" section, so I
have moved that step above the filesystem information and linked
directly to BuildInstructions.md to hopefully make it harder to skip.
Also, added mention of `\\wsl$` since that regularly comes up in
Discord.
I was building serenity on quite a fresh NixOS system and it turns
out `unzip` and `qemu` were missing from this nix expression to
compile and run serenity.
The default template argument is only used in one place, and it
looks like it was probably just an oversight. The rest of the Kernel
code all uses u8 as the type. So lets make that the default and remove
the unused template argument, as there doesn't seem to be a reason to
allow the size to be customizable.
This is a combination of the efforts of multiple people and hours of
pain trying to configure VSCode properly. This should give a good
baseline for anyone trying to develop Serenity with VSCode.
Co-authored-by: Hendiadyoin1 <leon2002.la@gmail.com>
Serenity build tooling autodetects gcc 10 so update-alternatives
is not necessary. Also, switching apt repositories on the fly can
cause issues with dependencies, package downgrades and leave the
system in a broken state.
After discussing on Discord about how to speed up the build time, I
received lots of helpful advice on measuring the build time, but none of
it was easily accessible. I thought other people might find it useful,
so I've written it down! :^)
Thanks goes to @bgianfo and @nico.
GCC and Clang allow us to inject a call to a function named
__sanitizer_cov_trace_pc on every edge. This function has to be defined
by us. By noting down the caller in that function we can trace the code
we have encountered during execution. Such information is used by
coverage guided fuzzers like AFL and LibFuzzer to determine if a new
input resulted in a new code path. This makes fuzzing much more
effective.
Additionally this adds a basic KCOV implementation. KCOV is an API that
allows user space to request the kernel to start collecting coverage
information for a given user space thread. Furthermore KCOV then exposes
the collected program counters to user space via a BlockDevice which can
be mmaped from user space.
This work is required to add effective support for fuzzing SerenityOS to
the Syzkaller syscall fuzzer. :^) :^)
This removes the '$' character so that it is easier to copy commands
directly from the build instructions and then executing them without
first having to remove the '$' character.