summaryrefslogtreecommitdiff
path: root/Meta/Lagom
AgeCommit message (Collapse)Author
2023-02-10AK+Everywhere: Do not implicitly copy variables in TRY macrosTimothy Flynn
For example, consider cases where we want to propagate errors only in specific instances: auto result = read_data(); // something like ErrorOr<ByteBuffer> if (result.is_error() && result.error().code() != EINTR) continue; auto bytes = TRY(result); The TRY invocation will currently copy the byte buffer when the expression (in this case, just a local variable) is stored into _temporary_result. This patch binds the expression to a reference to prevent such copies. In less trival invocations (such as TRY(some_function()), this will incur only temporary lifetime extensions, i.e. no functional change.
2023-02-09LibJS+LibWeb: Convert string view PrimitiveString instances to StringTimothy Flynn
First, this adds an overload of PrimitiveString::create for StringView. This overload will throw an OOM completion if creating a String fails. This is not only a bit more convenient, but it also ensures at compile time that all PrimitiveString::create(string_view) invocations will be handled as String and OOM-aware. Next, this wraps all invocations to PrimitiveString::create(string_view) with MUST_OR_THROW_OOM. A small PrimitiveString::create(DeprecatedFlyString) overload also had to be added to disambiguate between the StringView and DeprecatedString overloads.
2023-02-08Everywhere: Use ReadonlySpan<T> instead of Span<T const>MacDue
2023-02-08LibJS+LibLocale: Propagate OOM from CLDR RelativeTime Vector operationsTimothy Flynn
2023-02-08LibLocale: Propagate OOM from CLDR DateTime Vector and String operationsTimothy Flynn
2023-02-08LibJS+LibLocale: Propagate OOM from CLDR NumberFormat Vector operationsTimothy Flynn
2023-02-08AK: Remove the fallible constructor from `FixedMemoryStream`Tim Schumacher
2023-02-04Lagom/ConfigureComponents: Run cmake command lastKarol Kosek
Previously the tool was removing the Root directory after configuring cmake which was breaking the build, as some cmake rules put some necessary files there. Moving the cmake command to be the last one makes it regenerate those files automatically. :^)
2023-02-03Meta: Register CanvasPattern as a platform objectMacDue
2023-02-02Meta+CI: Disable Ladybird for fuzzer, compiler explorer and AndroidAndrew Kaster
And move it after the declaration of headless-browser, since WebDriver depends on headless-browser.
2023-02-01Meta: Set LD_LIBRARY_PATH to Build/lagom for Lagom test targetsTimothy Flynn
Some tests, such as those under LibGL, try to load shared libraries at runtime which are stored in Build/lagom. Because all tests' working directory is that of their CMakeLists.txt file, they fail to find those shared libraries at runtime. Set LD_LIBRARY_PATH to Build/lagom so the tests may find the shared libraries. This fixes, for example, both of these commands: ./Meta/serenity.sh test lagom TestAPI ./Meta/serenity.sh run lagom TestAPI
2023-02-01Meta: Set the Lagom test working directory for run-lagom-targetTimothy Flynn
When we call add_test() from each test's CMakeLists.txt, we specify the working directory to be that of the CMakeList.txt file itself. Create a property to store that directory and reference it when run-lagom-target is invoked by serenity.sh. Note that for non-test Lagom targets which do not set this property, the working directory will be Build/lagom (because the property will be the empty string, which CMake resolves relative to the current build path).
2023-02-01Meta: Derust fuzzer build docsNico Weber
The document wasn't updated in 9c2211f246b.
2023-02-01Meta: Build and run Tests/LibGfx in lagom buildsNico Weber
They can be run using Meta/serenity.sh test lagom TestFontHandling which will build _all_ test binaries and then run TestFontHandling. There's also Meta/serenity.sh run lagom TestFontHandling which will build just TestFontHandling and run it, but currently in a way that it doesn't pass. Finally, manually doing Meta/serenity.sh build lagom TestFontHandling followed by (cd Tests/LibGfx; ../../Build/lagom/Tests/LibGfx/TestFontHandling) will build and then run just that one test in a way that makes the test pass.
2023-01-29AK: Move memory streams from `LibCore`Tim Schumacher
2023-01-29AK: Move `Stream` and `SeekableStream` from `LibCore`Tim Schumacher
`Stream` will be qualified as `AK::Stream` until we remove the `Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is defined by `SeekableStream`, since defining its own would require us to qualify it with `AK::SeekMode` everywhere.
2023-01-29LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocateTimothy Flynn
Callers that are already in a fallible context will now TRY to allocate cells. Callers in infallible contexts get a FIXME.
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
2023-01-28LibAudio: Remove `try_` prefix from fallible LoaderPlugin methodsLinus Groh
2023-01-28LibGfx: Move ICCProfile.{h,cpp} to ICC/Profile.{h,cpp}Nico Weber
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2023-01-27LibJS+LibLocale: Propagate errors from find_regional_values_for_localeTimothy Flynn
This had quite the footprint.
2023-01-27LibJS+LibLocale: Port Intl.DateTimeFormat to StringTimothy Flynn
2023-01-27Meta: Allow running Lagom tests with "serenity.sh run lagom <target>"Timothy Flynn
After 5ac57f9, we could no longer run "serenity.sh run lagom TestString" because the TestString binary now lives in a subdirectory under Build/lagom. Thus the existing method of running "$BUILD_DIR/TestString" could not work. This adds a "run-lagom-target" custom target to Lagom, to run a command and pass arguments to that invocation. It turns out there really isn't a "pretty" way of doing this with CMake or Ninja. But we can pass these as environment variables for CMake to interpret. We just must be careful to massage arguments into a CMake list.
2023-01-26CodeGenerators: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-01-25LibWasm: Port the parser to `Core::Stream`Tim Schumacher
2023-01-22Meta: Register CanvasGradient as a platform objectMacDue
2023-01-22LibJS+LibLocale: Port remaining locale APIs to StringTimothy Flynn
2023-01-20Everywhere: Convert known short-strings to the infallible String factoryTimothy Flynn
For now, this is limited to strings that are 3 bytes or less. We can use 7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom hosts (e.g. wasm).
2023-01-20LibGfx: Re-structure the whole initialization pattern for image decodersLiav A
When trying to figure out the correct implementation, we now have a very strong distinction on plugins that are well suited for sniffing, and plugins that need a MIME type to be chosen. Instead of having multiple calls to non-static virtual sniff methods for each Image decoding plugin, we have 2 static methods for each implementation: 1. The sniff method, which in contrast to the old method, gets a ReadonlyBytes parameter and ensures we can figure out the result with zero heap allocations for most implementations. 2. The create method, which just creates a new instance so we don't expose the constructor to everyone anymore. In addition to that, we have a new virtual method called initialize, which has a per-implementation initialization pattern to actually ensure each implementation can construct a decoder object, and then have a correct context being applied to it for the actual decoding.
2023-01-19LibLocale+LibJS: Port locale parsing and processing to StringTimothy Flynn
In order to prevent this commit from having to refactor almost all of Intl, the goal here is to update the internal parsing/canonicalization of locales within LibLocale only. Call sites which are already equiped to handle String and OOM errors do so, however.
2023-01-19Meta: Use existing test-sources lists for Lagom instead of globbingSam Atkins
...mostly. This creates and uses an override for the `serenity_test()` function, so that Lagom can make use of the existing `Tests/LibFoo/CMakeLists.txt` files instead of having to GLOB for test source files and manually copy any data files. Some GLOBs remain but this is most of them. Co-authored-by: Andrew Kaster <akaster@serenityos.org>
2023-01-19Meta/Lagom: Make sure that libraries are always linked as PRIVATESam Atkins
2023-01-19LibCore: Implement FileWatcher for macOSTimothy Flynn
The macOS FileWatcher depends on macOS dispatch queues, which run on a different thread than the Core::EventLoop. This implementation handles filesystem events on its dispatch queue, then forwards the event back to the main Core::EventLoop for notifying the FileWatcher owner.
2023-01-18LibWeb: Convert the Location object to IDLLinus Groh
This includes: - Moving it from Bindings/ to HTML/ - Renaming it from LocationObject to Location - Removing the manual definitions of the constructor and prototype - Removing special handling of the Location interface from the bindings generator - Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions returning DeprecatedString instead of PrimitiveString - Adding missing (no-op) setters for the various attributes, which are expected to exist by the bindings generator
2023-01-18LibUnicode: Parse and generate case folding code point dataTimothy Flynn
Case folding rules have a similar mapping style as special casing rules, where one code point may map to zero or more case folding rules. These will be used for case-insensitive string comparisons. To see how case folding can differ from other casing rules, consider "ß" (U+00DF): >>> "ß".lower() 'ß' >>> "ß".upper() 'SS' >>> "ß".title() 'Ss' >>> "ß".casefold() 'ss'
2023-01-18LibUnicode: Rename a special casing variable name in the UCD generatorTimothy Flynn
This name will soon be a bit ambiguous with a similar case folding variable name.
2023-01-18LibUnicode: Update out-of-date spec linksTimothy Flynn
And remove links that aren't adding much value but will often get out of date (i.e. links to UCD files, which are already all listed in unicode_data.cmake).
2023-01-18FuzzilliJs: Print the result of JS::Value::to_string using AK::outlnTimothy Flynn
JS::Value::to_string now returns a String, which does not have a null- terminated characters() accessor.
2023-01-18LibCore: Implement FileWatcher for LinuxTimothy Flynn
This implements FileWatcher using inotify filesystem events. Serenity's InodeWatcher is remarkably similar to inotify, so this is almost an identical implementation. The existing TestLibCoreFileWatcher test is added to Lagom (currently just for Linux). This does not implement BlockingFileWatcher as that is currently not used anywhere but on Serenity.
2023-01-17Lagom/Fuzzers: Add fuzzer for ICCProfileNico Weber
2023-01-17AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()Sam Atkins
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-16LibUnicode: Generate simple case folding mappings for titlecaseTimothy Flynn
Note we already generate the special case foldings for titlecase.
2023-01-15LibIPC: Decode messages using Core::Stream internallyTim Schumacher
2023-01-15Lagom/Fuzzers: Add fuzzer for the TGALoader codeLiav A
2023-01-15LibJS+Everywhere: Rename Value::to_string to to_deprecated_stringTimothy Flynn
2023-01-15Everywhere: Fully qualify IsLvalueReference in TRY() macrosAndrew Kaster
If USING_AK_GLOBALLY is not defined, the name IsLvalueReference might not be available in the global namespace. Follow the pattern established in LibTest to fully qualify AK types in macros to avoid this problem.
2023-01-14LibWeb: Implement value_id_from_string by hash lookupBen Wiederhake
The old approach was basically a linear scan, which is slower than a hash map for the currently 303 elements, as evidenced by the new benchmark in TestCSSIDSpeed. Before: Completed benchmark 'value_id_from_string' in 3238ms After: Completed benchmark 'value_id_from_string' in 193ms
2023-01-14LibWeb: Run tests in lagom if ENABLE_LAGOM_LIBWEB is setBen Wiederhake
2023-01-13AK+Everywhere: Disallow returning a reference from a fallible expressionTimothy Flynn
This will silently make a copy. Rather than masking this behavior, let's explicitly disallow it.