7886 Commits

Author SHA1 Message Date
Jan Philipp Hafer
fd2239bde9 child_process + Build: rename exec to run + all related code
Justification: exec, execv etc are unix concepts and portable version
should be called differently.

Do no touch non-Zig code. Adjust error names as well, if associated.
Closes #5853.
2023-10-22 14:47:20 -04:00
Andrew Kelley
d8c067966f
Merge pull request #17400 from joadnacer/ringbuffer-optim
std.RingBuffer: Implement mem.copy read/write
2023-10-22 13:19:22 -04:00
Jacob Young
ccc9ebf0bd std: slightly improve codegen of std.unicode.utf8ValidateSlice 2023-10-22 12:07:23 -04:00
Jacob Young
0c99ba1eab
Merge pull request #17637 from jacobly0/x86_64-test-std
x86_64: start to enable `test-std` and `test-compiler-rt` testing
2023-10-22 08:06:47 -04:00
Andrew Kelley
e354aac8f2
Merge pull request #14833 from QusaiHroub/optimize_std.fs.Dir.makeOpenPath_12474
#12474: std.fs.Dir.makeOpenPath: optimize case, if path already exists
2023-10-21 23:30:47 -04:00
Andrew Kelley
5aa82ed477 std.elf: remove some unneeded @as 2023-10-21 21:38:41 -04:00
Lee Cannon
3cd3052d4d fix std.Build.addAssembly 2023-10-21 20:46:28 -04:00
JustinWayland
c45af2af61
Fix simple doc mistakes. (#17624)
* Add missing period in Stack's description

This looks fine in the source, but looks bad when seen on the documentation website.

* Correct documentation for attachSegfaultHandler()

The description for attachSegfaultHandler() looks pretty bad without indicating that the stuff at the end is code

* Added missing 'the's in Queue.put's documentation

* Fixed several errors in Stack's documentation

`push()` and `pop()` were not styled as code

There was no period after `pop()`, which looks bad on the documentation.

* Fix multiple problems in base64.zig

Both "invalid"s in Base64.decoder were not capitalized.

Missing period in documentation of Base64DecoderWithIgnore.calcSizeUpperBound.

* Fix capitalization typos in bit_set.zig

In DynamicBitSetUnmanaged.deinit's and DynamicBitSet.deinit's documentation, "deinitializes" was uncapitalized.

* Fix typos in fifo.zig's documentation

Added a previously missing period to the end of the first line of LinearFifo.writableSlice's documentation.
Added missing periods to both lines of LinearFifo.pump's documentation.

* Fix typos in fmt.bufPrint's documentation

The starts of both lines were not capitalized.

* Fix minor documentation problems in fs/file.zig

Missing periods in documentation for Permissions.setReadOnly, PermissionsWindows.setReadOnly, MetadataUnix.created, MetadataLinux.created, and MetadataWindows.created.

* Fix a glaring typo in enums.zig

* Correct errors in fs.zig

* Fixed documentation problems in hash_map.zig

The added empty line in verify_context's documentation is needed, otherwise autodoc for some reason assumes that the list hasn't been terminated and continues reading off the rest of the documentation as if it were part of the second list item.

* Added lines between consecutive URLs in http.zig

Makes the documentation conform closer to what was intended.

* Fix wrongfully ended sentence in Uri.zig

* Handle wrongly entered comma in valgrind.zig.

* Add missing periods in wasm.zig's documentation

* Fix odd spacing in event/loop.zig

* Add missing period in http/Headers.zig

* Added missing period in io/limited_reader.zig

This isn't in the documentation due to what I guess is a limitation of autodoc, but it's clearly supposed to be. If it was, it would look pretty bad.

* Correct documentation in math/big/int.zig

* Correct formatting in math/big/rational.zig

* Create an actual link to ZIGNOR's paper.

* Fixed grammatical issues in sort/block.zig

This will not show up in the documentation currently.

* Fix typo in hash_map.zig
2023-10-21 21:24:55 +00:00
joadnacer
a8eb70c9d7 compress: Improve RingBuffer usage 2023-10-21 19:20:12 +01:00
joadnacer
7f9e0f1c56 std.RingBuffer: Implement more efficient read/write methods 2023-10-21 19:19:35 +01:00
Michael Bradshaw
cc56577edf Return zero for NaN-to-int lossy casts
Fixes #15038.

The goal here is to guarantee lossyCast() is panic-free and always safe.
2023-10-21 20:51:51 +03:00
Jacob Young
32e85d44eb x86_64: disable failing tests, enable test-std testing 2023-10-21 10:55:41 -04:00
Jacob Young
2e6e39a700 x86_64: fix bugs and disable erroring tests 2023-10-21 10:55:41 -04:00
Jacob Young
c880644d92 x86_64: disable difficult std tests and hack around more zero-bit types 2023-10-21 10:55:41 -04:00
snoire
b403ca0aab std.Build: use create() instead of init() for Step.RemoveDir 2023-10-21 17:48:25 +03:00
Andrew Kelley
3d6e633371
Merge pull request #16840 from e4m2/rand-int
std.rand: Support integers with >64 bits in more functions
2023-10-21 05:26:19 -04:00
LordMZTE
b3aaf854cd std.os: do nothing when calling fchdir with AT_FDCWD 2023-10-21 05:13:21 -04:00
Frank Denis
a5c79c7998
crypto.ff: faster exponentiation with short/public exponents (#17617)
RSA exponents are typically 3 or 65537, and public.

For those, we don't need to use conditional moves on the exponent,
and precomputing a lookup table is not worth it. So, save a few
cpu cycles and some memory for that common case.

For safety, make `powWithEncodedExponent()` constant-time by default,
and introduce a `powWithEncodedPublicExponent()` function for exponents
that are assumed to be public.

With `powWithEncodedPublicExponent()`, short (<= 36 bits) exponents
will take the fast path.
2023-10-21 02:09:43 -07:00
Ryan Liptak
fb5f69a552 Improve Dir.makePath and Dir.makeOpenPathAccessMaskW doc comments
These are not recursive functions, so 'recursively' could be misleading.
2023-10-20 23:25:43 -07:00
Ryan Liptak
63b504219d Dir.makeOpenPathAccessMaskW: Use path.ComponentIterator
See 49053cb1b4af7ee2973cf606def398c7eef6578b for details

Also, fix leaking the intermediate directory handles.
2023-10-20 23:25:43 -07:00
joadnacer
89aad1b89c linux.io_uring: Implement splice functions 2023-10-21 05:02:17 +03:00
Andrew Kelley
0d4d8dfc15 std.Target: update default Linux cross-compiling version
Currently, Zig uses the oldest Debian release that is still under LTS
for the default version minimum. This is now Debian 10 (Buster), with
long-term support until 2024-06-30.

Debian Buster uses Linux 4.19 and glibc 2.28.

For the default version maximum, Zig uses the newest stable Linux
version, which is currently 6.5.7.

Citations:
* https://www.debian.org/News/2019/20190706
* https://packages.debian.org/source/buster/glibc
* https://kernel.org/

Previous update commit: 1530203c804db7e5abd7d6eac05cfbe449d30aea
2023-10-20 20:12:50 -04:00
Constantin Bilz
45d7dfa833 std.hash_map: add const attribute to StringIndexContext.bytes and ...
StringIndexAdapter.bytes

Without this change, constructing a Context/Adapter for a `const` string
table requires a `@constCast`.
2023-10-20 19:06:32 +03:00
Andrew Kelley
a361f37b1c
Merge pull request #17608 from squeek502/resinator-fixes
resinator: Fix `INCLUDE` var handling and sync with upstream
2023-10-20 03:49:14 -04:00
dweiller
db18b562ac std.Build: do not assume custom test runners support client-server mode 2023-10-20 02:39:17 -04:00
Prokop Randacek
fee09009a8 gettimeofday takes nullable pointers 2023-10-20 00:15:34 -04:00
Krzysztof Wolicki
530dc0405c
std.os: unlinkW shouldn't return error.DirNotEmpty 2023-10-19 12:59:52 +00:00
Andrew Kelley
ae2cd5fe26 Revert "Never implicitly add rpaths for each lib dir, add NixOS libdir to rpath"
This reverts commit d7b73af8f65bb891c8700ed47777144bb6f35fe1.

I did not look at this closely enough. This is incorrect; it should not
implicitly add rpaths for every library, and it should not disable the
nice default of each_lib_path when compiling for the native OS.

See #16062 where we are working on a follow-up improvement to this.
2023-10-18 23:37:47 -07:00
Ryan Liptak
c139b9d4ad path.ComponentIterator: Add peekNext and peekPrevious functions 2023-10-18 20:42:59 -07:00
Qusai Hroub
f6a6cdbba3 std.fs.Dir.makeOpenPath: optimize when path already exists
Uses a single NtCreateFile syscall on windows.

Closes #12474. Thanks to @joedavis and @matu3ba.
2023-10-18 20:36:03 -07:00
Ryan Liptak
8ec04b567e Error if an .rc file uses the 'preprocess only' or 'no preprocess' flags 2023-10-18 18:30:32 -07:00
Andrew Kelley
32bc077672 std.Build: make dependencies inherit --search-prefix 2023-10-18 20:01:25 -04:00
Krzysztof Wolicki
bffe65c18f std.ChildProcess: fix error in killWindows 2023-10-18 19:11:28 -04:00
Andrew Kelley
8804d72684 std certs: solaris can use the BSD path 2023-10-18 12:51:45 -04:00
Andrew Kelley
e8f3c4c4b1
Merge pull request #13610 from bcrist/child_process_already_terminated
return error.AlreadyTerminated from std.ChildProcess.kill when necessary
2023-10-18 10:23:23 -04:00
Andrew Kelley
149f2f8adb
Merge pull request #17524 from Vexu/aro-translate-c
Add ability to test Aro based `translate-c`
2023-10-18 00:32:59 -04:00
Ben Crist
fb9376bd04 Double check that child processes have really exited when
TerminateProcess reports ACCESS_DENIED
2023-10-17 16:56:39 -07:00
Ben Crist
6d47198303 return error.AlreadyTerminated from std.ChildProcess.kill when necessary 2023-10-17 16:56:15 -07:00
Tobias Simetsreiter
7a9500fd80
Fix rendering ast in zon mode (#17547)
Co-authored-by: Tobias Simetsreiter <tobias.simetsreiter@wabtec.com>
2023-10-17 19:04:01 -04:00
David
364c54460f
Deflate: fix missing value in reset 2023-10-17 21:46:47 +00:00
David
5c8912d7a4
XXH3 Implementation for Zig STD (#17530)
XXH3 is the faster alternative to XXH64 which utilizes SIMD
when hashing large chunks of memory and similar mixing to
WyHash (64x64 -> 128 mul) for smaller inputs.

Co-authored-by: Reixcon226 <87927264+Rexicon226@users.noreply.github.com>

---------

Co-authored-by: kprotty <kbutcher6200@gmail.com>
2023-10-17 13:55:01 -05:00
Andrew Kelley
3b21c15782
Merge pull request #17562 from ziglang/fetch-symlink-normalize-sep
Package.Fetch: normalize path separators in symlinks
2023-10-17 14:35:39 -04:00
kcbanner
68ed787751 windows: fix ReadLink not using a synchronous file handle 2023-10-17 14:33:55 -04:00
Andrew Kelley
877393d17a std.fs: fix relative symbolic links on Windows
closes #17564
2023-10-17 06:27:07 -04:00
Veikka Tuominen
e765495b11 tests: translate-c and run-translated-c to the test harness 2023-10-17 11:55:17 +03:00
Andrew Kelley
f1a9344ffe std.fs.openDir: handle OBJECT_NAME_INVALID 2023-10-16 17:22:24 -07:00
Andrew Kelley
b171a6f25d Package.Fetch: normalize path separators in symlinks
closes #17549
2023-10-16 16:47:47 -07:00
Andrew Kelley
1456f95b3c std: disable flaky test on aarch64-windows
tracked by #17134
2023-10-16 16:13:46 -07:00
joadnacer
7b9165b375 std.mem: Improve writeIntSlice performance 2023-10-16 08:49:05 -04:00
Jacob Young
fbd90e487b Build: fix some issues with ConfigHeader step
* include path was using bad default for dependency lazy paths
 * unhashed config options caused changes to not trigger a rebuild
2023-10-16 03:50:47 -04:00