Commit Graph
28964 Commits
Author SHA1 Message Date
Ian Johnson 6dcbad780c Autodoc: fix Markdown indented lists (#19577)
Previously, indentation was not being handled correctly in some cases,
causing examples such as `std.json.WriteStream` to be rendered with
improper list nesting.

Additionally, some more test cases have been added to ensure
indentation (or lack of indentation) is handled correctly in some other
constructs.
2024-04-08 09:49:22 +00:00
Andrew Kelley 355cceebc7 Merge pull request #18920 from castholm/fmtId
`std.zig.fmtId`: conditionally escape primitives/`_` (breaking)
2024-04-07 19:22:35 -07:00
Andrew Kelley 1b27146792 Merge pull request #18590 from castholm/move-standalone-test-cases
std.Build: Remove `anonymousDependency`
2024-04-07 16:08:23 -07:00
Carl Åstholm e5bf1a5d50 Make std.Build.dependencyInner private 2024-04-07 16:06:20 -07:00
Carl Åstholm ef90d3af54 Remove std.Build.anonymousDependency 2024-04-07 16:06:19 -07:00
Carl Åstholm 09f1bbe11b std.Build: Remove unused c_std field
This field has not been referenced by compile steps since
e76ce2c1d0, all the way back in 2019.
To specify the language standard, pass `-std=[value]` as a regular
C flag instead.
2024-04-07 16:06:15 -07:00
Carl Åstholm 5d5e89aa8d Promote linker test cases to packages 2024-04-07 16:05:54 -07:00
Carl Åstholm 33b8fdb6bc Turn "simple" standalone test cases into a package 2024-04-07 16:05:54 -07:00
Carl Åstholm c3ecc6972e Don't add standalone test cases until we've built stage3 2024-04-07 16:05:54 -07:00
Carl Åstholm d6ecfa7025 Move "simple" standalone test cases to a new directory 2024-04-07 16:05:54 -07:00
Carl Åstholm 3ed221f149 Promote standalone test cases to packages
This is a prerequisite for removing `b.anonymousDependency()`, but
having compiler tests dogfood package management might be a good idea
in general.
2024-04-07 16:05:53 -07:00
Carl Åstholm 05126fc4c5 std.Build: add dependencyFromBuildZig 2024-04-07 15:54:30 -07:00
Andrew Kelley e204a6edb8 Merge pull request #18988 from castholm/lazy-build-zig
std.Build: add `lazyImport` (`@import` for lazy dependencies)
2024-04-07 15:43:54 -07:00
Carl Åstholm 278db0ad45 Sema: support coercing ref to anonymous array init to many-pointer 2024-04-07 15:10:49 -07:00
Andrew Kelley fdd6c31e8b Merge pull request #19167 from castholm/installHeader
std.Build: fix `Compile.installHeader` behavior, add `WriteFile.addCopyDirectory`
2024-04-07 15:07:00 -07:00
Andrew Kelley c78f996ff9 langref: update async functions section 2024-04-07 14:13:03 -07:00
Carl Åstholm 2465c328aa Use @TypeOf instead of std.meta in test_runner.zig
This might fix a CI failure for powerpc64le-linux-musl.
2024-04-07 21:16:29 +02:00
Carl Åstholm eee5400b7d Account for dependency boundaries when duping headers
This is a temporary workaround that can be revered if/when 'path'
lazy paths are updated to encode which build root they are relative to.
2024-04-07 15:34:47 +02:00
Carl Åstholm d99e44a157 Document added/updated functions
Also renames `addHeaders` to `addHeadersDirectory` for clarity.
2024-04-07 15:34:47 +02:00
Carl Åstholm 5af4e91e00 Oops, forgot to dupe installations in installLibraryHeaders
Added test coverage for `installLibraryHeaders`
2024-04-07 15:34:47 +02:00
Carl Åstholm 7b1a6a93a4 Fix install_headers test on macOS (and possibly Linux) 2024-04-07 15:34:47 +02:00
Carl Åstholm 8ce3a8b604 WriteFile.addCopyDirectory should include all files by default 2024-04-07 15:34:47 +02:00
Carl ÅstholmandAbhinav Gupta 27c8f895eb Add standalone tests for Compile.installHeaders
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
2024-04-07 15:34:47 +02:00
Carl Åstholm e16db29887 Implement WriteFile.addCopyDirectory 2024-04-07 15:34:47 +02:00
Carl Åstholm 2c7be4f8dd Create an include tree of installed headers for dependent modules 2024-04-07 15:34:46 +02:00
Carl Åstholm ce71eb31da Update addInstallHeaderFile to take a LazyPath 2024-04-07 15:34:46 +02:00
Carl Åstholm ff0bec60b7 Remove dest_builder field from InstallDir/File
This is no longer needed after the installed headers refactoring.
2024-04-07 15:34:46 +02:00
Carl Åstholm 0b7123f41d std.Build: correct behavior of Step.Compile.installHeader
Previously, `Step.Compile.installHeader` and friends would incorrectly
modify the default `install` top-level step, when the intent was for
headers to get bundled with and installed alongside an artifact. This
change set implements the intended behavior.

This carries with it some breaking changes; `installHeader` and
`installConfigHeader` both have new signatures, and
`installHeadersDirectory` and `installHeadersDirectoryOptions` have been
merged into `installHeaders`.
2024-04-07 15:32:44 +02:00
Carl Åstholm b381fb805c std.Build: add lazyImport (@import for lazy dependencies) 2024-04-07 15:30:19 +02:00
Carl Åstholm 9181ecd951 Sema: fix runtime call of inline fn with comptime-known comptime-only ret type 2024-04-07 15:07:55 +02:00
Carl Åstholm 4c393c7468 Update usages of fmtId/isValidId
`{}` for decls
`{p}` for enum fields
`{p_}` for struct fields and in contexts following a `.`

Elsewhere, `{p}` was used since it's equivalent to the old behavior.
2024-04-07 14:47:11 +02:00
Carl Åstholm d8e7eda5f4 std.zig.fmtId: conditionally escape primitives/_
This is a breaking change.

This updates `std.zig.fmtId` to support conditionally escaping
primitives and the reserved `_` identifier via format specifiers:

- `{}`: escape invalid identifiers, identifiers that shadow primitives
  and the reserved `_` identifier.
- `{p}`: same as `{}`, but don't escape identifiers that
  shadow primitives.
- `{_}`: same as `{}`, but don't escape the reserved `_` identifier.
- `{p_}` or `{_p}`: only escape invalid identifiers.

(The idea is that `p`/`_` mean "allow primitives/underscores".)

Any other format specifiers will result in compile errors.

Additionally, `isValidId` now considers `_` a valid identifier. If this
distinction is important, consider combining existing uses of this
function with the new `isUnderscore` function.
2024-04-07 14:47:10 +02:00
Ian Johnson 129de47a71 Fix first-time package fetches
Closes #19557
Closes #19561

Previously, `build.zig` was not being detected correctly by
`computeHash` for packages where there is a containing root directory.
2024-04-07 09:07:37 +02:00
Jakub Konka 96bc8f17cf lib/std/macho: update PLATFORM enum with VISIONOS tags 2024-04-06 22:21:57 +02:00
Andrew Kelley f45ba7d0c1 Merge pull request #19562 from Snektron/spirv-remove-cache
spirv: remove cache
2024-04-06 13:03:22 -07:00
Jacob Young f668c8bfd6 x86_64: fix abi of nested structs 2024-04-06 13:02:55 -07:00
Igor Anić 34bb670bb6 package manager: set executable bit
Based on file content. Detects elf magic header or shebang line.

Executable bit is ignored in hash calculation, as it was before this. So
packages hashes are not changed.

Reference:
https://github.com/ziglang/zig/issues/17463#issuecomment-1984798880

Fixes: 17463

Test is here:
https://github.com/ianic/zig-fetch-test/blob/7c4600d7bb263f9b72fe3d0b70071f42be89e25c/src/main.zig#L307
(if #19500 got accepted I'll move this test to the Fetch.zig)
2024-04-06 13:00:57 -07:00
Jacob Young 4a8121c1ab Sema: fix non-pub usingnamespace in @typeInfo 2024-04-06 12:57:51 -07:00
Jacob Young 4e85536604 Builder: fix encoding big integers in bitcode
Closes #19543
2024-04-06 12:53:09 -07:00
Josh Wolfe 9ab6d91067 zig std accepts --port and --no-open-browser (#19559) 2024-04-06 15:18:43 -04:00
antlilja 637b1d606d LLVM Builder: Emit binary op optional flags for exact and no wrap 2024-04-06 14:57:46 -04:00
Robin Voetter ac16545895 spirv: enable passing tests 2024-04-06 13:52:48 +02:00
Robin Voetter cbf2ee72e3 spirv: fix some recursive pointers edge cases in dedup pass 2024-04-06 13:37:41 +02:00
Robin Voetter 125d3324d9 spirv: add link progression 2024-04-06 13:37:41 +02:00
Robin Voetter 3e388faecd spirv: yeet cache 2024-04-06 13:37:40 +02:00
Robin Voetter ef638502d4 spirv: remove cache usage from assembler 2024-04-06 13:37:40 +02:00
Robin Voetter 97a67762ba spirv: remove cache usage for types 2024-04-06 13:37:39 +02:00
Robin Voetter 188922a544 spirv: remove cache usage for constants 2024-04-06 13:37:39 +02:00
Robin Voetter 42c7e752e1 spirv: id range helper
This allows us to more sanely allocate a continuous
range of result-ids, and avoids a bunch of nasty
casting code in a few places. Its currently not used
very often, but will be useful in the future.
2024-04-06 13:37:37 +02:00
Robin Voetter 3942083806 Merge pull request #18984 from alichraghi/vector
spirv: implement `@divFloor`, `@floor`, `@mod` and `@mulWithOverflow`
2024-04-06 13:37:25 +02:00