Commit Graph
28621 Commits
Author SHA1 Message Date
Igor Anić c974e19816 docs: make docs work with recent tar changes
It is no longer need to call skip if file content is not consumed. It is
handled internally now. File types are now same as in os.File.
2024-03-11 13:30:26 +01:00
Igor Anić 0cca7e732e std.tar: fix broken public interface 2024-03-11 12:25:51 +01:00
Igor Anić c4868b2bbc std.tar: use doctest
Make std.tar look better in docs. Remove from public interface what is
not necessary. Add comment to the public methods. Add doctest as usage
examples for iterator and pipeToFileSystem.
2024-03-11 12:25:03 +01:00
Igor Anić a9e7abda20 std.tar: fix test hanging on windows
Problem was manifested only on windows with target `-target
aarch64-windows-gnu`.

I was creating new files but not closing any of them. Tmp dir cleanup
hangs looping in deleteTree forever.
2024-03-11 12:24:11 +01:00
Igor Anić 8ec990d6d7 disable test which is hanging on windows in ci
When this test is enabled something like:
`zig build test docs --zig-lib-dir .\lib\ -Dstatic-llvm -Dskip-non-native -Denable-symlinks-windows`
never finishes.

Those are failed runs from ci:
https://github.com/ziglang/zig/actions/runs/8137710393
https://github.com/ziglang/zig/actions/runs/8129619923
https://github.com/ziglang/zig/actions/runs/8125845128

Isolating that test and running it is not a problem. Running something
like `zig test .\lib\std\std.zig  --zig-lib-dir .\lib\` is fine.
2024-03-11 12:24:11 +01:00
Igor Anić 8cc35a0255 std.tar: fix path testing on windows
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After #19136 dir.symlink changes path separtors to \ on windows.
2024-03-11 12:24:11 +01:00
Igor Anić 67336ca8c6 std.tar: fix build on 32 bit platform
Fixing error from ci:

std/tar.zig:423:54: error: expected type 'usize', found 'u64'
std/tar.zig:423:54: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
2024-03-11 12:24:11 +01:00
Igor Anić f5fd4691e5 std.tar: document iterator interface with example 2024-03-11 12:24:06 +01:00
Igor Anić 614161a7cf std.tar make iterator interface more ergonomic
for the then end users:

1. Don't require user to call file.skip() on file returned from
iterator.next if file is not read. Iterator will now handle this.
Previously that returned header parsing error, without knowing some tar
internals it is hard to understand what is required from user.

2. Use iterator.File.kind enum which is similar to fs.File.Kind,
something familiar. Internal Header.Kind has many types which are not
exposed but the user needs to have else in kind switch to cover those
cases.

3. Add reader interface to the iterator.File.
2024-03-11 12:22:12 +01:00
Igor Anić 5ccbb196ad std.tar: don't return in iterator init
Don't assert min buffer size on iterator init. That was changing public
interface. This way we don't break that interface.
2024-03-11 12:22:12 +01:00
Igor Anić 10add7c677 std.tar: remove redundant test name prefixes 2024-03-11 12:22:12 +01:00
Igor Anić 04e8bbd932 std.tar: test buffers provided to the iterator
Tar header stores name in max 256 bytes and link name in max 100 bytes.
Those are minimums for provided buffers. Error is raised during iterator
init if buffers are not long enough.

Pax and gnu extensions can store longer names. If such extension is
reached during unpack and don't fit into provided buffer error is
returned.
2024-03-11 12:22:12 +01:00
Igor Anić af0502f6c4 std.tar: add tests for file and symlink create
Should do that before I broke package manager!
2024-03-11 12:22:00 +01:00
Andrew Kelley d0c06ca712 Merge pull request #19208 from ziglang/rework-autodoc
Redesign How Autodoc Works
2024-03-11 01:37:50 -07:00
Frank Denis eaca8626b2 std.crypto.pcurves fixes (#19245)
Fixes compilation errors in functions that are syntaxic sugar
to operate on serialized scalars.

Also make it explicit that square roots in fields whose size is
not congruent to 3 modulo 4 are not an error, they are just
not implemented yet.

Reported by @vitalonodo - Thanks!
2024-03-11 09:00:15 +01: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
Techatrix 40e64245fc std: expose Config struct of GeneralPurposeAllocator 2024-03-10 14:08:02 -07:00
Jakub Konka c1bda06c14 Merge pull request #19225 from ziglang/elf-aarch64
elf: port aarch64 support from zld
2024-03-10 15:32:58 +01:00
Jakub Konka 1a6b2e84ac test/link/elf: remove pie hack due to QEMU bug that is now fixed 2024-03-10 10:39:31 +01:00
Minsoo Choo 4ba4f94c93 CI: update actions/checkout to v4 (#19228) 2024-03-09 16:37:57 -05:00
Jakub Konka 2cdbad6f10 elf+aarch64: handle PREL64 reloc 2024-03-09 19:34:34 +01:00
Jakub Konka b7b63855d0 test/link/elf: enable tests for aarch64 cpu arch 2024-03-09 19:26:26 +01:00
Jakub Konka 229468b7a9 elf+aarch64: fix 32bit build 2024-03-09 18:55:52 +01:00
mlugg e2cbbd0c26 Sema: perform codegen for anon decl created by @extern
This fixes a bug where, at least with the LLVM backend, `@extern` calls
which had the same name as a normal `extern` in the same Zcu would
result in the `@extern` incorrectly suffixing the identifier `.2`.
Usually, the LLVM backend has a system to change the generated globals
to "collapse" them all together, but it only works if `updateDecl` is
called!
2024-03-09 04:52:06 +00:00
Matthew Lugg 9cf28d1e9b Merge pull request #19214 from mlugg/fuck-usingnamespace
std: fuck usingnamespace
2024-03-08 21:59:07 +00:00
Jakub Konka 859f9a22c4 elf+aarch64: implement basic thunk support 2024-03-08 22:46:18 +01:00