Commit Graph

6931 Commits

Author SHA1 Message Date
Jan Philipp Hafer
55e879d2ed std.os.windows: add possible error NETNAME_DELETED of ReadFile
Closes #13631
2023-01-23 02:07:12 -05:00
Mateusz Poliwczak
bbbc4ebf03 support P256 in x509 2023-01-22 17:24:45 -05:00
fn ⌃ ⌥
33682a29c6 Rewrite update_crc_catalog in zig and move tests to separate file 2023-01-22 07:16:49 -08:00
fn ⌃ ⌥
6089ed9ee7 Merge branch 'master' into crc 2023-01-22 05:30:38 -08:00
fn ⌃ ⌥
f85c01d4c7 Implement gzip header CRC check.
From RFC 1952:

> If FHCRC is set, a CRC16 for the gzip header is present,
> immediately before the compressed data. The CRC16 consists
> of the two least significant bytes of the CRC32 for all
> bytes of the gzip header up to and not including the CRC16.
2023-01-22 00:33:29 -05:00
Jakub Konka
562d52e23d
Merge pull request #14397 from ziglang/macho-unwind-info
zld: handle parsing and synthesising unwind info in the MachO linker
2023-01-22 00:44:44 +01:00
Stephen Gregoratto
7f635ae7bd FreeBSD: add mcontext_t for aarch64
What isn't disabled for test-std mostly passes, except for the copysign
and signbit tests for f16. Seemingly related to #14366.
2023-01-21 23:20:50 +02:00
fn ⌃ ⌥
be4468be37 std.hash.crc: implement algorithms listed in CRC RevEng catalog 2023-01-21 07:04:09 -08:00
Jakub Konka
24f6c07653 std.macho: add OLD = 0 as valid mode for both arm64 and x86_64 2023-01-21 13:18:14 +01:00
Andrew Kelley
6d38dba72e std.build.LibExeObjStep: avoid putting static libs inside static libs 2023-01-20 19:31:38 -07:00
Andrew Kelley
7ea3937c5a std.build.LibExeObjStep: better handle transitive deps
* no longer repeat -lc on the linker line redundantly
 * when using linkLibrary() with a static library, it will now also put
   the static library's static library dependencies on the linker line,
   recursively.
 * refactor out a common pattern to an addFlag function
2023-01-20 16:58:31 -07:00
mlugg
d3599ec73c std: implement os.mprotect on Windows 2023-01-20 03:33:35 +02:00
Jarred Sumner
a9eb463202 Make res nullable in getaddrinfo 2023-01-19 23:08:15 +02:00
山下
6c98c8d891
Wildcard certs should only validate one level of sub domain 2023-01-19 19:13:42 +00:00
Marco Munizaga
d87a58dfab Add framework paths from NIX_CFLAGS_COMPILE 2023-01-19 16:57:55 +02:00
IntegratedQuantum
f38fd388f8
Mutex deadlock detection in debug
Add a debug implementation to Mutex that detects deadlocks caused by calling lock twice in a single thread.
2023-01-19 16:57:29 +02:00
star-tek-mb
116b770809 fix selectSymbol function pointers 2023-01-19 16:34:02 +02:00
Adrian Cole
7208e1ff87 wasm: avoids allocating zero length buffers for args or env
I was testing this with wazero, which defaults to not propagate any env
variables. This ensures we don't try to allocate zero length buffers
when there are no results from either function.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-01-19 15:34:38 +02:00
Jakub Konka
c70a3d9022 macho: port arm64 and x86_64 compact unwind defs verbatim
We do not need more for the purpose of parsing and synthesising
unwind info by the linker. If we ever decide to generate unwind
info for Zig by the compiler, we can re-add packed struct defs
again.
2023-01-19 03:44:42 +01:00
Michael Dusan
c9f7b32fbd netbsd: add mcontext_t for aarch64
- test `lib/std/std.zig` passes
- stack traces work
2023-01-18 02:50:11 -05:00
Andrew Kelley
7f604b6f48
Merge pull request #14333 from Vexu/fixes
Misc fixes
2023-01-17 21:32:13 -05:00
Veikka Tuominen
841b38aae8 tokenizer: detect null as non-first byte of a line comment
Line comments do not produce actual tokens so they need special
handling for null bytes.

Closes #14346
2023-01-17 20:39:19 +02:00
fn ⌃ ⌥
2623e1c4d6 Add std.os.darwin.cssm 2023-01-17 09:51:39 -08:00
fn ⌃ ⌥
faf0fe4305 std.crypto.Certificate.Bundle: use parseCert in rescanWindows 2023-01-17 08:59:38 -08:00
fn ⌃ ⌥
40c400ec9e std.crypto.Certificate.Bundle: clear bundle before macOS rescan 2023-01-17 08:58:06 -08:00
Andrew Kelley
f3107e2cb2
Merge pull request #14344 from ziglang/config-header-step
zig build: enhance LibExeObjStep and ConfigHeaderStep
2023-01-17 08:10:36 -05:00
Andrew Kelley
65586b9869 std.build.LibExeObjStep: change installHeader API
Now it always takes a dest_rel_path parameter, making it slightly more
verbose, and much more useful.
2023-01-17 00:45:04 -07:00
Andrew Kelley
6db3869fc7 std.build.ConfigHeaderStep: support cmake syntax
It's not fully implemented yet, for example `@FOO@` syntax is not
handled.
2023-01-17 00:44:57 -07:00
Andrew Kelley
d35d086ae6 std.crypto.Certificate: add more object id 2023-01-17 00:09:38 -07:00
Andrew Kelley
7623f3fad0 std.crypto.Certificate: skip unknown attributes 2023-01-17 00:09:34 -07:00
Andrew Kelley
86308ba1e1 std.net.getAddressList: call WSAStartup on Windows 2023-01-17 00:08:42 -07:00
Andrew Kelley
62e3fdcf4f std.crypto.Certificate: add more object ids 2023-01-17 00:08:42 -07:00
Andrew Kelley
09560bc69a clean up windows cert scanning
* keep helper functions out of the DLL bindings APIs
 * unify the logic for linux and windows certificate scanning with
   regards to error handling
2023-01-17 00:08:42 -07:00
star-tek-mb
1f9fa82235 windows root certificate scanning 2023-01-17 00:08:42 -07:00
Andrew Kelley
d56a65a8c4 std.http.Client: default to lazy root cert scanning
After this change, the system will be inspected for root certificates
only upon the first https request that actually occurs. This makes the
compiler no longer do SSL certificate scanning when running `zig build`
if no network requests are made.
2023-01-17 01:44:56 -05:00
Andrew Kelley
e646becd04
Merge pull request #14336 from Vexu/field-reorder
Sema: automatically optimize order of struct fields
2023-01-16 21:19:48 -05:00
Andrew Kelley
37424fd11a add std.build.LibExeObjStep.installHeadersDirectoryOptions
For when you need options such as excluding certain extensions.
2023-01-16 16:09:24 -07:00
fn ⌃ ⌥
e45b471ad3
Find system-installed root SSL certificates on macOS (#14325) 2023-01-16 22:34:04 +00:00
Veikka Tuominen
b2c85464be std.os.linux.io_uring: fix ABI error
`register_files_update` was passing a pointer to a Zig struct to the kernel.
2023-01-16 22:25:34 +02:00
Krzysztof Wolicki
ae69dfe6e7
autodoc: Better handling of variable decls (#14301) 2023-01-16 17:28:07 +01:00
Michael Bartnett
31a2b8c364
std: Handle field struct defaults in std.mem.zeroInit
I originally started monkeying with this because std.mem.zeroes doesn't support sentinel-terminated const slices even with defaults in 0.10.x.

I see that std.mem.zeroes was modified in #13256 to allow setting these slices to "".

That got me partway to where I wanted, but there was still an issue fields whose types are structs, they wouldn't get their defaults.

So when iterating struct fields looking for default values, when there is no default value and the type is .Struct, it will delegate to a call to zeroInit.

* Initialize struct fields in zeroInit exactly once

In my changes, similar to the previous implementation, the priority order for fields being initialized is:

1. If the `init` argument is a tuple, the nth element corresponding to the nth field of the struct.
2. Otherwise, if the `init` argument is not a tuple, try to find a matching field name on `init` and use that field.
3. Is the field has a default value, initalize with that value.
4. Fall back to what the field would have been initialized to via a recursive call to `std.mem.zeroInit`.

But instead of initializing a default instance of the struct and then running multiple passes over it, the init method is chosen per-field and each field is initialized exactly once.
2023-01-16 14:24:47 +02:00
Michael Bartnett
99febb54d3 Add fromOwnedSliceSentinel to ArrayList ArrayList and ArrayListUnmanaged, add fromOwnedSlice to ArrayListUnmanaged 2023-01-16 14:22:38 +02:00
r00ster91
3dd8f43ad3 std.Thread: make Id smaller where possible 2023-01-16 14:20:57 +02:00
Andrew Kelley
e3505c0a5a std.crypto.Certificate.Bundle: add more Linux directories
Thanks to the Go project for finding all these paths.
2023-01-15 15:01:42 -07:00
Andrew Kelley
9a0e1704ae std.crypto.Certificate: support v1
closes #14304
2023-01-15 14:59:49 -07:00
Robert Burke
d813cef42a Fix buffer overflow in fmt when DAZ is set 2023-01-13 16:45:10 +02:00
Andrew Kelley
7cb2f9222d
Merge pull request #14265 from ziglang/init-package-manager
Package Manager MVP
2023-01-12 18:49:15 -05:00
Frank Denis
cbbf8c8a2d
wasi-libc: use __heap_end if available (#14273)
The symbol was introduced in LLD 15.0.7, as a way to know how
much memory can be allocated:

1095870e8c
https://github.com/WebAssembly/wasi-libc/pull/377
2023-01-12 13:48:14 +00:00
Clement Espeute
66569c7ec6 autodoc: use js instead of details for collapsing descriptions 2023-01-12 13:38:26 +01:00
antlilja
4971df8572 UEFI pool allocator changes
* Changed the interface to align with the new allocator interface.
* Fixed bug where not enough memory was allocated for the header or to
  align the pointer.
2023-01-12 03:46:15 -05:00