Commit Graph

29624 Commits

Author SHA1 Message Date
Igor Anić
e0350859bb use unreachable keyword for unreachable code path 2024-07-03 12:12:53 -07:00
Igor Anić
035c1b6522 std.tar: add strip components error to diagnostics
This was the only kind of error which was raised in pipeToFileSystem and
not added to Diagnostics.
Shell tar silently ignores paths which are stripped out when used with
`--strip-components` switch. This enables that same behavior, errors
will be collected in diagnostics but caller is free to ignore that type
of diagnostics errors.
Enables use case where caller knows structure of the tar file and want
to extract only some deeply nested folders ignoring upper files/folders.

Fixes: #17620 by giving caller options:
- not provide diagnostic and get errors
- provide diagnostics and analyze errors
- provide diagnostics and ignore errors
2024-07-03 12:12:50 -07:00
Michael Bradshaw
fe66a12a23 Rename nonSIMDCall* to nonSimdCall* 2024-07-03 19:00:17 +01:00
Michael Bradshaw
21cad3e09f Rename MAX_NAME_BYTES to max_name_bytes 2024-07-03 17:42:09 +01:00
Nikita
e1d4cf67ca Add two new io_uring flags to linux.zig 2024-07-03 05:28:55 -04:00
cryptocode
cb182432b0 [std.c] Add eventfd and dup3 functions to FreeBSD
The eventfd system call and dup3 library call have been available
since FreeBSD 13 and 10 respectively, and are thus available in
all [FreeBSD releases not deemed EOL](<https://endoflife.date/freebsd>)

The lack of these were discovered when porting a terminal emulator
to FreeBSD. It would be nice to have them included in Zig's stdlib.
2024-07-03 05:27:21 -04:00
Pat Tullmann
a31fe8aa3e glibc headers: arc4random* functions added in glibc 2.36
Here's the glibc v2.36 announcment noting the addition of arc4random,
arc4random_buf and arc4random_uniform:

  https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=8420a65cd06874ee09518366b8fba746a557212a;hb=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2

Tested with the testcase from the bug.  I get a compile-time error when
building against older glibc (instead of a linker error), and no errors
(as before) when compiling against v2.36 or later.  And the glibc_compat
regression tests pass.

Fix #20426
2024-07-03 02:57:24 -04:00
wooster0
5e3bad3556 Make 0e.0 and 0xp0 not crash
This fixes those sequences of characters crashing.
2024-07-03 02:53:37 -04:00
Luuk de Gram
1905137d0b
Merge pull request #20438 from pavelverigo/stage2-wasm-default-signextend
stage2-wasm: store signed integers with extended sign bit + minor changes
2024-07-02 17:58:01 +02:00
Michael Bradshaw
02b3d5b58a Rename isASCII to isAscii 2024-07-02 16:31:15 +02:00
Pavel Verigo
1a951b49af stage2-wasm: not op for <= 128 bits ints 2024-07-02 15:02:59 +02:00
Pavel Verigo
5a9495002f stage2-wasm: Zcu renaming 2024-07-02 15:02:59 +02:00
Pavel Verigo
4b9d327f12 stage2-wasm: sign extend strategy 2024-07-02 15:02:59 +02:00
David Rubin
e4447c54ea add ppc64 reloc definitions 2024-07-02 08:59:10 +02:00
Andrew Kelley
da7c48324b CI: update macOS runner to 12
Apple has already dropped support for macOS 11.
GitHub Actions is dropping macOS 11 support now.
The Zig project is also dropping macOS 11 support now.
2024-07-02 02:04:10 -04:00
Andrew Kelley
fed8d9054c
Merge pull request #19267 from PanSashko/compile-dup-mod
Fix adding module arguments for Step.Compile
2024-07-02 01:10:34 -04:00
Sashko
8ef24461a0 DynLib: fix a typo in DynLib.openZ 2024-07-01 19:44:20 -04:00
Andrew Kelley
8db1490b8a update test build script to latest API 2024-07-01 16:38:02 -07:00
Sashko
a717ac0340 Add a standalone test to cover the duplicate module bug 2024-07-01 16:36:39 -07:00
Sashko
604a332e21 Extract getZigArgs function in std.Build.Step.Compile 2024-07-01 16:36:13 -07:00
Wayne Wu
cb308ba3ac
langref: correct test runner path 2024-06-27 19:37:44 +00:00
Jakub Konka
1e3fb48256
Merge pull request #20428 from ziglang/macho-tsan
macho: support TSAN
2024-06-27 06:35:53 +02:00
Matthew Lugg
a016ca6170
Merge pull request #20424 from mlugg/the-great-decl-split
Dismantle Decl a little bit more
2024-06-27 00:14:03 +01:00
Jakub Konka
766e281a72 macho: set allow_shlib_undefined to true when TSAN was requested 2024-06-26 22:01:00 +02:00
Jakub Konka
e9309036b2 macho: print libtsan ref when dumping argv 2024-06-26 08:43:46 +02:00
Jakub Konka
6e78642d51 macho: link in TSAN if requested 2024-06-26 07:38:36 +02:00
mlugg
4cb5318088
InternPool: rename Depender to AnalSubject
This is essentially just a rename. I also changed the representation of
`AnalSubject` to use a `packed struct` rather than a non-exhaustive
enum, but that change is relatively trivial.
2024-06-26 05:28:04 +01:00
mlugg
5b523d0469
Zir: make src_line absolute for declaration instructions
We need special logic for updating line numbers anyway, so it's fine to
just use absolute numbers here. This eliminates a field from `Decl`.
2024-06-26 05:28:03 +01:00
Pavel Verigo
3e9ab6aa7b stage2-wasm: abs 128 bit 2024-06-24 20:50:39 +02:00
Bogdan Romanyuk
ab4c461b76
std.mem.zeroes: explicit compile error for @Type(.EnumLiteral) 2024-06-24 00:43:09 +00:00
Alex Rønne Petersen
1ede3af9f6 std.zig.target: Remove armeb-windows-gnu and aarch64_be-windows-gnu.
This doesn't actually exist; Windows on Arm only runs on little endian. MinGW
also doesn't work for these targets at all.
2024-06-23 19:53:52 -04:00
David Rubin
e73ae94b36 riscv: remove deprecated Module usages 2024-06-23 15:26:14 +01:00
Frank Denis
f3655fd07d
std.crypto.chacha: fix typo in XChaChaIETF.stream() (#20399)
Thanks to @r4gus for reporting this.

Fixes #20398
2024-06-23 13:20:18 +00:00
Bram
5f58956264 std: Extended type checks for Thread startFn return type 2024-06-23 04:35:00 +01:00
Sean
f1b6f1aeb3
std.meta.hasUniqueRepresentation: Handle optional pointers correctly (#20366)
std.meta.hasUniqueRepresentation should now return true for non-slice optional pointers. Additional checks were added to the test to reflect this.
2024-06-23 03:33:45 +00:00
Michael Bradshaw
642093e04b Rename *[UI]LEB128 functions to *[UI]leb128 2024-06-23 04:30:12 +01:00
Andrew Kelley
0fcd59eada rename src/Module.zig to src/Zcu.zig
This patch is a pure rename plus only changing the file path in
`@import` sites, so it is expected to not create version control
conflicts, even when rebasing.
2024-06-22 22:59:56 -04:00
Pavel Verigo
6026bbd0ad stage2-wasm: fix div and rem 2024-06-22 21:35:36 +02:00
Alex Rønne Petersen
9be9b8ca90 std.Build.findProgram(): Try with and without the Windows executable extensions.
I renamed std.process.Child.CreateProcessSupportedExtension to WindowsExtension
and made it public to avoid duplicating the list of extensions.

While here, I also improved it to not misreport OOM from std.fs.realpathAlloc()
as a generic failure to find the program, but instead panic like the rest of the
build system does for OOM.

Closes #20314.
2024-06-21 15:41:03 -04:00
Felix "xq" Queißner
451550e86a Closes #20355: Enables dynamic linking for .os_tag == .other again 2024-06-21 00:12:44 -04:00
kcbanner
0d12caee29 - Fix ypedef -> typedef 2024-06-21 00:12:13 -04:00
Ryan G
b6fd34aa46
std.static_string_map: Cast length of input for runtime initialization 2024-06-20 23:22:39 +00:00
Igor Anić
b8890f8ee1 io_uring: don't assume completions order (2)
In my first [try](https://github.com/ziglang/zig/pull/20224) to fix
20212 I didn't reproduce bug on required kernel (6.9.2) and wrongly
concluded that first two completions have different order on newer
kernel.
On my current kernel (6.5.0) order of completions is: send1, recv,
send2. On 6.9.2 order is send1, send2, recv. This fix allows second two
completions to arrive in any order.
Tested on both kernels.

Fixes: #20212
2024-06-20 18:03:28 -04:00
Alex Kladov
e03026507f
std: fuzz test sort stability (#20284)
Stability of std sort was undertested before this change. Add a fuzz
test for more confidence.

Specifically, we used to have a single example test that used an array
of eight elements. That ends up exercising only a tiny fraction of
sorting logic, as it hits a hard-coded sorting network due to small
size.
2024-06-20 12:38:54 -07:00
Alex Kladov
5afd774db3 std: mark Build.args as const
I don't think these are intended to be mutated!
2024-06-20 15:17:31 -04:00
snoire
f7d72ce881 build runner: add missing 'new' option to --summary error hint 2024-06-20 14:54:12 +03:00
Matthew Lugg
f73be120f4
Merge pull request #20299 from mlugg/the-great-decl-split
The Great Decl Split (preliminary work): refactor source locations and eliminate `Sema.Block.src_decl`.
2024-06-20 11:07:17 +01:00
mlugg
2b677d1660
Sema: fix performance regression
LLVM fails to notice that in release builds, `logFn` ignores its
arguments, so their computation can be elided. So, LLVM fails to elide
this hashmap lookup. Its cost isn't too significant, but doing it in the
hottest loop in Sema adds up!

Technically, we could do the lookup a single time, before the loop, but
it was cleanest (and a little faster) to just disable this log call at
comptime when debug logging is disabled.
2024-06-20 08:41:07 +01:00
Alex Ambrose
ccd3cc3266 Parse WASM linker flags as base 10, like clang
Resolves #19536
2024-06-20 07:34:24 +02:00
David Rubin
e5a3a10a5a add error message for -fno-llvm -flld
We plan to remove all dependency on LLD either way, so this will not be a supported usecase.
2024-06-19 20:13:21 +02:00