Commit Graph

1121 Commits

Author SHA1 Message Date
Daniel Bertalan
4055c393fc Toolchain: Add support for building the userland with the mold linker
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
2022-01-24 10:41:47 +00:00
Tom
869c20b05d Meta+LibEDID: Download and generate the PNP ID database
This downloads the UEFI's published PNP ID database and generates a
lookup table for use in LibEDID. The lookup table isn't optimized at
all, but this can be easily done at a later point if needed.
2022-01-23 22:45:21 +00:00
Idan Horowitz
ace36681ff LibJS+LibIMAP: Use the new Optional<U>(Optional<T>) constructor
These look much nicer than these repeated ternaries :^)
2022-01-23 18:53:42 +02:00
mjz19910
1ef633472b Everywhere: Convert VM::call() to JS::call() 2022-01-23 15:24:45 +00:00
Timothy Flynn
6057a2ca30 timezone: Add a command line utility to set the system time zone 2022-01-23 12:48:26 +00:00
Timothy Flynn
da27937144 LibTimeZone: Add an API to retrieve a list of all known IANA time zones 2022-01-23 12:48:26 +00:00
Nico Weber
fd7de68d07 LibHTTP+AK: Rename CNETWORKJOB_DEBUG to NETWORKJOB_DEBUG 2022-01-23 00:45:22 +00:00
Nico Weber
a17b2248f2 LibHTTP+AK: Rename CHTTPJOB_DEBUG to HTTPJOB_DEBUG 2022-01-23 00:45:22 +00:00
Idan Horowitz
024ee0a99a CI: Fail Lagom linters step as soon as any linter fails
This prevents linters from covering the failure of previous linters by
overwriting the error code that Azure reads at the end of the step.
2022-01-22 21:40:09 +02:00
Nico Weber
3831e5fcff Utilities+Lagom: Remove test-crypto
After 4d5ffd364a, Tests/{LibCrypto,LibTLS} test the same things
and test-crypto has been redundant since then.
2022-01-22 01:44:05 +00:00
Nico Weber
6d532649d4 RequestServer+AK: Move happy-path logging behind REQUESTSERVER_DEBUG
vdbgln() was responsible for ~10% of samples on pv's flamegraph for
RequestServer (under request_did_finish) when loading github.com in
Browser and recording a whole-system profile. This makes that almost
completely disappear.
2022-01-22 01:28:01 +00:00
davidot
7cbf4b90e8 LibJS: Implement ImportCall and HostImportModuleDynamically
This allows us to load modules from scripts.
This can be dangerous as it can load arbitrary files. Because of that it
fails and throws by default. Currently, only js and JavaScriptTestRunner
enable the default hook.

This also adds tests to test-js which test module code. Because we
form a spec perspective can't "enter" a module this is the easiest way
to run tests without having to modify test-js to have special cases for
modules.
To specify modules in test-js we use the extension '.mjs' this is to
ensure the files are not executed. We do still want to lint these files
so the prettier scripts have changed to look for '.mjs' files as well.
2022-01-22 01:21:18 +00:00
davidot
0b89dbc529 Meta: Add JS_MODULE_DEBUG define flag 2022-01-22 01:21:18 +00:00
Luke Wilde
631bbcd00a LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow
InitializeHostDefinedRealm, but I couldn't fit it in the title :^)

This allows us to follow the spec much more closely rather than being
completely ad-hoc with just the parse node instead of having all the
surrounding data such as the realm of the parse node.

The interpreter creation refactor creates the global execution context
once and doesn't take it off the stack. This allows LibWeb to take the
global execution context and manually handle it, following the HTML
spec. The HTML spec calls this the "realm execution context" of the
environment settings object.

It also allows us to specify the globalThis type, as it can be
different from the global object type. For example, on the web, Window
global objects use a WindowProxy global this value to enforce the same
origin policy on operations like [[GetOwnProperty]].

Finally, it allows us to directly call Program::execute in perform_eval
and perform_shadow_realm_eval as this moves
global_declaration_instantiation into Interpreter::run
(ScriptEvaluation) as per the spec.

Note that this doesn't evalulate Source Text Modules yet or refactor
the bytecode interpreter, that's work for future us :^)

This patch was originally build by Luke for the environment settings
object change but was also needed for modules. So I (davidot) have
modified it with the new completion changes and setup for that.

Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22 01:21:18 +00:00
kleines Filmröllchen
8a92573732 LibAudio: Convert FlacLoader to use new Core::Stream APIs :^)
For this change to work "easily", Loader can't take const ByteBuffer's
anymore, which is fine for now.
2022-01-22 01:13:42 +03:30
mjz19910
2cf02c6f38 adjtime: Port to LibMain 2022-01-21 01:52:22 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Sam Atkins
cff44831a8 LibWeb: Remove Length::Type::Percentage :^)
All `<percentage>`s in the CSS grammar are now represented by the
`Percentage` class, and `<length-percentage>` by `LengthPercentage`.
2022-01-20 00:04:10 +01:00
Sam Atkins
01b57fa8b7 LibWeb: Add CSS::Percentage, PercentageOr and LengthPercentage types
Length and Percentage are different types, and sometimes only one or the
other is allowed in a given CSS property. This is a first step towards
separating them.
2022-01-20 00:04:10 +01:00
Timothy Flynn
4400150cd2 LibJS+LibUnicode: Return the appropriate time zone name depending on DST 2022-01-19 21:20:41 +00:00
Timothy Flynn
bf677eb485 LibUnicode: Generate both standard and daylight time zone names
While LibTimeZone didn't support DST, we only generated one of them,
preferring the standard name. Now that DST can be tested, generate both
names.
2022-01-19 21:20:41 +00:00
Timothy Flynn
70f49d0696 LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DST
Return whether the time zone is in DST during the provided time from
TimeZone::get_time_zone_offset,
2022-01-19 21:20:41 +00:00
Timothy Flynn
42c9c57141 LibJS+LibTimeZone: Begin handling DST when computing time zone offsets
This also updates some expectations in a Temporal time zone offset test
that is using a time stamp which is in DST for a few time zones.
2022-01-19 21:20:41 +00:00
Timothy Flynn
9dd4602636 LibTimeZone: Parse and generate DST rule links for each ZONE entry
Each ZONE entry contains a RULES segment with one of the following:

  * A DST rule name, which links the ZONE to a RULE entry holding the
    DST rules to apply.
  * A static offset to be applied to the STDOFF offset. This implicitly
    means that the time zone is in DST during that time frame.
  * A "-" string, meaning no offset is applied to the STDOFF offset, and
    the time zone is in standard time during that time frame.
2022-01-19 21:20:41 +00:00
Timothy Flynn
0e58b04b5c LibTimeZone: Begin parsing and generating DaylightSavings rules 2022-01-19 21:20:41 +00:00
Timothy Flynn
701b7810ba LibUnicode: Generate code point abbreviations 2022-01-18 15:13:25 +00:00
Idan Horowitz
877ae85017 LibJS+LibUnicode: Make static const Utf8View variables constexpr 2022-01-17 14:46:07 +00:00
Tobias Christiansen
89c0f84a28 Meta: Add icons to online man pages
Previously all the added icons weren't available in the online version
of the man pages. This patch adds functionality to copy all the used
icons over when assembling the HTML version.
2022-01-17 02:22:33 -08:00
Ali Mohammad Pur
63b02859bc Meta+Ports: Make 'package.sh showproperty' report multiple properties
And use that to avoid shelling out multiple times for checking
properties in lint-ports.py.
2022-01-17 11:17:15 +01:00
Brian Gianforcaro
d20c5da0da Meta: Optimized lint-ports.py by avoiding duplicate execs of package.sh
The way that lint-ports.py obtains the ports properties is unfortunately
very process intensive. You have to execute `./package.sh showproperty`
once for each property, for each port. Resulting in hundreds of
executions.

We were doing this work twice in both `check_package_files()` and in
`read_port_dirs()`. This resulted in a runtime of around ~10 seconds on
my machine. Removing the duplicate work and allowing the other code path
to utilize the to use the cached properties brought the runtime down to
~5 seconds on my machine.
2022-01-17 11:17:15 +01:00
Brian Gianforcaro
4b2bbe6a7e Meta: Skip shellcheck for Ports in pre-commit hook
Shellcheck barfs on many of the patterns we use in port scripts, the
check is already disabled when we run the script in CI, so we might as
well disable the check for pre-commit as well.
2022-01-17 11:17:15 +01:00
Ali Mohammad Pur
8d30e14d28 Meta: Ensure that all port patches are documented in the linter
This adds a list of ports without descriptions to filter out the
existing ports with unexplained ports, this list should *not* be
appended to!

It also adds a (for now) disabled check that ensures all ports have
patches made with (or compatible with) git.
2022-01-16 10:32:50 +03:30
creator1creeper1
7851151cfb Meta: Make check-symbols.sh use the correct build directory
Since the build now happens in Build/$SERENITY_ARCH/ and not in Build/,
this updates check-symbols.sh to use the correct directory to check the
LibC symbols in. For some reason, the constant failures did not show
up as errors in CI.
2022-01-15 17:51:40 +01:00
sin-ack
2e1bbcb0fa LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer
This change unfortunately cannot be atomically made without a single
commit changing everything.

Most of the important changes are in LibIPC/Connection.cpp,
LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp.

The notable changes are:
- IPCCompiler now generates the decode and decode_message functions such
  that they take a Core::Stream::LocalSocket instead of the socket fd.
- IPC::Decoder now uses the receive_fd method of LocalSocket instead of
  doing system calls directly on the fd.
- IPC::ConnectionBase and related classes now use the Stream API
  functions.
- IPC::ServerConnection no longer constructs the socket itself; instead,
  a convenience macro, IPC_CLIENT_CONNECTION, is used in place of
  C_OBJECT and will generate a static try_create factory function for
  the ServerConnection subclass. The subclass is now responsible for
  passing the socket constructed in this function to its
  ServerConnection base; the socket is passed as the first argument to
  the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before
  any other arguments.
- The functionality regarding taking over sockets from SystemServer has
  been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket
  implementation of this functionality hasn't been deleted due to my
  intention of removing this class in the near future and to reduce
  noise on this (already quite noisy) PR.
2022-01-15 13:29:48 +03:30
Timothy Flynn
6a4c1e4b7b CI: Disallow test failures on macOS Lagom :^) 2022-01-14 22:39:06 +01:00
Lucas CHOLLET
9e1e80954b gml-format: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
affef5d1a9 disasm: Port to LibMain 2022-01-14 19:42:19 +02:00
Timothy Flynn
c86f7a675d LibUnicode: Do not limit language display names to known locales
Currently, the UnicodeLocale generator collects a list of known locales
from the CLDR before processing language display names. For each locale,
the identifier is broken into language, script, and region subtags, and
we create a list of seen languages. When processing display names, we
skip languages we hadn't seen in that first step.

This is insufficient for language display names like "en-GB", which do
not have an locale entry in the CLDR, and thus are skipped. So instead,
create the list of known languages by actually reading through the list
of languages which have a display name.
2022-01-13 23:05:31 +01:00
Timothy Flynn
91acc2e9c5 LibUnicode: Parse and generate locale display patterns
These patterns indicate how to display locale strings when that locale
contains multiple subtags. For example, "en-US" would be displayed as
"English (United States)".
2022-01-13 23:05:31 +01:00
Timothy Flynn
0d75949827 LibUnicode: Parse and generate locale display names for date fields 2022-01-13 13:43:57 +01:00
Timothy Flynn
7f162c471d LibUnicode: Parse and generate locale display names for calendars
Note there's a bit of an unfortunate duplication in the calendar enum
generated by UnicodeLocale and the existing enum generated by
UnicodeDateTimeFormat. The former contains every calendar known to the
CLDR, whereas the latter contains the calendars we've actually parsed
for DateTimeFormat (currently only Gregorian). The new enum generated
here can be removed once DateTimeFormat knows about all calendars.
2022-01-13 13:43:57 +01:00
DavidLindbom
c6f3856d4f man.serenityos.org: Include Games section on index page 2022-01-13 13:43:51 +01:00
Chris Frey
8f3759c04f Meta: Use fuse2fs if available to avoid root when building image
The fuse2fs tool that is part of e2fsprogs-1.46 has a 'fakeroot'
mount option.  This allows a non-root users to modify file ownership
and permissions without actually being root.  This package is
available in Debian bullseye and buster-backports.

If available, the script assumes the user wants to use it.
Otherwise, it falls back to the usual root requirements.

Now that root is not required, the root check in
build-root-filesystem.sh is not necessary.  Since
build-root-filesystem.sh has 'set -e' enabled, removing this check
will not cause a change in functionality.
2022-01-13 03:35:21 -08:00
Chris Frey
951f7becec Meta: Use consistent indents in build-image-qemu.sh
This is a whitespace only commit to avoid confusion with the
next feature commit.
2022-01-13 03:35:21 -08:00
Chris Frey
319cdf4ff3 Meta: Do not ignore error message with exec
When calling sub-programs from shell with exec, the useful || die
idiom does not actually do anything, since the first script is gone.
2022-01-13 03:35:21 -08:00
Timothy Flynn
bdf02c21e1 LibUnicode: Swap the preferred order of standard time zone display names
Our generator is currently preferring the DST variant of the time zone
display names over the non-DST variant. LibTimeZone currently does not
have DST support, and operates in a mode that basically assumes DST does
not exist. Swap the display names for now just to be consistent until we
have DST support.

Note we will need to generate both of these variants and select the
appropriate one at runtime once we have DST support.
2022-01-12 15:43:12 +01:00
Itamar
f464ae84ce CMake: Add HACKSTUDIO_BUILD option for building from Hack Studio
If this option is set, we will not build all components.
Instead, we include an external CMake file passed in via a variable
named HACKSTUDIO_BUILD_CMAKE_FILE.

This will be used to build serenity components from Hack Studio.
2022-01-12 14:55:19 +01:00
Timothy Flynn
0d8120eeb2 LibUnicode: Perform number system lookups by enumeration value
Now that number systems are generated as an enum, we can generated the
number system data in the order of that enum. This lets us perform
lookups of that data by index instead of a loop of string comparisons.
2022-01-12 10:49:07 +01:00
Timothy Flynn
c5138f0f2b LibUnicode: Parse number system digits from the CLDR
We had a hard-coded table of number system digits copied from ECMA-402.
Turns out these digits are in the CLDR, so let's parse the digits from
there instead of hard-coding them.
2022-01-12 10:49:07 +01:00
Timothy Flynn
e2dfbe8f67 LibUnicode: Parse and generate long and short generic time zone names
This implements the CalendarPatternStyle::{Long,Short}Generic styles of
time zone name formatting.
2022-01-11 23:56:35 +01:00