Commit Graph

31175 Commits

Author SHA1 Message Date
mlugg
877d56c43b
Revert "debug time :cool_sunglasses:"
This reverts commit e4ec8ef32f.
2024-10-01 06:02:54 +01:00
mlugg
67e49f190c
std: async read into 1-byte temporary buffer between poll calls on Windows
This commit changes how `std.io.poll` is implemented on Windows. The new
implementation unfortunately incurs a little extra system call overhead,
but fixes a major bug in the old implementation.

I'm not yet set on this implementation, but I'm pushing it to check if
it resolves my CI failures.

The old implementation was buggy in that by leaving `ReadFile` calls
into the `LinearFifo` write end pending between `poll` calls, there was
potential for a race condition where the kernel satisfies the
asynchronous read after the caller has modified the corresponding
`LinearFifo` in some way; most likely by rotating its buffer for a
`readableSliceOfLen` call. The only way to allow the full `LinearFifo`
API to be used is to not leave these `ReadFile` calls pending after
`poll` returns. So, now, `pollWindows` will leave running a different
set of `ReadFile` calls, which are trying to read a single byte into a
temporary buffer. These are the operations we wait on with
`WaitForMultipleObjects`. When these reads are completed, we push that
single byte to the FIFO, and perform some reads directly into the FIFO
memory until we stop getting immediate results; then, we again queue a
single-byte read into a stable buffer for the next call to `poll`.

My main concern with this implementation is that if the kernel
frequently returns `IO_PENDING` for `ReadFile` calls even when the data
is available, then we could effectively skip the bulk-reading path,
hence reading data one byte at a time. Performance measurements are
necessary here.
2024-10-01 06:02:48 +01:00
mlugg
e4ec8ef32f
debug time :cool_sunglasses: 2024-09-29 00:06:56 +01:00
mlugg
f8d2bbbc48
incr-check: minor fixes
* fix inconsistency in global cache directory name
* don't error if spawning external executor fails
* handle CRLF correctly
2024-09-29 00:05:58 +01:00
mlugg
5bfdb4b128
test: add x86_64-windows-cbe target to incremental cases
Throw another target in there just to spice things up a little!

Running the incremental cases with the C backend is pretty slow due to
the need to recompile the whole output from scratch on every update; for
this reason, we probably don't want to keep many of these targeting CBE
long-term. However, for now, while we have relatively few tests and
things are still changing quite a lot, it's better to have this little
bit of extra test coverage.
2024-09-29 00:05:58 +01:00
mlugg
c9a96cbe3a
incr-check: clean up temporary directory by default
The new `--preserve-tmp` flag can be used to preserve the temporary
directory for debugging purposes.
2024-09-29 00:05:58 +01:00
mlugg
d92810f84f
incr-check: better progress output, support external executors
If no external executor is available for a successful binary, its
execution is silently skipped. This allows the CI to test, to the
fullest extent possible, incremental cross-compilation to targets whose
binaries can't be executed on the host.
2024-09-29 00:05:58 +01:00
mlugg
10bed595ef
tests: add test-incremental step
This is contained in the `test` step, so is tested by CI.

This commit also includes some enhancements to the `incr-check` tool to
make this work correctly.
2024-09-29 00:05:57 +01:00
Andrew Kelley
0cdec976e4
Merge pull request #21520 from ziglang/no-formatted-panics
formalize the panic interface

closes #17969
closes #20240
2024-09-28 15:58:41 -07:00
Andrew Kelley
2857ca1edc revert safety test cases to rely on deprecated old API
in case someone wants to pursue the idea of making the panic interface a
struct, this will reduce churn.
2024-09-28 12:16:41 -07:00
Jakub Konka
777e722b06 macho: increase pre-allocated vmsize for __TEXT_ZIG segment 2024-09-28 11:59:51 -07:00
Andrew Kelley
737b581681 disable plan9 test
This experimental target has no recent active maintainer. It's the only
linker backend complaining about this branch and I can't make sense of
the stack trace.

This can be fixed asynchronously by anyone who wants to maintain plan9
support. It does not need to block this branch.
2024-09-26 21:02:14 -07:00
Andrew Kelley
2e14cbe9cd Sema: better utility function semantics
better names, return error instead of panicking, better diagnostics, use
the standard APIs for resolving values
2024-09-26 20:53:26 -07:00
Andrew Kelley
5b1a9fbb45 update crash report to the new panic interface 2024-09-26 20:25:09 -07:00
Andrew Kelley
37d1da5bed I think it's better to put the imports at the top 2024-09-26 20:24:46 -07:00
Andrew Kelley
7f4c0e010d update safety test cases to new panic API
although they would also pass simply reverted to master branch because
I made the deprecated API still work for now (to be removed after 0.14.0
is tagged)
2024-09-26 17:14:17 -07:00
Andrew Kelley
db8c074476 fix still calling std.builtin.panic sometimes 2024-09-26 16:46:02 -07:00
Andrew Kelley
1b491e640d fixes and make sema report errors when std.builtin wrong
instead of panicking
2024-09-26 16:06:05 -07:00
Andrew Kelley
c9c080a187 embrace panic helpers
Introduces `std.builtin.Panic` which is a complete interface for
panicking. Provide `std.debug.FormattedPanic` and
`std.debug.SimplePanic` and let the user choose, or make their own.
2024-09-26 16:06:05 -07:00
Andrew Kelley
fcfbedc2f0 work around riscv64 backend deficiencies 2024-09-26 16:06:05 -07:00
Andrew Kelley
231783f207 update test cases to new panic API 2024-09-26 12:35:14 -07:00
Andrew Kelley
e8887829ca compile error instead of crash when root panic fn wrong 2024-09-26 12:35:14 -07:00
Andrew Kelley
61b20105e4 fix crash report not using mutexes correctly 2024-09-26 12:35:14 -07:00
Andrew Kelley
70746d580c better codegen for @panic with comptime-known operand 2024-09-26 12:35:14 -07:00
Andrew Kelley
b66cc5af41 reimplement integer overflow safety panic function calls
in the llvm backend.
2024-09-26 12:35:14 -07:00
Andrew Kelley
f2c8940aa6 reintroduce the std.builtin safety panic helpers
motivated by performance
2024-09-26 12:35:14 -07:00
Andrew Kelley
76f0b6e7d8 delete the old panic stuff again
now that we have a zig1.wasm update it's not needed
2024-09-26 12:35:14 -07:00
Andrew Kelley
9ccf8d3332 fixes for this branch
I had to bring back some of the old API so that I could compile the new
compiler with an old compiler.
2024-09-26 12:35:14 -07:00
Andrew Kelley
4f8d244e7e remove formatted panics
implements #17969
2024-09-26 12:35:14 -07:00
Andrew Kelley
04e694ad11 move std.time.sleep to std.Thread.sleep 2024-09-26 12:35:14 -07:00
dave caruso
085cc54aad replace TranslateC.addIncludeDir with variants with LazyPath/library names 2024-09-25 21:50:55 -07:00
Andrew Kelley
0e876a6378
Merge pull request #21514 from ziglang/elf-incr
elf: get incremental tests passing via `incr-check` tool
2024-09-25 19:41:13 -07:00
Andrew Kelley
4442288656 std: fix inappropriate use of unreachable in fanotify_init 2024-09-25 16:07:04 -07:00
mlugg
054dbb6798
incr-check: specify backend in manifest, allow multiple targets/backends 2024-09-25 20:39:31 +01:00
Jakub Konka
1714b74edf incr-check: actually handle end message for a compiler update 2024-09-25 17:54:50 +02:00
Jakub Konka
1c2048ebcc incr-check: add --debug-link flag for verbose linker logging 2024-09-25 17:54:50 +02:00
Jakub Konka
50074a835a elf: remove unused code 2024-09-25 17:54:50 +02:00
Jakub Konka
10c68d05db elf: change how we create new program headers
We do not want to create additional ones per update that are duplicates
of existing ones.
2024-09-25 17:54:50 +02:00
Jakub Konka
992c6c3f68 elf: reset output symtab contexts before re-updating 2024-09-25 17:54:50 +02:00
Jakub Konka
82cf762b02 elf: reset (merge) sections sizes before updating 2024-09-25 17:54:50 +02:00
Jakub Konka
db3db1150e elf: do not re-create special program headers if already created 2024-09-25 17:54:50 +02:00
Jakub Konka
62c282ba46 elf: do not re-create synthetic sections if already created 2024-09-25 17:54:50 +02:00
Maciej 'vesim' Kuliński
4ceefca14b mips: use byval for all integer types 2024-09-25 07:37:03 -07:00
Andrew Kelley
efc98fcbeb disallow non-scalar sentinel types
see #17969
2024-09-25 03:02:05 -07:00
Alex Rønne Petersen
a40cdad18c tsan: Update to LLVM 19.1.0. 2024-09-24 23:58:21 -07:00
matt
7f6b7c5608 fix THREAD_STATE_NONE on darwin
#21094
2024-09-24 22:41:00 -07:00
Krzysztof Wolicki
4d09fb491f
fetch: fix mutating unrelated fields when saving (#19816)
closes #19725
2024-09-24 13:38:13 -07:00
Meghan Denny
5e4da1ff30
std: add arch bits for s390x-linux (#21342)
see #21402
2024-09-24 13:35:12 -07:00
Nameless
8d76c02f9a uefi: erroneous alignment check in pool_allocator
Fixes #21446

Both UefiPoolAllocator and UefiRawPoolAllocator were
passing the value of `log2_ptr_align` directly to
`mem.alignAllocLen` which expects a alignment value.

Both of these calls to `mem.alignAllocLen` are pointless
and the result of the alignment both always true, and
was thrown away anyway.

I have removed these calls entirely.
2024-09-24 13:30:53 -07:00
WillLillis
37cd21eb5f fix: disallow discard as errdefer capture 2024-09-24 13:21:06 -07:00