Commit graph

32651 commits

Author SHA1 Message Date
Idan Horowitz
709fe64c1b Revert "Kernel: Use a StringView for Ext2FSDirectoryEntry::name"
This reverts commit d1d24eaef4.

I missed the fact that traverse_as_directory uses a temporary buffer,
meaning that entries created based on its callback will point to free'd
memory.
2022-01-12 21:26:03 +02:00
Marcus Nilsson
a0ba21e442 LibGUI: Print error when failing to load thumbnail in FileSystemModel
If a thumbnail cannot load it's a good opportunity to print out the
error message.
On top of that, we still want to update m_thumbnail_progress so that
the progress bar doesn't get stuck instead of returning early from
the lambda.
2022-01-12 19:44:17 +01:00
Jelle Raaijmakers
263348ff2d Taskbar: Include ScreenLayout.h from Services directory
While trying to include `Desktop.h` for the SDL2 port, compilation
failed on finding this include. Specify the full include path to make
it work.
2022-01-12 20:26:46 +02:00
Timothy Flynn
a121c913c0 LibJS: Add some Intl.DateTimeFormat tests for specific time zones
Now that we can use time zones, let's adds tests for them.
2022-01-12 15:43:12 +01:00
Timothy Flynn
d64ea13565 LibJS: Respect the user-provided time zone in Intl.DateTimeFormat
Also update some DateTimeFormat tests to explicitly set the time zone
(usually to UTC). This was already done for most tests, but some were
missed.
2022-01-12 15:43:12 +01:00
Timothy Flynn
8987deb984 LibJS: Partially implement the LocalTZA AO
Intl.DateTimeFormat will invoke this AO with isUTC=true, so this only
implements that branch in LocalTZA.
2022-01-12 15:43:12 +01:00
Timothy Flynn
f6786881aa LibJS: Implement the ECMA-402 definition of DefaultTimeZone
Simply defer to LibTimeZone to retrieve the system's current time zone.
Also update some Temporal tests to explicitly set the time zone to UTC.
2022-01-12 15:43:12 +01: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
Timothy Flynn
8a4ac9c387 LibTimeZone: Add an API to retrieve the system's current time zone
This is a wrapper API around the POSIX tzset / tzname information. It
is to help ensure that tzset is invoked before accessing tzname.
2022-01-12 15:43:12 +01:00
Idan Horowitz
9a7cd8fef8 Kernel: Make Thread::backtrace() fallible using KString 2022-01-12 16:09:09 +02:00
Idan Horowitz
06af81fcfb Kernel: Move NonnullRefPtrVector<NVMeQueue>s instead of copying them 2022-01-12 16:09:09 +02:00
Idan Horowitz
4b74f2e3ec Kernel: Convert NVMeNameSpace::try_create() to KString 2022-01-12 16:09:09 +02:00
Idan Horowitz
c92753a686 Kernel: Convert IPv4SocketTuple::to_string() to KString 2022-01-12 16:09:09 +02:00
Idan Horowitz
b84444cbb3 Kernel: Move IPv4SocketTuple into the Kernel namespace
This class was accidentally declared in the global namespace.
2022-01-12 16:09:09 +02:00
Idan Horowitz
bc85b64a38 Kernel: Replace usages of String::formatted with KString in sys$exec 2022-01-12 16:09:09 +02:00
Idan Horowitz
dba0840942 Kernel: Remove outdated FIXME comment in sys$sethostname 2022-01-12 16:09:09 +02:00
Idan Horowitz
e236f9d85a Kernel: Convert Inode event APIs to use StringViews instead of Strings
These APIs allocate a copy internally anyways, so there's no point to
making another one for them.
2022-01-12 16:09:09 +02:00
Idan Horowitz
d1d24eaef4 Kernel: Use a StringView for Ext2FSDirectoryEntry::name
This is a temporary struct, so there's no need to allocate a long term
storage for these strings.
2022-01-12 16:09:09 +02:00
Idan Horowitz
8a4654a924 Kernel: Make PerformanceEventBuffer::add_process fallible with ErrorOr 2022-01-12 16:09:09 +02:00
Idan Horowitz
d2ffcfb762 Kernel: Remove the Custody::absolute_path() API
With the last user removed this non-fallible API can now be removed.
2022-01-12 16:09:09 +02:00
Idan Horowitz
efc61370c0 Kernel: Convert ProcFS Process getters to try_serialize_absolute_path 2022-01-12 16:09:09 +02:00
Idan Horowitz
174056a479 Kernel: Use try_serialize_absolute_path in PerformanceEventBuffer
This only moves the issue, as PerformanceEventBuffer::add_process can't
fail yet, but this will allow us to remove the non-failable
Custody::absolute_path API.
2022-01-12 16:09:09 +02:00
Idan Horowitz
a482f7718d Kernel: Convert CoreDump to KString using try_serialize_absolute_path 2022-01-12 16:09:09 +02:00
Idan Horowitz
eb5f6cd108 Kernel: Use try_serialize_absolute_path in ProcFSOverallProcesses 2022-01-12 16:09:09 +02:00
Idan Horowitz
4e7d307166 Kernel: Convert Mount::absolute_path to ErrorOr<NonnullOwnPtr<KString>> 2022-01-12 16:09:09 +02:00
Idan Horowitz
6be2a51b10 Kernel: Use Vector::try_append in Custody::try_serialize_absolute_path 2022-01-12 16:09:09 +02:00
Idan Horowitz
194d1c884b Kernel: Convert CommandLine to KString 2022-01-12 16:09:09 +02:00
Idan Horowitz
a4560313eb Kernel: Replace all usages of String::number with KString::number 2022-01-12 16:09:09 +02:00
Idan Horowitz
aa1f7060af Kernel: Add an error propagating KString::number() API
This is simply a thin wrapper around the already existing
KString::formatted() API.
2022-01-12 16:09:09 +02:00
Idan Horowitz
809870d519 Kernel: Convert ProcessorInfo to KString 2022-01-12 16:09:09 +02:00
Idan Horowitz
b4ce1e2e62 Kernel: Remove unused ProcessorInfo::m_processor field 2022-01-12 16:09:09 +02:00
Idan Horowitz
f9528f1882 Kernel: Rename ProcessorInfo::{m_brandstr => m_brand}
There's no need to specify the type of the member in it's name,
especially not in shorthand format.
2022-01-12 16:09:09 +02:00
Itamar
be81278634 HackStudio: Use ProjectBuilder to build and run the current project
This enables building and running standalone serenity components from
Hack Studio :^)
2022-01-12 14:55:19 +01:00
Itamar
bb6324a9a9 HackStudio: Add ProjectBuilder component
ProjectBuilder takes care of building and running the current project
from Hack Studio.

The existing functionality of building javascript and Makefile projects
remains, and in addition to it the ability to build standalone serenity
components is added.

If the Hack Studio project is the serenity repository itself,
ProjectBuilder will attempt building the component that the currently
active file belongs to.

It does so by creating a new CMake file which adds the component as a
build subdirectory.
It also parses all CMake files in the serenity repository to gather all
available libraries. It declares the libraries and their dependencies in
this CMake file.

It then uses the HACKSTUDIO_BUILD CMake option to direct the build
system to use this CMake file instead of doing a full system build.
2022-01-12 14:55:19 +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
Itamar
afb4c447b4 HackStudio: Add optional parameters to TerminalWrapper::run()
The optional parameters allow specifying a working directory and
controlling whether or not to block until the command returns.
2022-01-12 14:55:19 +01:00
Itamar
3afd17db9d HackStudio: Add Project::project_is_serenity() function 2022-01-12 14:55:19 +01:00
Itamar
95545648bd LibCore: Add utility class for temporary files and directories
Core::TempFile is a RAII type that creates a temporary file or directory
on construction and deletes it on destruction.
2022-01-12 14:55:19 +01:00
Itamar
28a6686f2c LibC: Install libssp.a in /usr/lib
It previously was not included in the install stage.
2022-01-12 14:55:19 +01:00
Itamar
fbdd6df185 LibCore: Make Core::command return CommandResult struct
Previously, Core::command only returned a String which contained the
data from stdout.

The CommandResult struct contains the exit code as well as the data
from stdout and stderr.
2022-01-12 14:55:19 +01:00
Jelle Raaijmakers
a4e2d93aa2 Ports+LibGL: Replace LibGL context check by ScummVM patch
According to the OpenGL spec, invoking functions without an active
context results in undefined behavior. Since ScummVM seems to be the
only port having issues with our behavior, patch their code instead.
2022-01-12 14:54:18 +01:00
Daniel Bertalan
3cbf20ca5d Ports: Remove obsolete mold patch
This is no longer needed, as both toolchains now support
std::filesystem.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
c7423dc20b LibC: Make the address argument of malloc_size a pointer to const
We don't mutate the pointed-to memory, so let's be const correct.

Fixes building the `mimalloc` library that's optionally used by the mold
linker (note that it isn't enabled yet as I haven't tested it).
2022-01-12 14:54:12 +01:00
Daniel Bertalan
9e8c4bb072 Toolchain: Enable the -rdynamic flag in the gcc driver
Although we handle it in the linker spec file, gcc will actually reject
this argument unless it's also enabled in the option file.

CMake adds this flag if the minimum required version is 3.3 or less (see
CMP0065), so old projects would fail to compile because of this
unrecognized option.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
fbccf77d37 Toolchain: Enable std::filesystem support in libc++
Now that the last missing function (`fchmodat(2)`) has been added to
LibC, libc++ compiles successfully with std::filesystem support enabled.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
182016d7c0 Kernel+LibC+LibCore+UE: Implement fchmodat(2)
This function is an extended version of `chmod(2)` that lets one control
whether to dereference symlinks, and specify a file descriptor to a
directory that will be used as the base for relative paths.
2022-01-12 14:54:12 +01:00
Andreas Kling
5f71925aa4 Kernel: Actually clear page slots in Region::clear_to_zero()
We were copying the RefPtr<PhysicalPage> and zeroing the copy instead
of zeroing the slot itself.
2022-01-12 14:52:47 +01:00
Andreas Kling
d8206c1059 Kernel: Don't release/relock spinlocks repeatedly during space teardown
Grab the page directory and MM locks once at the start of address space
teardown, then hold onto them across all the region unmapping work.
2022-01-12 14:52:47 +01:00
Andreas Kling
2323cdd914 Kernel: Do less unnecessary work when tearing down process address space
When deleting an entire AddressSpace, we don't need to do TLB flushes
at all (since the entire page directory is going away anyway).

We also don't need to deallocate VM ranges one by one, since the entire
VM range allocator will be deleted anyway.
2022-01-12 14:52:47 +01:00
Andreas Kling
a702b6ec42 AK: Remove unnecessary null checks in RedBlackTree 2022-01-12 14:52:47 +01:00