Commit Graph
100 Commits
Author SHA1 Message Date
Andrew Kelley abadad4640 Merge pull request #19402 from ianprime0509/markdown-autolinks
Autodoc: hyperlink URLs in text
2024-03-25 15:36:37 -07:00
Andrew Kelley 32b4d85605 Merge pull request #19406 from jacobly0/haiku
haiku: get a cross-compiled compiler working
2024-03-25 15:33:51 -07:00
Andrew Kelley d8bb139da4 Merge pull request #19390 from ziglang/valgrind
make the behavior tests run almost valgrind clean
2024-03-22 02:04:48 -07:00
Andrew Kelley a2651cbc82 Merge pull request #19388 from ziglang/cache-dedup
cache system file deduplication
2024-03-22 01:13:43 -07:00
Andrew Kelley 90c94a2f0b disable failing behavior test: "reinterpret extern union"
see tracking issue #19389
2024-03-21 20:09:20 -07:00
Andrew Kelley 950359071b std.Build.Cache: bump manifest_file_size_max to 100M
Some users are hitting this limit. I think it's primarily due to not
deduplicating (solved in the previous commit) but this seems like a
better limit regardless.
2024-03-21 19:56:47 -07:00
Andrew Kelley 2f4bbd6c63 std.Build.Cache: use an array hash map for files
Rather than an ArrayList. Provides deduplication.
2024-03-21 19:56:30 -07:00
Andrew Kelley ebec7336e2 std.array_hash_map: remove meta context verification
The zig way is to let the compiler provide errors, rather than trying to
implement the compiler in the standard library.

I played around with this and found the compile errors to be easier to
comprehend without this logic.
2024-03-21 19:40:56 -07:00
Andrew Kelley 3eb260f042 disable failing behavior test: "comptime bitcast with fields following f80"
see tracking issue #19387
2024-03-21 19:07:08 -07:00
Andrew Kelley 1e46e36eac std.array_hash_map: enhance doc comments
- more readable in markdown
- remove confusing stuff
- linkification
- rewording
- move parameter documentation to parameter documentation
2024-03-21 17:54:58 -07:00
Andrew Kelley 7bc0b74b6d move Package.Path to std.Build.Cache.Path 2024-03-21 16:16:47 -07:00
Andrew Kelley 8778dc4bb2 extract std.Build.Cache.Directory into separate file 2024-03-21 16:11:59 -07:00
Andrew Kelley af09d93925 disable failing behavior test: "bitcast packed union to integer"
see tracking issue #19384
2024-03-21 15:54:40 -07:00
Andrew Kelley 54c08579e4 Merge pull request #19348 from jedisct1/wasi-threads-compfix
Unbreak support for WASI threads
2024-03-21 15:13:15 -07:00
Andrew Kelley 4dc50151c4 std.mem.indexOfSentinel: valgrind integration
this code returns false positives in Valgrind, so we fall back to the
other implementation when running in valgrind.

see #17717
2024-03-21 15:01:57 -07:00
Andrew Kelley 33428fc6aa std.mem.indexOfScalarPos: valgrind integration
this code returns false positives in Valgrind, so we fall back to the
other implementation when running in valgrind.

see #17717
2024-03-21 14:35:37 -07:00
Andrew Kelley afa0834195 add std.debug.inValgrind
This is like `@inComptime` but for the Valgrind virtual machine.

Related #17717
2024-03-21 14:35:08 -07:00
Andrew Kelley 12191c8a22 std: promote tests to doctests
Now these show up as "example usage" in generated documentation.
2024-03-21 14:11:46 -07:00
Andrew Kelley 5ae838d105 std: remove one layer of redundant parse_float namespace
there are still more, though.

This provides a doctest for the `parseFloat` function.
2024-03-21 14:08:54 -07:00
Andrew Kelley c5bd19e45e std.Build.addTest: add doc comments
closes #15009
2024-03-21 14:02:58 -07:00
Andrew Kelley b5cef9e8b4 Merge pull request #19374 from ziglang/slice-by-len-safety
add OOB safety check for by-length slice of array
2024-03-21 01:47:54 -07:00
Andrew Kelley 43edd53c33 Merge pull request #19365 from ziglang/update-mingw-w64
Update mingw-w64 and add Win32 def files
2024-03-20 17:33:56 -07:00
Andrew Kelley 4d5e0a0434 Revert the last two commits in this branch
When the slice-by-length start position is runtime-known, it is likely
protected by a runtime-known condition and therefore a compile error is
less appropriate than a runtime panic check.

This is demonstrated in the json code that was updated and then reverted
in this commit.

When #3806 is implemented, this decision can be reassessed.

Revert "std: work around compiler unable to evaluate condition at compile time"
Revert "frontend: comptime array slice-by-length OOB detection"

This reverts commit 7741aca96c.
This reverts commit 2583b389ea.
2024-03-20 17:29:06 -07:00
Andrew Kelley 7741aca96c std: work around compiler unable to evaluate condition at compile time 2024-03-20 17:26:31 -07:00
Andrew Kelley 4bc18c52f7 std.hash_map: fix pointer lock safety false positive
closes #19358
2024-03-20 17:14:52 -07:00
Andrew Kelley 2583b389ea frontend: comptime array slice-by-length OOB detection 2024-03-20 17:02:35 -07:00
Andrew Kelley ab22844176 frontend: add missing bounds check for slice-by-length arrays
closes #18382
2024-03-20 16:29:46 -07:00
Andrew Kelley f47e92ca0d mingw-w64: update to latest master
upstream commit 0bac2d3cdb122dadcdee90009f7e24a69d56939f
2024-03-20 11:26:09 -07:00
Andrew Kelley 869c2a03f3 mingw-w64 updater: don't include windowsapp or onecore APIs 2024-03-20 11:25:54 -07:00
Andrew Kelley 25fb6de83c mingw-w64: update to reflect latest tool changes
upstream commit dddccbc3ef50ac52bf00723fd2f68d98140aab80

closes #18968
2024-03-20 11:23:51 -07:00
Andrew Kelley 43f240803d mingw-w64 updater: don't omit win32 def files
see #18968
2024-03-20 11:23:48 -07:00
Andrew Kelley 7ecbb6f3a0 Merge pull request #19360 from ziglang/no-byos-posix
std: don't do BYOS at the POSIX API layer
2024-03-20 00:39:09 -07:00
Andrew Kelley cba1555104 std: don't do BYOS at the POSIX API layer
This was a mistake from day one. This is the wrong abstraction layer to
do this in.

My alternate plan for this is to make all I/O operations require an IO
interface parameter, similar to how allocations require an Allocator
interface parameter today.
2024-03-20 00:38:44 -07:00
Andrew Kelley 5d389535e8 std: fix inconsistent errno size on linux
Now it's always u16
2024-03-20 00:36:41 -07:00
Andrew Kelley 3a836b4800 Merge pull request #19354 from ziglang/std.posix
extract std.posix from std.os
2024-03-20 00:34:28 -07:00
Andrew Kelley 8c94950c24 fix compilation failures found by CI 2024-03-19 16:18:18 -07:00
Andrew Kelley 6b2899df2a compiler: fix wrong detection of rlimit
related to #19352
2024-03-19 11:45:10 -07:00
Andrew Kelley cd62005f19 extract std.posix from std.os
closes #5019
2024-03-19 11:45:09 -07:00
Andrew Kelley c52a2c338d std.Build.Step.Run: documentation for addFileArg and friends
Someone on IRC got these functions mixed up, and it sure would have been
helpful to have these docs in the first place, eh?
2024-03-18 23:52:52 -07:00
Andrew Kelley fb812fc1fc langref: add naming guide 2024-03-18 23:52:52 -07:00
Andrew Kelley cbeab678a5 Merge pull request #19325 from Vexu/dynlib
std: adjust DynLib API
2024-03-17 20:19:51 -07:00
Andrew Kelley 95cb939440 Merge pull request #19333 from Vexu/fixes
Miscellaneous error fixes
2024-03-17 15:26:55 -07:00
Andrew Kelley d981549d65 Merge pull request #19323 from jacobly0/rm-fn-type-align
AstGen: disallow alignment on function types
2024-03-17 15:19:54 -07:00
Andrew Kelley 242ab81112 std: introduce pointer stability locks to hash maps (#17719)
This adds std.debug.SafetyLock and uses it in std.HashMapUnmanaged by
adding lockPointers() and unlockPointers().

This provides a way to detect when an illegal modification has happened and
panic rather than invoke undefined behavior.
2024-03-16 18:45:10 -04:00
Andrew Kelley 1b8d1b18c7 Merge pull request #19271 from The-King-of-Toasters/falling-metal-pipe
Windows: Replace CreatePipe with ntdll implementation
2024-03-16 15:44:02 -07:00
Andrew Kelley ce4245f873 Merge pull request #19312 from mikdusan/bsd-debitrot
bsd: debitrot
2024-03-15 16:59:05 -07:00
Andrew Kelley cb419a1a86 langref: caution against default field values
closes #19169
2024-03-15 16:37:13 -07:00
Andrew Kelley bc5b094695 remove std.io.PeekStream
See #16114. This functionality should be added to bufferedReader
instead.
2024-03-14 07:48:47 -07:00
Andrew Kelley 778ab767b1 Merge pull request #19258 from castholm/enums-eval-branch-quota
std.enums: Increase eval branch quotas
2024-03-13 18:50:12 -07:00
Andrew Kelley ea8e9e668b Merge pull request #19289 from ianic/issue_19052
compress.xz: fix slow running read loop
2024-03-13 18:32:50 -07:00
Andrew Kelley da5b16f9e2 Merge pull request #19238 from dweiller/ring-buffer
std.RingBuffer: minor cleanup and doc improvements
2024-03-11 18:49:16 -07:00
Andrew Kelley cb4e087fda Merge pull request #19239 from jedisct1/ml-kem
std.crypto: add support for ML-KEM
2024-03-11 18:48:08 -07:00
Andrew Kelley bd24e66379 Merge pull request #19229 from tiehuis/ryu-128
std.fmt: add ryu floating-point formatting implementation
2024-03-11 18:46:26 -07:00
Andrew Kelley 0c61466771 Merge pull request #19174 from squeek502/lazy-resinator
Lazily compile the `zig rc` subcommand and use it during `zig build-exe`, etc
2024-03-11 17:18:09 -07:00
Andrew Kelley f60c24c73c Merge pull request #19155 from ianic/tar_max_file_size
std.tar: error on insufficient buffers provided to iterator
2024-03-11 17:03:44 -07:00
Andrew Kelley d0c06ca712 Merge pull request #19208 from ziglang/rework-autodoc
Redesign How Autodoc Works
2024-03-11 01:37:50 -07:00
Andrew Kelley 1397341540 add missing field to module creation
Fixes a merge conflict with one of mlugg's recent branches.
2024-03-10 18:22:53 -07:00
Andrew Kelley aa852f737b improve documentation in std
A lot of these "shorthand" doc comments were redundant, low quality
filler content. Better to let the actual modules speak for themselves
with top level doc comments rather than trying to document their
aliases.
2024-03-10 18:13:30 -07:00
Andrew Kelley b13a55db97 update autodocs web application to latest
upstream commit 1f921d540e1a8bb40839be30239019c820eb663d

after this branch is merged, ziglang/zig becomes the new repository for
this code.
2024-03-10 18:13:25 -07:00
Andrew Kelley 6b8c7540a8 fix 32 bit compilation 2024-03-10 17:51:07 -07:00
Andrew Kelley 4f1e5f78f6 autodoc has a new code owner. it's me 2024-03-10 17:51:07 -07:00
Andrew Kelley c19657d65c cmake: remove -Dno-autodocs
this is now the default
2024-03-10 17:51:07 -07:00
Andrew Kelley 60f1fe5e60 remove the autodoc issue template 2024-03-10 17:51:07 -07:00
Andrew Kelley c2e978f04f build: spend a lot less time generating std docs 2024-03-10 17:51:07 -07:00
Andrew Kelley 8b70e4f2c9 autodocs: fix root name and missing dir close 2024-03-10 17:51:07 -07:00
Andrew Kelley 8dcc35e5ce build: don't include std lib docs by default
since we have `zig std` now to fill that role.
2024-03-10 17:51:07 -07:00
Andrew Kelley 261094ca85 -femit-docs: create main.wasm artifact 2024-03-10 17:51:07 -07:00
Andrew Kelley 3efdfe612e std.Thread.WaitGroup: add spawnManaged
Provides a convenient way to spawn a new thread that bypasses a thread
pool. Appropriate when the spawned thread delegates all of its work.
2024-03-10 17:51:07 -07:00
Andrew Kelley ffd53a459e -femit-docs: creating sources.tar
It's always a good day when you get to use File.writeFileAll 😎
2024-03-10 17:51:07 -07:00
Andrew Kelley 91260459e3 frontend: skeleton for creating autodocs
This time, unlike the old implementation, it properly does autodoc
generation during the compilation pipeline, saving time.
2024-03-10 17:51:06 -07:00
Andrew Kelley ed8ee3ddd3 slightly better error name when wasm compilation fails 2024-03-10 17:51:06 -07:00
Andrew Kelley 6b84c8e04c zig std: implement tar format 2024-03-10 17:51:06 -07:00
Andrew Kelley c427685a13 zig std: implement sources.tar endpoint
except for the tar format being correct
2024-03-10 17:51:06 -07:00
Andrew Kelley b7ba0b69b1 std.io.Writer: add writeFile method 2024-03-10 17:51:06 -07:00
Andrew Kelley 574b33e65a zig std: use threads for the http server 2024-03-10 17:51:06 -07:00
Andrew Kelley c7c7ad1b78 zig std: implement serving the wasm binary 2024-03-10 17:51:06 -07:00
Andrew Kelley 34faf9d12e add skeleton of zig std command impl 2024-03-10 17:51:06 -07:00
Andrew Kelley 33f3443243 add zig std subcommand 2024-03-10 17:51:06 -07:00
Andrew Kelley 0b1b3f0225 upstream new autodocs implementation 2024-03-10 17:51:06 -07:00
Andrew Kelley 356e653f9b better to use AST than ZIR for doc generation 2024-03-10 17:51:05 -07:00
Andrew Kelley 94daf87335 no 2024-03-10 17:50:54 -07:00
Andrew Kelley 83e578a181 Merge pull request #19163 from ianic/zlib_no_lookahead
compress.zlib: don't overshoot underlying reader
2024-03-07 18:46:47 -08:00
Andrew Kelley 97aa5f7b8a Merge pull request #19190 from mlugg/struct-equivalence
compiler: namespace type equivalence based on AST node + captures
2024-03-07 18:41:45 -08:00
Andrew Kelley 90c1a2c41a Merge pull request #19152 from antlilja/llvm-broken-debug
LLVM: Fail to emit if LLVM encounters broken debug info
2024-03-02 21:43:39 -08:00
Andrew Kelley 33de937fd9 move zig objcopy command to be lazily built
part of #19063
2024-03-02 21:22:45 -08:00
Andrew Kelley 671c2acf47 Merge pull request #19094 from truemedian/std-http-fields
std.http: fix http field parsing
2024-03-02 14:34:43 -08:00
Andrew Kelley 64f77f32df Merge pull request #19136 from squeek502/windows-symlink-path-sep
Fix symLink's handling of `/` path separators on Windows
2024-03-01 17:45:33 -08:00
Andrew Kelley af06584241 Merge pull request #19126 from ianic/tar_case_sensitive
std.tar: fix unconditional error return
2024-02-29 10:12:39 -08:00
Andrew Kelley 5c0766b6c8 Merge pull request #19127 from ziglang/export-symbol-names-cache-hash
add missing export symbol names to whole mode wasm cache hash
2024-02-29 02:09:17 -08:00
Andrew Kelley 3e292e5fc1 Merge pull request #19128 from ziglang/tar
std.tar: avoid dependency on file system
2024-02-29 00:30:34 -08:00
Andrew Kelley 83d2eef3e0 build.zig: fix typo in extension exclusion list
we've been shipping these test files for a while now. oops.
2024-02-28 22:37:11 -07:00
Andrew Kelley f7d095d372 use hash.addListOfBytes where applicable 2024-02-28 20:38:24 -07:00
Andrew Kelley 30688f33a4 add missing export symbol names to whole mode wasm cache hash
Fixes false positive cache hit.
2024-02-28 20:38:24 -07:00
Andrew Kelley beca85e644 std.tar.iterator: make the buffers configurable
Provides more API flexibility and correctness, while still preserving
the handy high level `pipeToFileSystem` API.
2024-02-28 20:33:29 -07:00
Andrew Kelley b3ad45f267 std.tar: avoid dependency on file system
In the iterator function which is the low-level API, don't depend on
`std.fs.MAX_PATH_BYTES` because this is not defined on all operating
systems, such as freestanding.

However in such environments it still makes sense to be able to extract
from a tar file.

An even more flexible solution would be to accept the buffers as
arguments to iterator() which I think is a good idea, but for now let's
just set the same upper limmit across all operating systems.
2024-02-28 20:14:21 -07:00
Andrew Kelley f5aad47287 Merge pull request #19122 from ziglang/lazy-aro
make aro-based translate-c lazily built from source
2024-02-28 18:21:30 -08:00
Andrew Kelley 49437d34e6 zig fmt: off in the generated files 2024-02-28 13:21:05 -07:00
Andrew Kelley 240d0b68f6 make aro-based translate-c lazily built from source
Part of #19063.

Primarily, this moves Aro from deps/ to lib/compiler/ so that it can be
lazily compiled from source. src/aro_translate_c.zig is moved to
lib/compiler/aro_translate_c.zig and some of Zig CLI logic moved to a
main() function there.

aro_translate_c.zig becomes the "common" import for clang-based
translate-c.

Not all of the compiler was able to be detangled from Aro, however, so
it still, for now, remains being compiled with the main compiler
sources due to the clang-based translate-c depending on it. Once
aro-based translate-c achieves feature parity with the clang-based
translate-c implementation, the clang-based one can be removed from Zig.

Aro made it unnecessarily difficult to depend on with these .def files
and all these Zig module requirements. I looked at the .def files and
made these observations:

- The canonical source is llvm .def files.
- Therefore there is an update process to sync with llvm that involves
  regenerating the .def files in Aro.
- Therefore you might as well just regenerate the .zig files directly
  and check those into Aro.
- Also with a small amount of tinkering, the file size on disk of these
  generated .zig files can be made many times smaller, without
  compromising type safety in the usage of the data.

This would make things much easier on Zig as downstream project,
particularly we could remove those pesky stubs when bootstrapping.

I have gone ahead with these changes since they unblock me and I will
have a chat with Vexu to see what he thinks.
2024-02-28 13:21:05 -07:00
Andrew Kelley 9410b11ca6 Merge pull request #19114 from ziglang/lazy-resinator
move `zig libc` command to be lazily built
2024-02-28 11:34:45 -08:00
Andrew Kelley a1b083b666 Merge pull request #19120 from jacobly0/os-cleanup
posix: fix socket fd leak
2024-02-28 05:51:15 -08:00