25160 Commits

Author SHA1 Message Date
Andrew Kelley
48e0b89f2c remove tools/extract-grammar.zig
This is not a sound way to check Zig's grammar against the spec.

This is a partial revert of f8f1c6ac06636d816e5dff205d6713a337df387d.
2023-07-25 18:17:18 -07:00
Xavier Bouchoux
5ab1854602 codegen/llvm: fix memset with vectors smaller than one byte
The special case to take advantage of llvm's intrinsic
was generating invalid llvm ir:

```
Invalid bitcast
  %60 = bitcast <2 x i2> %59 to i8, !dbg !3122
thread 145453 panic: LLVM module verification failed
```
2023-07-25 18:14:10 -07:00
Andrew Kelley
71dfce31bb
Merge pull request #16548 from mlugg/feat/package-dl-progress
Display package download progress
2023-07-25 18:12:00 -07:00
Jacob G-W
3c08fe931a make @typeInfo not return private decls
fixes #10731
Thanks @nektro for previous work in #14878

This change creates a small breaking change:
It removes the `is_pub` field of a decl in `@typeInfo`
2023-07-25 16:19:08 -07:00
Lauri Tirkkonen
972e70b794 darwin: drop underscore from SIG._{BLOCK,UNBLOCK,SETMASK}
this makes them match decls in other OSes
2023-07-25 13:49:08 -07:00
mlugg
7a57f82976
Package: add progress indicator for package fetching 2023-07-25 19:17:53 +01:00
Wooster
b5a471db3c ErrorBundle: remove extra newline
This is another minor change but still makes a visual difference and will reduce the amount you have to scroll in your terminal by a little bit.

Reasoning:
1. The `for (0..src.data.reference_trace_len)` loop will run at least once due to the `src.data.reference_trace_len > 0` check above.
2. In all 3 branches of the `if` in that `for` it will print something.
3. The 3 strings of all of those prints already end in `\n`.
Therefore, the extra `try stderr.writeByte('\n');` is unnecessary.
2023-07-25 11:05:14 -07:00
Zachary Raineri
dc98b001f3 std.os.linux | Fix sendmmsg function | Issue #16513
Closes #16513
2023-07-25 11:04:10 -07:00
Jan Philipp Hafer
32e78e239f re-enable test "fmt.parseFloat nan and inf" after llvm fix
Closes #12027.
2023-07-25 11:03:11 -07:00
alex
abd960873c test/standalone: reinstate std.ChildProcess tests
67d5bfef removed std.ChildProcess tests, suggesting to make them
standalone instead. This commit does exactly that after the
bug creating SIGPIPE in ReleaseFast is no more with LLVM 15.0.5.

Thanks to @x1ddos for the idea with the compile artifacts and PR
improvements.
2023-07-25 10:57:45 -07:00
xdBronch
737b366279 add error when passing a non-single-item pointer to allocator.destroy 2023-07-25 10:55:04 -07:00
Loris Cro
feff968ec3 autodoc: html page fixes 2023-07-25 19:29:23 +02:00
Loris Cro
4f5082fc86 autodoc: improve handling of periods in search box and add search explainer 2023-07-25 19:19:39 +02:00
mlugg
06e50e9aa7
std.Progress: add optional unit to progress indicator 2023-07-25 13:51:22 +01:00
mllken
dc24835168 io_uring: let the OS choose a free local port for all tests
closes #14907
2023-07-24 20:12:41 -07:00
Ian Johnson
9892ec31a0 zig fmt: make --exclude work on files
Closes #16178
2023-07-24 19:41:59 -07:00
Zachary Raineri
10d940d7f4 src.link | Remove unused import
Removed Package import as it's not used in file
2023-07-24 18:48:01 -07:00
lockbox
9b56c7de79 Fix type mismatch for Reader.readIntoBoundedBytes (#16416)
- add unit test to verify .readIntoBoundedBytes behavior
- add unit test to verify .readBoundedBytes behavior
2023-07-24 17:32:06 -07:00
Validark
8b1976cab5 [priority_queue] Simplify sifting & fix edge case 2023-07-24 12:58:19 -07:00
Evin Yulo
f1bd598768 langref: document out of bounds float to integer cast 2023-07-24 12:57:11 -07:00
Wooster
aea29afc44 langref: update docs for ** and ++
This behavior changed with https://github.com/ziglang/zig/issues/7147
2023-07-24 10:57:11 -07:00
Andrew Kelley
f8666d748d
Merge pull request #16516 from lacc97/std-crypto-certificate-parse-datetime
std.crypto.Certificate: fix timedate parsing
2023-07-24 10:56:38 -07:00
Andrew Kelley
ddd27db362 add comment to discourage using GitHub issue numbers
in behavior tests.

closes #16506
2023-07-24 10:54:08 -07:00
Dominic
559150e844
Xxhash perf (#15947)
Improvements for xxHash performance, both on small keys as well as large slices.

* std.hash: make benchmarks consistent for xxhash

There is some odd behaviour in the timings for the XXHash benchmarks
introduced in 879f0b9, specifically the changes to the allocation in
benchmarkHash. The problem is somewhere in the difference between
9628243 and 9362d61 (these are commit that were force-pushed over but
        can be found in PR #15917).

* std.hash: correctly calculate throughput in benchmark
* std.hash: add hashes per sec to small key output
* std.hash: add exact and small xxhash routines
* std.hash: add --small-only flag to benchmark
* std.hash.xxhash: extract stateless Accumulator type
* std.hash.xxhash: cleanup hash() and improve small key perf
* std.hash.xxhash: port xxhash64 changes to xxhash32
* std.hash: change benchmark --small-only flag to --include-array
2023-07-24 13:47:45 -04:00
Zachary Raineri
d82b359010 Use builtin inference over @as where possible 2023-07-24 10:23:51 -07:00
Andrew Kelley
77b96231a6
Merge pull request #15657 from BratishkaErik/windows-sdk-finder-port-to-zig
src/windows_sdk.cpp: port to Zig
2023-07-24 09:34:56 -07:00
Andrew Kelley
e8fa199602 std.Build.Step.Compile: getEmittedDocs API enhancements
* Allow calling it multiple times.
 * Rename it. Sorry, this is to coincide with #16353.
2023-07-24 02:37:25 -07:00
Andrew Kelley
575a7cccc0 CLI: delete dead option -femit-analysis
This used to do something with the old autodocs system. Now it does
nothing.
2023-07-24 02:37:25 -07:00
Andrew Kelley
d21d1d4ba2
Merge pull request #16487 from jacobly0/llvm-builder
llvm: incremental Builder improvements
2023-07-24 02:16:00 -07:00
Andrew Kelley
98c7aec4e4
Merge pull request #16518 from ziglang/fix-func-body
InternPool: fix handling of coerced function bodies
2023-07-23 22:57:11 -07:00
Jacob Young
3fc2e36de2 llvm: convert global assembly 2023-07-23 23:48:19 -04:00
Jacob Young
533111e849 llvm: convert inline assembly
Also, implement TODOs from a previous commit.
2023-07-23 23:48:19 -04:00
Jacob Young
c610cde1eb test: test for issues starting codegen on many targets
Specifically this is to make sure llvm data layout generation doesn't
regress.  The no emit bin is to allow testing targets that can't
currently be linked.  The commented out targets are ones that fail in
the linker anyway when no emit bin is passed.
2023-07-23 23:48:19 -04:00
Jacob Young
06af9cc101 llvm: fix datalayout generation for more targets
Closes #16482
2023-07-23 23:48:18 -04:00
Jacob Young
aa44f8f0fd llvm: convert attributes and non-intrinsic calls 2023-07-23 23:48:18 -04:00
Andrew Kelley
23a806102a Revert "zig fmt: additionally auto-fix @byteSwap (#16462)"
This reverts commit f31e114f633f5d57f6d09a616f5997d83949f641.

This commit was incorrect; `@byteSwap` was not modified during the
0.11.0 release cycle.
2023-07-23 20:30:34 -07:00
Andrew Kelley
8199428beb Compilation: fix autodocs CLI
6e4fff6ba62ae3e61a948c98fa8fea7e35732cc0 regressed the direct CLI
interface of -femit-docs.

This commit fixes it and also hooks up to the progress bar.
2023-07-23 19:16:33 -07:00
Ryan Liptak
c57749f5ce Handle INVALID_DEVICE_REQUEST in std.os.windows.DeviceIoControl
This is possible when e.g. calling CreateSymbolicLink on a FAT32 filesystem
2023-07-23 19:10:05 -07:00
Ryan Liptak
442933936a os.renameatW: Handle OBJECT_NAME_COLLISION from NtSetInformationFile
Partially addresses #16374
2023-07-23 19:09:36 -07:00
Ryan Liptak
3f7166eb8b child_process: Fix regression on Windows for FAT filesystems
This fixes a regression caused by https://github.com/ziglang/zig/pull/13993

As an optimization, the first call to `NtQueryDirectoryFile` would only ask for a single result and assume that if the result returned did not match the app_name exactly, then the unappended app_name did not exist. However, this relied on the assumption that the unappended app_name would always be returned first, but that only seems to be the case on NTFS. On FAT filesystems, the order of returned files can be different, which meant that it could assume the unappended file doesn't exist when it actually does.

This commit fixes that by fully iterating the wildcard matches via `NtQueryDirectoryFile` and taking note of any unappended/PATHEXT-appended filenames it finds. In practice, this strategy does not introduce a speed regression compared to the previous (buggy) implementation.

Benchmark 1 (10 runs): winpathbench-master.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           508ms ± 4.08ms     502ms …  517ms          1 (10%)        0%
  peak_rss           3.62MB ± 2.76KB    3.62MB … 3.63MB          0 ( 0%)        0%
Benchmark 2 (10 runs): winpathbench-fat32-fix.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           500ms ± 21.4ms     480ms …  535ms          0 ( 0%)          -  1.5% ±  2.8%
  peak_rss           3.62MB ± 2.76KB    3.62MB … 3.63MB          0 ( 0%)          -  0.0% ±  0.1%

---

Partially addresses #16374 (it fixes `zig build` on FAT32 when no `zig-cache` is present)
2023-07-23 19:09:20 -07:00
Andrew Kelley
d92cca9324 InternPool: add func_coerced handling to getFuncInstanceIes
Oops, there was a missing call to `unwrapCoercedFunc`.
2023-07-23 18:39:58 -07:00
Andrew Kelley
cc6964c5dc InternPool: add func_coerced handling to funcIesResolved 2023-07-23 17:47:18 -07:00
Andrew Kelley
a7f3c2eab4 InternPool: fix coerced func hash/eql same as uncoerced
Since the same Key.Func data structure is used for coerced function
bodies as well as uncoerced function bodies, there is danger of them
being hashed and equality-checked as the same. When that happens, the
type of a function body value might be wrong, causing lots of problems.
In this instance, it causes an assertion failure.

This commit fixes it by introducing an `uncoerced_ty` field which
is different than `ty` in the case of `func_coerced` and is used to
differentiate when doing hashing and equality checking.

I have a new behavior test to cover this bug, but it revealed *another*
bug at the same time, so I will fix it in the next commit and and add
the new test therein.
2023-07-23 17:47:18 -07:00
Zachary Raineri
7dcbabef51
std.zig.Parse: Fix assertion (#16500)
The assert was copied from a few lines above without updating the target variable.
2023-07-23 20:18:02 -04:00
Andrew Kelley
a03fee465b build: include README.md in release tarballs 2023-07-23 15:51:13 -07:00
Andrew Kelley
9ada2f887c README makeover
This readme is now appropriate to include in release tarballs.
2023-07-23 15:49:18 -07:00
Andrew Kelley
9f112b77aa LICENSE: copyright notices do not need years 2023-07-23 15:46:06 -07:00
Luis Cáceres
df5f6836c4 std.crypto.Certificate: consistent param types for parseTimeDigits
This commit changes the type of the first parameter of parseTimeDigits
to *const [2]u8 for consistency with parseYear4 which uses *const [4]u8
as its first parameter. This is also more ergonomic for the caller since
they don't need to dereference the array.
2023-07-23 21:02:59 +00:00
jim price
59322963ce Fix the http.Server test and add it to the set of tests in http.zig 2023-07-23 13:58:34 -07:00
Luis Cáceres
05bad1f42d std.crypto.Certificate: fix timedate parsing
This commit fixes parsing in parseYear4 and parseTimeDigits by using a
wider vector data type such that the intermediate result cannot overflow
and the error check remains correct.
2023-07-23 20:48:45 +00:00