471 Commits

Author SHA1 Message Date
Ryan Liptak
b31a03f134 Let CRT take care of the entry point for wWinMain if libc is linked
Fixes #7852

Before, the modified test would fail with:

```
error: lld-link: undefined symbol: wWinMain
    note: referenced by C:\Users\Ryan\Programming\Zig\zig-x86_64-windows-0.15.1\lib\libc\mingw\crt\crtexewin.c:66
    note:               libmingw32.lib(ucrtexewin.obj):(wmain)
```
2025-11-08 17:11:12 -08:00
Carl Åstholm
54f2a7c833 Move std.Target.SubSystem to std.zig.Subsystem
Also updates the field names to conform with the rest of std.
2025-11-05 01:31:26 +01:00
Andrew Kelley
030ddc7952 update standalone tests for ws2_32 dependency 2025-10-29 06:20:51 -07:00
Andrew Kelley
8b269f7e18 std: make signal numbers into an enum
fixes start logic for checking whether IO/POLL exist
2025-10-29 06:20:51 -07:00
Andrew Kelley
46f7e3ea9f std.Io.Threaded: add ioBasic which disables networking 2025-10-29 06:20:51 -07:00
Andrew Kelley
873bcb5aa6 fix some std.Io compilation failures 2025-10-29 06:20:51 -07:00
Andrew Kelley
67df66c26c update some tests and tools for new Io APIs 2025-10-29 06:20:50 -07:00
Alex Rønne Petersen
dba1bf9353 remove all Oracle Solaris support
There is no straightforward way for the Zig team to access the Solaris system
headers; to do this, one has to create an Oracle account, accept their EULA to
download the installer ISO, and finally install it on a machine or VM. We do not
have to jump through hoops like this for any other OS that we support, and no
one on the team has expressed willingness to do it.

As a result, we cannot audit any Solaris contributions to std.c or other
similarly sensitive parts of the standard library. The best we would be able to
do is assume that Solaris and illumos are 100% compatible with no way to verify
that assumption. But at that point, the solaris and illumos OS tags would be
functionally identical anyway.

For Solaris especially, any contributions that involve APIs introduced after the
OS was made closed-source would also be inherently more risky than equivalent
contributions for other proprietary OSs due to the case of Google LLC v. Oracle
America, Inc., wherein Oracle clearly demonstrated its willingness to pursue
legal action against entities that merely copy API declarations.

Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in
maintenance mode since, presumably to be retired completely sometime in the 2030s.

For these reasons, this commit removes all Oracle Solaris support.

Anyone who still wishes to use Zig on Solaris can try their luck by simply using
illumos instead of solaris in target triples - chances are it'll work. But there
will be no effort from the Zig team to support this use case; we recommend that
people move to illumos instead.
2025-10-27 07:35:38 -07:00
Alex Rønne Petersen
6b4f57a257
test: enable tsan standalone test for x86_64-freebsd and aarch64-freebsd 2025-10-26 11:12:46 +01:00
Jacob Young
cc3c4d1069 windows: workaround kernel race condition in more places 2025-10-14 23:16:36 -04:00
Jacob Young
958faa7031 windows: workaround kernel race condition the most 2025-10-12 13:55:57 -04:00
Jacob Young
95242cc431 windows: workaround kernel race condition even more 2025-10-11 12:17:39 -04:00
Jacob Young
8efcfeaf1e windows: workaround kernel race condition better
Until I can do more testing, we bump the numbers until morale improves.
2025-10-11 10:01:17 -04:00
Jacob Young
b2bc6073c8 windows: workaround kernel race condition
This was causing flaky CI failures.
2025-10-10 22:47:36 -07:00
Alex Rønne Petersen
606c7bcc89
test: disable standalone tsan test
https://github.com/ziglang/zig/issues/25471
2025-10-05 02:13:21 +02:00
Alex Rønne Petersen
ea46bd2772
test: move standalone/options/ to cli/options/
It's now used only by test-cli, so make that clear.
2025-10-04 21:55:39 +02:00
Alex Rønne Petersen
5bbbc8d299
Revert "test: remove standalone options test"
This reverts commit d9cd4d087648c6d83e22dda6a4b82929a72fc771.

Turns out Jacob restored this test as part of test-cli in cdba1d5.
2025-10-04 21:46:55 +02:00
Alex Rønne Petersen
3539cad176
test: remove standalone sigpipe test
This should be restored, but there's no point keeping disabled code that's just
going to bitrot.

https://github.com/ziglang/zig/issues/25466
2025-10-04 20:53:19 +02:00
Alex Rønne Petersen
d9cd4d0876
test: remove standalone options test
This functionality is already load-bearing for the compiler's own build script
so this (disabled, possibly bitrotted?) doesn't really add value.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
f6c1864abf
test: remove standalone issue_13970 test
It's been disabled for ages and has bitrotted. Someone can readd it later if
they feel like it actually adds value.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
c68f9bc207
test: remove some tests that are now covered well enough by test-stack-traces
The amount of cross compilation required for these tests was too time-consuming
for how much value they added. test-stack-traces now cover these well enough,
especially as we add more exotic machines to the CI fleet to run native tests.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
d97954a8ea
test: remove stack_iterator standalone test
Our new stack trace tests cover all the important parts of this.
2025-10-01 01:06:13 +02:00
mlugg
1120546f72
std.debug.SelfInfo: remove shared logic
There were only a few dozen lines of common logic, and they frankly
introduced more complexity than they eliminated. Instead, let's accept
that the implementations of `SelfInfo` are all pretty different and want
to track different state. This probably fixes some synchronization and
memory bugs by simplifying a bunch of stuff. It also improves the DWARF
unwind cache, making it around twice as fast in a debug build with the
self-hosted x86_64 backend, because we no longer have to redundantly go
through the hashmap lookup logic to find the module. Unwinding on
Windows will also see a slight performance boost from this change,
because `RtlVirtualUnwind` does not need to know the module whatsoever,
so the old `SelfInfo` implementation was doing redundant work. Lastly,
this makes it even easier to implement `SelfInfo` on freestanding
targets; there is no longer a need to emulate a real module system,
since the user controls the whole implementation!

There are various other small refactors here in the `SelfInfo`
implementations as well as in the DWARF unwinding logic. This change
turned out to make a lot of stuff simpler!
2025-09-30 14:18:26 +01:00
mlugg
2ab650b481
std.debug: go back to storing return addresses instead of call addresses
...and just deal with signal handlers by adding 1 to create a fake
"return address". The system I tried out where the addresses returned by
`StackIterator` were pre-subtracted didn't play nicely with error
traces, which in hindsight, makes perfect sense. This definition also
removes some ugly off-by-one issues in matching `first_address`, so I do
think this is a better approach.
2025-09-30 13:44:55 +01:00
mlugg
0c24b8ec66
update to new std.debug changes 2025-09-30 13:44:55 +01:00
mlugg
f5c8d80e08
windows_bat_args: fix path handling
The input path could be cwd-relative, in which case it must be modified
before it is written into the batch script.

Also, remove usage of deprecated `GeneralPurposeAllocator` alias, rename
`allocator` to `gpa`, use unmanaged `ArrayList`.
2025-09-30 13:44:54 +01:00
mlugg
4cb84f8e48
test-standalone: update for std.debug changes 2025-09-30 13:44:54 +01:00
Andrew Kelley
e0dc2e4e3f
Merge pull request #25342 from ziglang/fuzz-limit
fuzzing: implement limited fuzzing
2025-09-26 05:28:46 -07:00
Alex Rønne Petersen
212715f62d
test: remove pie test case from test-standalone
We already have test/cases/pie_linux.zig covering this.
2025-09-26 01:33:38 +02:00
Alex Rønne Petersen
17f9a25924
test: remove -Dskip-translate-c from test-standalone
No longer necessary since we've stopped using Clang for this.
2025-09-26 01:33:26 +02:00
Loris Cro
9bb0b43ea3 implement review suggestions 2025-09-25 18:20:19 +02:00
alexrp
b3432c2796
test: disable some stack trace tests on FreeBSD 2025-09-22 01:37:32 +02:00
Jacob Young
f81a721e41 standalone: fix misaligned stack crash 2025-09-20 18:33:01 -07:00
Andrew Kelley
164c598cd8
Merge pull request #23416 from gooncreeper/improved-fuzzer
greatly improve capabilities of the fuzzer
2025-09-19 09:27:25 -07:00
Kendall Condon
e66b269333 greatly improve capabilities of the fuzzer
This PR significantly improves the capabilities of the fuzzer.

The changes made to the fuzzer to accomplish this feat mostly include
tracking memory reads from .rodata to determine fresh inputs, new
mutations (especially the ones that insert const values from .rodata
reads and __sanitizer_conv_const_cmp), and minimizing found inputs.
Additionally, the runs per second has greatly been increased due to
generating smaller inputs and avoiding clearing the 8-bit pc counters.

An additional feature added is that the length of the input file is now
stored and the old input file is rerun upon start.

Other changes made to the fuzzer include more logical initialization,
using one shared file `in` for inputs, creating corpus files with
proper sizes, and using hexadecimal-numbered corpus files for
simplicity.

Furthermore, I added several new fuzz tests to gauge the fuzzer's
efficiency. I also tried to add a test for zstandard decompression,
which it crashed within 60,000 runs (less than a second.)

Bug fixes include:
* Fixed a race conditions when multiple fuzzer processes needed to use
the same coverage file.
* Web interface stats now update even when unique runs is not changing.
* Fixed tokenizer.testPropertiesUpheld to allow stray carriage returns
since they are valid whitespace.
2025-09-18 18:56:10 -04:00
Alex Rønne Petersen
9095a7fefd
test: respect -Dskip-translate-c in test-standalone 2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
4e9b8aec2c
test: remove unnecessary @cImport usage in some standalone tests 2025-09-18 12:42:24 +02:00
Andrew Kelley
220c679523
Merge pull request #25197 from rootbeer/24380-flaky-sigset-test
Re-enable std.posix "sigset_t bits" test
2025-09-17 21:19:01 -07:00
Alex Rønne Petersen
a5bb7108a9
test: move glibc_compat from link to standalone tests
This is not really testing the linker.
2025-09-16 23:39:29 +02:00
Alex Rønne Petersen
d5c73a44b7
test: rename issue_8550 standalone test to compile_asm 2025-09-16 14:51:29 +02:00
Sardorbek Imomaliev
6b8cef8107
Fix standalone test simple/cat/main.zig after Writergate update (#25188)
* Make cat in test/standalone/simple working again

- Fixes:
    zig/0.15.1/lib/zig/std/Io/Writer.zig:939:11: 0x1049aef63 in sendFileAll (nclip)
        assert(w.buffer.len > 0);
- because we are no using non zero buffers for stdout - "do not forget to flush"

* replace std.fs with fs because we are already importing it
2025-09-11 16:43:11 +00:00
Pat Tullmann
bd4617033e standalone posix tests for sigaction
Fixes #24380
2025-09-09 22:07:44 -07:00
Pat Tullmann
ca09629bee standalone posix tests for relative path linking 2025-09-09 22:07:44 -07:00
Pat Tullmann
aa1d2adffc standalone posix test for env vars 2025-09-09 22:07:44 -07:00
Pat Tullmann
020eb622ee standalone posix test for current working directory 2025-09-09 22:07:44 -07:00
Pat Tullmann
c614d8d008 standalone posix tests: add skeleton
Add build.zig, README and empty test files.
2025-09-09 22:07:44 -07:00
Andrew Kelley
31a0c2a36a child process test: preemptively use streaming mode
works around #24984
2025-08-30 00:48:50 -07:00
Andrew Kelley
9adcc31ca3 update tools and other miscellaneous things to new APIs 2025-08-30 00:48:50 -07:00
Andrew Kelley
79f267f6b9 std.Io: delete GenericReader
and delete deprecated alias std.io
2025-08-29 17:14:26 -07:00
Andrew Kelley
f7884961c2 update more to avoid GenericWriter 2025-08-28 18:30:57 -07:00