Mason Remaley
3b2fec17a4
std.zon: populate Zoir.Node.Index values with corresponding ZOIR node
...
This allows using `std.zon` to parse schemas which are not directly
representable in the Zig type system; for instance, `build.zig.zon`.
2025-04-02 06:08:04 +01:00
Carmen
9720bade7a
std.start: allow return uefi error union in main ( #23425 )
2025-04-01 17:10:10 +00:00
Carmen
fa86e09fb3
std.os.uefi.protocol: ziggify function signatures ( #23214 )
2025-04-01 10:47:51 +00:00
Ali Cheraghi
b636d56d6a
zon: normalize negative zeroes
2025-03-31 19:07:34 -04:00
Alex Rønne Petersen
c118cd6406
Merge pull request #23417 from dweiller/zstd-fixes
...
Zstd fixes
2025-03-31 17:50:32 +02:00
Simon Brown
43ad87555e
Add quota for comptime sort, add test
2025-03-31 17:47:46 +02:00
dweiller
d034f2a87b
std.compress.zstd: ensure window size fits into usize
2025-03-31 17:22:44 +11:00
dweiller
7a7d6a02a5
std.compress.zstd: fix OOB access in literal decode
...
When decoding the literals section of a compressed block, the length of
the regenerated size of the literals must be checked against the buffer
literals are decoded into.
2025-03-31 17:22:44 +11:00
Frank Denis
ca1fc3827e
crypto.ecdsa: fix EcdsaP384Sha3_384 constant name ( #23403 )
...
Spotted by @deatil -- Thanks!
2025-03-29 14:52:34 +00:00
Sean Stasiak
6e8493daa3
check result of mmap() call to handle a large base_addr value correctly
2025-03-27 20:34:41 +01:00
Alex Rønne Petersen
cc9634a2d3
Merge pull request #23373 from alexrp/get-base-address
...
`std.process`: Some minor fixes for `getBaseAddress()`
2025-03-27 15:39:24 +01:00
GalaxyShard
b5a5260546
std.Build: implement addEmbedPath for adding C #embed search directories
2025-03-27 09:47:42 +01:00
blurrycat
fb188c3d18
std.posix: add getuid()/geteuid()
2025-03-27 07:58:27 +00:00
Андрей Краевский
aac800ec65
std.meta.FieldType -> @FieldType
2025-03-27 03:49:38 +00:00
Alex Rønne Petersen
db7db48028
Merge pull request #23339 from Iced-Sun/master
...
std.posix: update LFS64 interfaces for android bionic C
2025-03-26 23:25:08 +01:00
Felix "xq" Queißner
0ed905b9c6
Enables parsing for '-Wl,-rpath,' in pkg-config output, allows better support for NixOS linking.
2025-03-26 22:55:18 +01:00
Pratham
5bb9963bbb
abiAndDynamicLinkerFromFile: return an error when the file is not actually dynamic ( #19928 )
2025-03-26 19:54:10 +00:00
Alex Rønne Petersen
b9efdbb412
std.process: Fix getBaseAddress() to handle all Darwin OSs.
2025-03-26 20:39:07 +01:00
Alex Rønne Petersen
d56a99442b
std.process: Don't use _mh_execute_header in getBaseAddress() on BSDs.
...
Only the Mach-O format has this symbol.
2025-03-26 20:39:07 +01:00
Alex Rønne Petersen
0cf5f0d0b0
std.process: Fix getBaseAddress() for linux + libc.
...
In this case we should use the getauxval() from libc, not our own.
2025-03-26 20:39:07 +01:00
wooster0
263ba34619
linux: don't export getauxval when not required
2025-03-26 20:37:35 +01:00
Kendall Condon
b4b1daf001
Allocator.create: properly handle alignment for zero-sized types ( #21864 )
2025-03-26 15:31:57 +00:00
dweiller
b84db311d9
zig build: add env_map entries to hash for Step.Run
...
This change fixes false-positive cache hits for run steps that get run
with different sets of environment variables due the the environment map
being excluded from the cache hash.
2025-03-26 14:48:04 +01:00
孙冰
0118912e2d
std.posix: update LFS64 interfaces for android bionic C
2025-03-26 20:00:05 +08:00
孙冰
d7e944a628
std.Target: Update default Android API level to 24
...
API level 24 completes _FILE_OFFSET_BITS=64 support in bionic, c.f.
https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md .
According to https://apilevels.com , API level 24 (Android 7 released in 2017)
has 97% cumulative usage.
2025-03-26 19:48:21 +08:00
Alex Rønne Petersen
b350049f51
Merge pull request #23062 from ianic/io_uring_bind
...
io_uring: Update to kernel changes in 6.11 and 6.12
2025-03-26 11:39:56 +01:00
Pat Tullmann
2210c4c360
lib/std/posix: test ftruncate via std.fs.File.setEndPos()
...
Add a test for std.fs.File's `setEndPos` (which is a simple wrapper around
`std.posix.ftruncate`) to exercise some success and failure paths.
Explicitly check that the `ftruncate` length isn't negative when
interpreted as a signed value. This avoids having to decode overloaded
`EINVAL` errors.
Add errno handling to Windows path to map INVALID_PARAMETER to FileTooBig.
Fixes #22960
2025-03-26 02:57:23 +01:00
Jonathan Marler
1408288b95
support more process creation options on Windows
...
Adds a CreateProcessFlags packed struct for all the possible flags to
CreateProcessW on windows. In addition, propagates the existing
`start_suspended` option in std.process.Child which was previously only
used on Darwin. Also adds a `create_no_window` option to std.process.Child
which is a commonly used flag for launching console executables on
windows without causing a new console window to "pop up".
2025-03-25 23:48:27 +01:00
Arnau Camprubí
8a8b3019f3
Fix std.debug.dumpHex address offsets
2025-03-25 23:20:56 +01:00
Alex Rønne Petersen
cb8d7a8110
Merge pull request #23310 from Rexicon226/fix-23309
...
big.int: return normalized results from `{add,sub}Carry`
2025-03-25 18:44:35 +01:00
Kuwazy
6b6dc1cd3a
Added check for HTTP version and GET method when upgrading WebSocket to comply with RFC 6455. ( #23332 )
2025-03-25 15:00:50 +01:00
Alex Rønne Petersen
e1c6af2840
Merge pull request #23220 from samy-00007/bytesAsSlice-fix
...
Minor fix for `Allocator.remap` and `mem.bytesAsSlice` for zero-sized types
2025-03-25 13:45:10 +01:00
孙冰
fbbdde41b4
std.c: android bionic C supports arc4random_buf and getentropy
...
1. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/getentropy.h
2. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/stdlib.h
2025-03-25 13:17:45 +01:00
Alex Rønne Petersen
c94d926bba
Merge pull request #23007 from rootbeer/posix-eaccess-eperm
...
lib/std: Make usage of PermissionDenied & AccessDenied consistent
2025-03-25 11:21:05 +01:00
godalming123
5bb4fef30a
Update the documentation comment in arena_allocator.zig to be more accurate
...
Update the documentation comment in arena_allocator.zig to specify that free() is a no-op unless the item is the most recent allocation.
2025-03-25 06:19:28 +00:00
samy007
4595b1ee06
std.mem.bytesAsSlice: fix to support zero-bytes sized types
...
also added a test for json parsing of zero sized type
2025-03-24 22:08:05 +01:00
samy007
be483dabc8
fix: Allocator.remap now handles zero-bytes sized types
2025-03-24 22:05:57 +01:00
Chris Clark
525466b49d
std.zig.Ast: Fix error case memory leak in parse()
2025-03-24 20:14:01 +01:00
Pat Tullmann
14c046fc07
lib/std: PermissionDenied/AccessDenied cleanup and fallout
...
This PR consistently maps .ACCES into AccessDenied and .PERM into
PermissionDenied. AccessDenied is returned if the file mode bit
(user/group/other rwx bits) disallow access (errno was `EACCES`).
PermissionDenied is returned if something else denies access (errno was
`EPERM`) (immutable bit, SELinux, capabilities, etc). This somewhat
subtle distinction is a POSIX thing.
Most of the change is updating std.posix Error Sets to contain both
errors, and then propagating the pair up through caller Error Sets.
Fixes #16782
2025-03-24 16:20:45 +01:00
Pat Tullmann
02373eb2a5
lib/std/: WASI code should follow POSIX semantics for AccessDenied/PermissionDenied
...
Use error.AccessDenied for permissions (rights) failures on Wasi
(`EACCES`) and error.PermissionDenied (`EPERM`) for systemic failures.
And pass-through underlying Wasi errors (PermissionDenied or AccessDenied)
without mapping.
2025-03-24 16:20:45 +01:00
Pat Tullmann
f304d8e50a
windows: Use AccessDenied for ACCESS_DENIED on Windows
...
Windows defines an `ACCESS_DENIED` error code. There is no
PERMISSION_DENIED (or its equivalent) which seems to only exist on POSIX
systems. Fix a couple Windows calls code to return `error.AccessDenied`
for `ACCESS_DENIED` and to stop mapping AccessDenied into
PermissionDenied.
2025-03-24 16:20:45 +01:00
Meghan Denny
972cab5bb0
std: add bit_set.findLastSet() ( #22411 )
2025-03-24 16:12:23 +01:00
oittaa
c1db72cdbc
std.math: Add least common multiple (lcm)
2025-03-24 16:07:40 +01:00
rpkak
9f8d938d38
DepTokenizer: allow space between target and colon
2025-03-24 15:31:03 +01:00
David Rubin
ae442e2c29
big.int: return normalized results from {add,sub}Carry
2025-03-24 06:58:01 -07:00
Shun Sakai
677b2d62e5
docs(std.base64): Add references to RFC 4648
...
There are multiple implementations of Base64, but `std.base64` appears
to be based on RFC 4648, so we clarify that it is based on RFC 4648.
2025-03-24 11:42:28 +00:00
GasInfinity
dfe0fb675d
fix(std/fmt.zig): fix overflow in fmtDurationSigned
...
fixes #23315
2025-03-24 11:40:19 +00:00
Carter Snook
149eace5d5
deprecate O(n) union field type helpers in std.meta
...
Users should be using @FieldType() instead.
2025-03-24 11:13:58 +00:00
sdzx-1
adee3ee9a2
typo: block_two_semicolon -> block_two
2025-03-24 07:05:17 +01:00
Jacob Young
98640cbeb8
Merge pull request #23209 from jacobly0/x86_64-rewrite
...
x86_64: rewrite wrapping multiplication
2025-03-23 21:56:58 -04:00