Commit graph

50812 commits

Author SHA1 Message Date
Daniel Bertalan
41f7f821f6 Toolchain+Ports: Use ftpmirror.gnu.org for faster downloads
This service automatically redirects to a mirror that's geographically
closer, which should make downloading the tarballs faster. The GNU
project recommends this instead of bombarding their top-level downloads
site.
2023-05-28 06:34:12 -07:00
Daniel Bertalan
9bceff88c8 Toolchain: Fix Linux libisl detection in BuildGDB.sh
There is no top-level `isl.h`, let's check for `isl/version.h` instead.
2023-05-28 06:34:12 -07:00
Daniel Bertalan
4ff30a7302 LibTest: Use the 16 standard ANSI colors in status output
Neither Azure Pipelines' log viewer, nor macOS Terminal.app support full
24-bit RGB color codes, causing the text output to be displayed
incorrectly. Fix this by using one of the 16 standard colors.

Most terminal emulators use a relatively dark shade for red by default,
as seen in the "ANSI escape code" Wikipedia article, so change the
foreground color to white to preserve contrast.
2023-05-28 06:31:59 -07:00
MacDue
778265ae9d LibJS: Fix reading cached source ranges
Made a slight logic error in 95d69fc which meant the dummy range would
be returned even if the source_range_storage contained an actual source
range. This corrects that by resolving the null unrealized range to a
dummy range, and storing that. It then can be treated as a normal source
range.
2023-05-28 14:40:22 +02:00
MacDue
95d69fcf74 LibJS: Fix crash when trying to get source range
Previously, source_range() could crash attempting to read from a null
unrealized->source_code pointer. It looks like the previous behaviour
here was to return a dummy source range, so this commit restores that.

With this loading https://github.com/SerenityOS/serenity works again.
2023-05-28 13:57:51 +02:00
Sam Atkins
a5aabb7940 SpaceAnalyzer: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Sam Atkins
da8da79e62 LibCore: Add wrapper for fstatat()
`Core::System::fstatat()` is similar to our standard `Core::System`
wrappers.

`Core::Directory::stat(relative_path, flags)` is a convenience method if
you already have a Directory, to stat a file relative to it.
2023-05-28 05:51:27 -06:00
Sam Atkins
c140b67be3 AK: Verify that we don't call Error::from_errno(0)
We shouldn't ever make an Error if there wasn't actually an error. :^)
2023-05-28 05:51:27 -06:00
Sam Atkins
6bcde0dcf4 LibCore: Don't record false DirIterator errors
`readdir()` returns null if there is an error, OR if we reached the end.
We don't need to create an Error if there wasn't one.
2023-05-28 05:51:27 -06:00
Sam Atkins
cec8543097 Terminal: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Sam Atkins
28a4adba3d DisplaySettings: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Rafał Babiarz
fb445fc523 Ladybird: Add placeholder to LocationEdit 2023-05-28 05:47:20 -06:00
Shannon Booth
500552df54 LibWeb: Apply rules for parsing a legacy color value 2023-05-28 13:24:37 +02:00
Shannon Booth
bc54560e59 LibWeb: Add Web::HTML::parse_legacy_color_value
This function follows the "rules for parsing a legacy color value"
which is used in some legacy attributes, such as 'bgcolor' in the body
element.
2023-05-28 13:24:37 +02:00
Shannon Booth
15151d7a4c LibGfx: Add Color::from_named_css_color_string
This is factored out from Color::from_string and determines the color
only from performing an ASCII case-insensitive search over the named
CSS colors.
2023-05-28 13:24:37 +02:00
Andreas Kling
f5bf53bc99 LibWasm: Create AK::StackInfo once per AbstractMachine
This makes test-wasm about 20% faster on my Linux machine :^)
2023-05-28 13:20:56 +02:00
Daniel Bertalan
4cc1de1b03 CI: Add testing for AArch64 :^)
This should help us avoid accidentally breaking the build for AArch64.
Currently, some tests are expected to fail, so CI runs will be
considered successful even if the kernel panics or if there are test
failures.

For now, we have to build Qemu with a custom patch from source in order
for SystemServer to detect self-test mode.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
2e0e80db69 LibC: Ensure that struct group::gr_mem pointers are aligned
Otherwise, we get a UBSan crash in SystemServer before we could even
start running tests on AArch64.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
7987bf5b92 Kernel/aarch64: Add RPi/MMIO.cpp to SOURCES_RUNNING_WITHOUT_MMU
Otherwise, `MMIO::MMIO` will fault on the RPi 3 due to accessing
`__stack_chk_guard` before the kernel is mapped into high memory.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
12a2f741a7 LibCrypto: Add workaround for false -Warray-bounds warning
When building for AArch64 with UBSan enabled, GCC 13.1 reports a false
"array out of bounds" error on access to offset `1 * sizeof(u64)`.
Changing the order of the stores seems to silence it.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
6bcd73a2ff Toolchain: Disable libstdc++ PCH compilation
These are not useful for us, and unnecessarily waste time when building
the toolchain. Even if we used libstdc++ more heavily, our use of
uncommon, PCH-affecting flags and our frequent LibC header changes would
make these ineligible for use anyways.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
65a97ad503 Tests/Kernel: Do not build TestEFault on AArch64
This test currently causes a kernel panic, as we do not handle SafeMem
exceptions correctly (beb55f726f).
2023-05-28 05:05:09 -06:00
Daniel Bertalan
2a2787b199 Kernel/aarch64: Make Processor::capture_stack_trace stub non-crashing
This is the only kernel issue blocking us from running the test suite.
Having userspace backtraces printed to the debug console during crashes
isn't vital to the system's function, so let's just return an empty
trace and print a FIXME instead of crashing.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
58da4c93fb Toolchain+CI: Remove cache handling logic from BuildIt.sh
Instead of manually compressing/decompressing a toolchain tarball if
`TRY_USE_LOCAL_TOOLCHAIN` is set, let's use the cache action's automatic
built-in compression (which is zstd, I believe).
2023-05-28 05:05:09 -06:00
Daniel Bertalan
18ee6e457d CI: Update actions/cache to v3
This version now natively supports read-only caches (`cache/restore@v3`)
so we no longer need to pin the version to a commit in actions/cache#489
which is an unmerged PR.

The update is mostly mechanical:
- Steps with `CACHE_SKIP_SAVE` not set can use the plain `cache@v3`
  action.
- Steps with `CACHE_SKIP_SAVE` set to a constant `true` are changed to
  `cache/restore@v3`.
- Steps with saving disabled when running on a pull request are changed
  to a pair of `cache/restore@v3` and `cache/save@v3`. This setup is
  used for the large (100s of MB) ccache and Toolchain caches. As caches
  saved in pull requests can only be utilized from within the same PR,
  uploading these would only waste time and our storage quote.
  Therefore, we skip the `save` steps if running on a PR.

Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
2023-05-28 05:05:09 -06:00
Andi Gallo
c411b5408e LibWeb: Improve support for selecting an image source
Apply media conditions before selecting a size and add an algorithm to
select an image source based on pixel density.
2023-05-28 12:11:10 +02:00
Andi Gallo
29d29134ba LibWeb: Skip children based on media when updating the source set
If child has a media attribute and its value does not match the
environment, continue to the next child.
2023-05-28 12:11:10 +02:00
Andreas Kling
87ac906ee6 LibJS: Make Error stack traces lazier
Instead of eagerly populating the stack trace with a textual
representation of every call frame, just store the raw source code range
(code, start offset, end offset). From that, we can generate the full
rich backtrace when requested, and save ourselves the trouble otherwise.

This makes test-wasm take ~7 seconds on my machine instead of ~60. :^)
2023-05-28 10:03:11 +02:00
Andreas Kling
6c81b90e5a headless-browser: Call fflush() between tests when running on TTY
This allows us to see the full test name without getting cut off by
stdio buffering. :^)
2023-05-28 08:03:52 +02:00
Nico Weber
ea54c58930 WebP/Lossy: Variable naming fix for constants from last pull request 2023-05-27 15:25:00 -06:00
Nico Weber
bd5290dd45 WebP/Lossy: Add code to read macroblock metadata 2023-05-27 15:25:00 -06:00
Nico Weber
8159709c83 WebP/Lossy: Add static data tables for reading macroblock metadata 2023-05-27 15:25:00 -06:00
MacDue
02d131bc4d LibWeb: Fix goofy CRC2D.arc() behaviour
This PR corrects the signs of the start/end points that are passed
to the elliptical_arc_to(), it also removes the bogus path.close()
after creating the arc. Now .arc() seems to work correctly.
2023-05-27 22:13:26 +02:00
Andreas Kling
f7eb8eed34 Ladybird: Run all layout & text tests in the same process
Instead of starting a new headless-browser for every layout & text test,
headless-browser now gets a mode where it runs all the tests in a single
process.

This is massively faster on my machine, taking a full LibWeb test run
from 14 seconds to less than 1 second. Hopefully it will be a similarly
awesome improvement on CI where it has been soaking up more and more
time lately. :^)
2023-05-27 21:28:05 +02:00
Sam Atkins
af68bf862f LibWeb: Resolve border[-color,-style,-width] properties 2023-05-27 20:55:00 +02:00
Sam Atkins
abdd4a8733 LibWeb: Add helper for creating resolved values for sided shorthands
...and use it for `margin` and `padding`.

So now, if all four margins are 12px, we output "12px" instead of "12px
12px 12px 12px". This matches the spec's requirement to use the smallest
non-ambiguous representation.
2023-05-27 20:55:00 +02:00
Sam Atkins
e8dc8f697b LibWeb: Alphabetize style_value_for_property() property list 2023-05-27 20:55:00 +02:00
Sam Atkins
ee1fc56f02 LibWeb: Resolve background-size property 2023-05-27 20:55:00 +02:00
Sam Atkins
d5fbec8a49 LibWeb: Resolve background-position[-x,-y] properties 2023-05-27 20:55:00 +02:00
Sam Atkins
3ed2c6da72 LibWeb: Resolve appearance property 2023-05-27 20:55:00 +02:00
Sam Atkins
db09f0e0c1 LibWeb: Resolve align-{content,items,self} properties 2023-05-27 20:55:00 +02:00
Sam Atkins
6a51ef9c9b LibWeb: Resolve accent-color property 2023-05-27 20:55:00 +02:00
Sam Atkins
0374b42f20 LibWeb: Remove CSS:: prefix from ResolvedCSSStyleDeclaration.cpp code
These prefixes weren't adding anything except some visual clutter, in
code that already has A::Lot::Of::This.
2023-05-27 20:55:00 +02:00
Andrew Kaster
5fd2fc70e5 LibWebView: Don't re-create WebContent proceses when repeatedly crashing
Serenity handles this in the SystemServer already, but the simplest
place to put this logic is the ViewImplementation base class.

This is trivial to see when running Ladybird without SERENTIY_SOURCE_DIR
set, or set improperly.
2023-05-27 20:09:50 +02:00
Ben Wiederhake
bdeccf8844 Chess+ChessEngine: Fix stockfish by setting correct blocking flag
Stockfish apparently cannot handle non-blocking I/O, and it does not
make sense to assume that all chess engines can do so.

Fixes #18946.
2023-05-27 18:44:21 +02:00
Ben Wiederhake
62ebb78433 AK: Enable Core::File to switch blocking-mode during use
This closely mirrors Socket::set_blocking. Note that it does not make
sense to make this a virtual method on a base class, since
SeekableStream and FixedMemoryStream cannot possible be anything except
than blocking.
2023-05-27 18:44:21 +02:00
MacDue
6f8c2dc322 LibWeb: Make SVG transform parser less crashy
Previously, this would blindly use parse_number() without checking if
there was a number to parse. This meant we would crash on transforms
like:
	rotate(BAD 32 0)

Now the attribute just gracefully fails to parse.
2023-05-27 18:40:41 +02:00
Andreas Kling
33500bb6db LibWeb: Protect against null deref during Web::Page initialization
BrowsingContext::set_active_document() may end up asking for the Page's
top level browsing context before Page has one. Do a workaround for now
where we have an API to ask if it's initialized.

Long-term we should find a cleaner solution.
2023-05-27 18:38:40 +02:00
Ben Wiederhake
f07ac8f20a HackStudio: Prefer FileSystem over DeprecatedFile
This also straightens out the logic to determine the project_path.
Instead of calling realpath on potentially-null strings and sometimes
not even reading the result, we now only make these calls when required,
and properly handle any error.
2023-05-27 17:30:55 +02:00
Ben Wiederhake
0fab68ee16 LibCoredump: Avoid unnecessary conversion to DeprecatedString 2023-05-27 17:30:55 +02:00