Commit Graph
7530 Commits
Author SHA1 Message Date
Ryo Ota d80e6ca5a6 std.http: add missing InvalidTrailers to ReadError 2023-04-20 12:35:26 +03:00
Andrew Kelley e102adc863 work around an intermittent io_uring test failure
See #15362
2023-04-19 22:49:51 -07:00
Andrew Kelley 0eebc25880 Merge pull request #15299 from truemedian/std-http
std.http: curated error sets and custom Headers
2023-04-18 19:56:24 -07:00
mlugg 77fdd76c16 std: fix uses of comptime blocks in non-inline functions
ccf670c made using `return` from within a comptime block in a non-inline
function illegal, since it is a use of runtime control flow in a
comptime block. It is allowed if the function in question is `inline`,
since no actual control flow occurs in this case. A few functions from
std (notably `std.fmt.comptimePrint`) needed to be marked `inline` to
support this change.
2023-04-18 19:51:18 -07:00
Mateusz Radomski 1e207f1edd math.big.int: remove stale comments
This pull request removes the optional allocator argument from functions
`divFloor` and `divTrunc`. As a result, the comments related to accepting an
optional `allocator` are no longer applicable. The support for accepting
an optional allocator was removed in #10017.
2023-04-18 18:42:02 -07:00
Erik Arvstedt 1617138c72 std.Thread.Condition: optimize example
- Hold the lock for a shorter amount of time
- Previously, when holding the lock while signaling, the other, resumed
  thread could potentially get suspended again immediately because
  the mutex was still locked.
- Fix comment
2023-04-18 18:38:52 -07:00
serg 5bc35fa75b std.target.riscv: fix baseline_rv32 missing feature "32bit" 2023-04-18 18:37:15 -07:00
r00ster91 2b7334c3a9 zig fmt: omit extra whitespace after last comment before EOF 2023-04-18 18:33:05 -07:00
kcbanner e82596950f debug: fix missing stack traces during crashes on windows
- walk the stack via the method that is aware of unwind info (fixes x86_64 / aarch64 traces)
- enhance the output for frames where the debug info isn't available by printing the module name
2023-04-18 18:20:15 -07:00
Andrew Kelley 34286530b7 Cache: fix multi-process race condition on macOS
This fixes `.INVAL => unreachable` being triggered by the cache system
on macOS when multiple processes race to create the same compilation.
The problem is that when two processes race to create a file, it
sometimes returns ENOENT even though that error code is nonsensical for
this situation.

Commit 2b0929929d purportedly solved this,
but it did not open the file with write permissions, leading to the
EINVAL panic later on. This commit remedies the situation by introducing
a loop and simply retrying when the ENOENT occurs.
2023-04-18 17:53:47 -07:00
Nameless a23c8662b4 std.http: pass Method to request directly, parse trailing headers 2023-04-18 10:28:53 -05:00
David CARLIER 2568da2f41 std: freebsd update proposal
adding getentropy and cpuset_(get/set)affinity calls.
2023-04-18 14:59:01 +03:00
Nameless e65cbff94d std.http: use 'Field' to describe an individual header 2023-04-17 19:16:06 -05:00
Nameless 85221b4e97 std.http: curate some Server errors, fix reading chunked bodies 2023-04-17 19:16:01 -05:00
Nameless 134294230a std.http: add Headers 2023-04-17 19:15:55 -05:00
Nameless 96533b1289 std.http: very basic http client proxy 2023-04-17 19:14:48 -05:00
Nameless 2c492064fb std.http: further curate error set, remove last_error 2023-04-17 19:14:48 -05:00
Nameless 038ed32cff add explicit error union for Bundle.rescan and associated functions 2023-04-17 19:14:48 -05:00
Loris Cro 3cd19dd897 Merge pull request #15304 from der-teufel-programming/autodoc-defaults
autodoc: Fix errors in main.js; add support for defaults in exprName
2023-04-17 20:14:57 +02:00
Loris Cro 3d33a09069 autodoc: more support for linking decls in docs & guides 2023-04-17 20:13:08 +02:00
Ryo Ota 17af53554e HTTP client and server send "0\r\n\r\n" when chunked encoding 2023-04-17 13:33:25 +03:00
Jakub Konka 1fb0b5a044 Merge pull request #15308 from kcbanner/dynlib_lookup_alignment
DynLib.lookup: cast the pointer to the correct alignment
2023-04-17 12:02:57 +02:00
Luuk de Gram 7fad555e5e Merge pull request #15271 from Luukdegram/wasm-start
wasm: no longer use simplified `start.zig` logic
2023-04-16 22:16:53 +02:00
Andrew Kelley b0186f3100 Merge pull request #15277 from ziglang/tests
add CI test coverage for more target combinations
2023-04-16 12:43:35 -07:00
Bogdan Romanyuk 397649fb09 Removing duplicate word in doc 2023-04-16 22:10:48 +03:00
kcbanner f0482c95d2 DynLib.lookup: cast the pointer to the correct alignment 2023-04-15 23:23:29 -04:00
Krzysztof Wolicki 421ad51dc0 autodoc: Fix errors in main.js; add support for defaults in exprName 2023-04-16 01:37:24 +02:00
Andrew Kelley 9b631b2b32 compiler_rt: use default visibility for non-exported symbols 2023-04-15 10:33:08 -07:00
Andrew Kelley 4a233d1871 CI: more C backend test coverage
The CI now runs C backend tests in addition to compiling them. It uses
-std=c99 -pedantic -Werror in order to catch non-conformant C code.

This necessitated disabling a test case that caused a C compile error,
in addition to disabling a handful of warnings that are already being
triggered by Zig's C backend output for the behavior tests.

The upshot is that I was able to, very cleanly, integrate the C backend
tests into the build system, so that it communicates via the test runner
protocol along with all the other behavior tests.
2023-04-15 10:33:08 -07:00
Andrew Kelley adc9b77d5f std.Build: add some more init options to CompileStep 2023-04-15 10:33:08 -07:00
Loris Cro bd3e248c7e autodoc: add initial support for linking decls mentioned in markdown
this works both on doc comments and guides
2023-04-15 18:26:53 +02:00
Loris Cro aa765c1d70 autodoc: add support for defining guide sections
For example:

//!zig-autodoc-section: Advanced Topics
2023-04-15 18:26:53 +02:00
Andrew Kelley e0890734f0 std.Build.CompileStep: fix installLibraryHeaders regression
reverts regression introduced in
d2ad3f5074.

The commit correctly removed dest_builder from InstallArtifactStep, but
the change to installLibraryHeaders was incorrect since it affected
different steps than that one.
2023-04-14 11:59:27 -07:00
xEgoist 0733c8c5ca windows: replace GetPhysicallyInstalledSystemMemory with ntdll.
`GetPhysicallyInstalledSystemMemory` uses SMBios to grab the physical
memory size which can lead to unecessary allocation and inacurate
representation of the total memory. Using `System_Basic_Information`
help to retrieve the physical memory which is not reserved for the
kernel/tables. This aligns better with the linux side as `/proc/meminfo`
does the same thing.
2023-04-14 13:43:03 -04:00
David CARLIER 7b908e173f std: add shm_create_largepage for FreeBSD, completing MFD* constants. 2023-04-14 13:41:22 -04:00
Luuk de Gram d755f67b93 wasm: no longer use simplified start.zig
The Wasm backend now supports all features required to use
the full `start.zig` logic, rather than the simplified version.
With this commit we remove all references to the simplified logic
for Wasm specifically.
2023-04-14 15:25:42 +02:00
Frank Denis b42562be74 std.crypto.aegis: support 256-bit tags (#15276) 2023-04-14 11:20:36 +02:00
David Carlier 56d800ff7e std add getrandom to solato solaris based systems 2023-04-14 08:11:13 +03:00
Frank Denis 9adee806e3 secp256k1: Endormorphism.splitScalar() can return an error (#15270)
Fixes #15267
2023-04-14 04:06:00 +00:00
David CARLIER 4a0508e56c std: add kinfo_vmentry for FreeBSD 2023-04-13 23:46:03 -04:00
Krzysztof Wolicki aea886e2f3 autodoc: main.js formatting 2023-04-13 17:42:29 +02:00
Krzysztof Wolicki 8bbf62c3b9 autodoc: Handling of explicit values for enum fields
Fixes to frontend handling of structs
2023-04-13 17:42:29 +02:00
Krzysztof Wolicki 97b3b36c65 autodoc: Handling of default values for struct fields 2023-04-13 17:42:29 +02:00
Loris Cro 83d1f6b15a autodoc: index in search usingnamespace decls 2023-04-13 17:38:52 +02:00
Andrew Kelley e2fe1907ec add c_char type
closes #875
2023-04-13 02:47:16 -04:00
Andrew Kelley 60bd13bdf2 never use C pointers!!
you maniacs, you absolute monsters. degenerates. hooligans. criminals.

issue #2984 is coming for you.
2023-04-12 15:21:03 -07:00
Jakub Konka 35f9c84449 macos: add missing getopt.h header 2023-04-13 00:19:33 +02:00
Michael Dusan 490a411fd4 openbsd: fix thread name buffer size
OpenBSD 7.3 changed its implementation of
pthread_get_name_np/pthread_set_name_np to wrap new libc functions
getthrname/setthrname and lowered the max buffer size from 32 to 24.

This is not a backwards-compatible change because if we were to put in
comptime version logic to use size 32 when target < 7.3 the binaries
would be undefined when running on >= 7.3. It also could simply be that
OpenBSD has a policy to not support older binaries running on newer
releases? Regardless, the safest course is to simply use the smallest
known buffer size.

As an aside, this bug manifested as a "hung" std.Thread test because 7.3
pthread API never checks for error result when wrapping getthrname/setthrname.
This is not a problem in std.Thread when we use the correct max buffer
size because ERANGE/EINVAL become unreachable.
2023-04-12 15:36:03 -04:00
mlugg ccf670c2b0 Zir: implement explicit block_comptime instruction
Resolves: #7056
2023-04-12 12:06:19 -04:00
Loris CroandKrzysztof Wolicki 602029bb2f Autodoc usingnamespace (#15216)
* autodoc: init support for usingnamespace decls

* autodoc: don't build autodoc when building zig2.c

* autodoc: usingnamespace decls support in frontend (#15203)

* autodoc: init support for usingnamespace decls

* autodoc: usingnamespace decls support in frontend

---------

Co-authored-by: Krzysztof Wolicki <46651553+der-teufel-programming@users.noreply.github.com>
2023-04-12 01:14:02 +00:00