aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2023-09-23std.testing: expectEqualDeep() - support self-referential structstravisstaloch
2023-09-22build: add --skip-oom-stepskcbanner
Specifying this argument causes steps that specify a max_rss that exceeds the total max_rss value of the runner to be skipped, instead of failing.
2023-09-22Added basic support for wasm32-emscripten targetAven Bross
2023-09-22Merge pull request #17069 from squeek502/resinatorAndrew Kelley
Add a `.rc` -> `.res` compiler to the Zig compiler
2023-09-20autodoc: show more doc comments for namespaces and typesLoris Cro
previously, in the container view (the type of view that you see when you look at `std` for example), when listing types and namespaces, we would only show doc comments places on the direct child decl, which in the case of the `std` namespace, for example, it's just a bunch of re-exports. now, if we don't find a direct doc comment, we chase indirection and display doc comments placed directly on the definition, if any. this is the precise priority order: ``` /// 1 pub const Foo = _Foo; /// 2 const _Foo = struct { //! 3 }; ``` The numbers show the priority order for autodoc.
2023-09-19update libcxx to latest LLVM release/17.xAndrew Kelley
upstream commit 0176e8729ea4a2cff1ec6689c7620a9f37ce9904
2023-09-19nvptx: omit sm_90a from the CPU target features for nowAndrew Kelley
There seems to be an LLVM bug with this feature. Since it's new, let's collect more information before adding it.
2023-09-19skip regressed LLVM 17 std lib test on powerpcAndrew Kelley
Tracked by #16951
2023-09-19libcxx: update for llvm 17.0.0rc3Andrew Kelley
2023-09-19compiler_rt: fix arm hard-float f16 abiJacob Young
Closes #16848
2023-09-19compiler_rt: fight off `@as` invasionJacob Young
Importantly, fixes incorrectly annotated types in `__aeabi_?2h`.
2023-09-19compiler_rt: fix fp sub being optimized to call itselfJacob Young
Closes #16844 Reduces #16846
2023-09-19start: workaround for LLVM 17 regressionJacob Young
Tracking issue #16799
2023-09-19libcxx: update to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8 This adds the flag `-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL`. A future enhancement could possibly pass something different if there is a compelling parallel implementation. That libdispatch one might be worth looking into.
2023-09-19libcxxabi: update to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19libunwind: update to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19LLVM 17 std lib updates and fixesAndrew Kelley
* some manual fixes to generated CPU features code. in the future it would be nice to make the script do those automatically. I suspect the sm_90a thing is a bug in LLVM. * add liteos to various target OS switches. I know nothing about this OS; someone will need to work specifically on support for this OS when the time comes to support it properly in zig. * while waiting for the compiler, I went ahead and made more conservative choices about when to use `inline` in std/Target.zig
2023-09-19update C language headers to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19update CPU features to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19update for LLVM 17 new target dataAndrew Kelley
New OSs: * UEFI * LiteOS New ABI: * OpenHOS Also update the LLD driver API wrappers.
2023-09-19write function types consistently with a space before `fn` keywordr00ster91
Currently, the compiler (like @typeName) writes it `fn(...) Type` but zig fmt writes it `fn (...) Type` (notice the space after `fn`). This inconsistency is now resolved and function types are consistently written the zig fmt way. Before this there were more `fn (...) Type` occurrences than `fn(...) Type` already.
2023-09-18std: math.absInt: update docs to use fabs for floatsMeghan Denny
2023-09-18Return error.WouldBlock when connect returns .WSAEWOULDBLOCKDaniel Guzman
2023-09-18std.zig.c_translation.zig: fix L suffix with sized intsBanacial
Closes #15066
2023-09-18wasi: update `sock_recv` and `sock_send` according to preview1nikneym
2023-09-17Make `std.os.getenv` always a compile error on WindowsRyan Liptak
The _environ variable that is populated when linking libc on Windows does not support Unicode keys/values (or, at least, the encoding is not necessarily UTF-8). So, for Unicode support, _wenviron would need to be used instead. However, this means that the keys/values would be encoded as UTF-16, so they would need to be converted to UTF-8 before being returned by `os.getenv`. This would require allocation which is not part of the `os.getenv` API, so `os.getenv` is not implementable on Windows even when linking libc. Closes https://github.com/ziglang/zig/issues/8456
2023-09-17autodoc: split json payload per fieldLoris Cro
this will make s3 re-enable compression for the stdlib's autodoc and improve loading times (and data usage) for users alongside this commit the deploy script for the official website is also being updated
2023-09-17autodoc: rename the doctest section in the frontend to 'Usage Examples'Loris Cro
2023-09-17rc compilation: Use MSVC includes if present, fallback to mingwRyan Liptak
The include directories used when preprocessing .rc files are now separate from the target, and by default will use the system MSVC include paths if the MSVC + Windows SDK are present, otherwise it will fall back to the MinGW includes distributed with Zig. This default behavior can be overridden by the `-rcincludes` option (possible values: any (the default), msvc, gnu, or none). This behavior is useful because Windows resource files may `#include` files that only exist with in the MSVC include dirs (e.g. in `<MSVC install directory>/atlmfc/include` which can contain other .rc files, images, icons, cursors, etc). So, by defaulting to the `any` behavior (MSVC if present, MinGW fallback), users will by default get behavior that is most-likely-to-work. It also should be okay that the include directories used when compiling .rc files differ from the include directories used when compiling the main binary, since the .res format is not dependent on anything ABI-related. The only relevant differences would be things like `#define` constants being different values in the MinGW headers vs the MSVC headers, but any such differences would likely be a MinGW bug.
2023-09-17addWin32ResourceFile: Ignore the resource file if the target object format ↵Ryan Liptak
is not coff
2023-09-17Add a .rc -> .res compiler to the Zig compilerRyan Liptak
2023-09-17Merge pull request #16929 from truemedian/more-httpAndrew Kelley
std.http: handle Expect: 100-continue, improve redirect logic, add Client.fetch for simple requests
2023-09-16std: correct getcontext for Android bionic libcStephen Gutekanst
I have updated Felix's ZigAndroidTemplate to work with the latest version of Zig and we are exploring adding Android support to Mach engine. `std.c.getcontext` is _referenced_ but not _used_, and Android's bionic libc does not implement `getcontext`. `std.os.linux.getcontext` also cannot be used with bionic libc, so it seems prudent to just disable this extern for now. This may not be the perfect long-term fix, but I have a golden rebuttal to that: before I was unable to compile Zig applications for Android, and now I can. <img width="828" alt="image" src="https://github.com/hexops/mach/assets/3173176/1e29142b-0419-4459-9c8b-75d92f87f822"> Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-16autodoc: Implement various missing expressions in ex (#17129)Krzysztof Wolicki
Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-09-16autodoc: Implement builtin function rendering.Krzysztof Wolicki
Implement unary ops handling. Fix getType in main.js Minor cleanup of builtin function handling.
2023-09-16autodoc: Fix styling of the navbarKrzysztof Wolicki
2023-09-16autodoc: Remove unnecessary Expr tagKrzysztof Wolicki
2023-09-16autodoc: Handle `ref` ZIR instructionKrzysztof Wolicki
2023-09-15ErrorBundle: rename addBundle to addBundleAsNotes, add addBundleAsRootsRyan Liptak
2023-09-15ErrorBundle.addOtherSourceLocation: Fix source_line ending up as garbage ↵Ryan Liptak
when source_line is 0 The zero value needs special handling since it means 'no source line' and should be preserved through the copy.
2023-09-15Merge pull request #17156 from mlugg/destructureAndrew Kelley
compiler: implement destructuring syntax
2023-09-15package manager: write deps in a flat format, eliminating the FQN conceptmlugg
The new `@depedencies` module contains generated code like the following (where strings like "abc123" represent hashes): ```zig pub const root_deps = [_]struct { []const u8, []const u8 }{ .{ "foo", "abc123" }, }; pub const packages = struct { pub const abc123 = struct { pub const build_root = "/home/mlugg/.cache/zig/blah/abc123"; pub const build_zig = @import("abc123"); pub const deps = [_]struct { []const u8, []const u8 }{ .{ "bar", "abc123" }, .{ "name", "ghi789" }, }; }; }; ``` Each package contains a build root string, the build.zig import, and a mapping from dependency names to package hashes. There is also such a mapping for the root package dependencies. In theory, we could now remove the `dep_prefix` field from `std.Build`, since its main purpose is now handled differently. I believe this is a desirable goal, as it doesn't really make sense to assign a single FQN to any package (because it may appear in many different places in the package hierarchy). This commit does not remove that field, as it's used non-trivially in a few places in the build runner and compiler tests: this will be a future enhancement. Resolves: #16354 Resolves: #17135
2023-09-15compiler: implement destructuring syntaxmlugg
This change implements the following syntax into the compiler: ```zig const x: u32, var y, foo.bar = .{ 1, 2, 3 }; ``` A destructure expression may only appear within a block (i.e. not at comtainer scope). The LHS consists of a sequence of comma-separated var decls and/or lvalue expressions. The RHS is a normal expression. A new result location type, `destructure`, is used, which contains result pointers for each component of the destructure. This means that when the RHS is a more complicated expression, peer type resolution is not used: each result value is individually destructured and written to the result pointers. RLS is always used for destructure expressions, meaning every `const` on the LHS of such an expression creates a true stack allocation. Aside from anonymous array literals, Sema is capable of destructuring the following types: * Tuples * Arrays * Vectors A destructure may be prefixed with the `comptime` keyword, in which case the entire destructure is evaluated at comptime: this means all `var`s in the LHS are `comptime var`s, every lvalue expression is evaluated at comptime, and the RHS is evaluated at comptime. If every LHS is a `const`, this is not allowed: as with single declarations, the user should instead mark the RHS as `comptime`. There are a few subtleties in the grammar changes here. For one thing, if every LHS is an lvalue expression (rather than a var decl), a destructure is considered an expression. This makes, for instance, `if (cond) x, y = .{ 1, 2 };` valid Zig code. A destructure is allowed in almost every context where a standard assignment expression is permitted. The exception is `switch` prongs, which cannot be destructures as the comma is ambiguous with the end of the prong. A follow-up commit will begin utilizing this syntax in the Zig compiler. Resolves: #498
2023-09-15bpf: remove unhelpful "comptime" and fix union orderbfredl
Insn.st() can be used with dynamic size just like Insn.stx(), which is relevant in a code generation context. using ImmOrReg caused an error as its fields were ordered differently than Source.
2023-09-14std.math.log_int: implement integer logarithm without using float mathFederico Stra
2023-09-14ComptimeStringMap: Add version that takes an equality functionRyan Liptak
This will allow users to construct e.g. a ComptimeStringMap that uses case-insensitive ASCII comparison. Note: the previous ComptimeStringMap API is unchanged (i.e. this does not break any existing code).
2023-09-14std: add compile error when using `std.os.getenv` on the wasi targetRafael Fernández López
`std.process.getEnvMap` or `std.process.getEnvVarOwned` should be used instead, requiring allocation.
2023-09-14fs tests: Skip UNC path types in Dir.rename testsRyan Liptak
Follow up to https://github.com/ziglang/zig/pull/17136. The `Dir.rename files` test has now also been seen to fail in CI, so now all rename tests are skipped for the UNC path type. This is a heavy handed approach to hopefully get rid of any flakiness related to rename & UNC paths. See https://github.com/ziglang/zig/issues/17134
2023-09-13std.json: add fmt function (#17055)Jonathan Marler
Adds std.json.fmt which returns a std.fmt Formatter that formats any given value using std.json.stringify.
2023-09-13Merge pull request #17046 from tiehuis/improve-hash-testsAndrew Kelley
improve std/hash test coverage