Commit graph

34557 commits

Author SHA1 Message Date
Alex Rønne Petersen
ba7cc72c47
std.Target: bump watchos min version to 8.0.0 2025-08-03 20:08:19 +02:00
Alex Rønne Petersen
71722df4ab
std.Target: bump driverkit min version to 20.0.0 2025-08-03 20:08:07 +02:00
Alex Rønne Petersen
e9093b8d18
std.Target: bump max versions for Apple targets 2025-08-03 20:05:21 +02:00
Alex Rønne Petersen
5b74d33471
std.Target: bump amdhsa max version to 6.4.2 2025-08-03 20:00:32 +02:00
Alex Rønne Petersen
afe458e9b6
std.Target: bump vulkan max version to 1.4.321 2025-08-03 19:59:46 +02:00
Alex Rønne Petersen
7f2140710f
std.Target: bump cuda max version to 12.9.1 2025-08-03 19:59:46 +02:00
Alex Rønne Petersen
39b653c5e7
std.Target: bump freebsd max version to 14.3.0 2025-08-03 19:59:43 +02:00
Alex Rønne Petersen
af3baee5ca
std.Target: bump linux max version to 6.16.0 2025-08-03 19:59:40 +02:00
Alex Rønne Petersen
1808ecfa04
std.Target: bump fuchsia max version to 27.0.0 2025-08-03 19:59:35 +02:00
Alex Rønne Petersen
765825b802
ci: bump riscv64-linux timeout from 6 hours to 7 hours
GitHub is apparently very bad at arithmetic and so will cancel jobs that pass
the 5 hours mark, even if they're nowhere near the 6 hours timeout. So add an
hour to assist GitHub in this very difficult task.
2025-08-03 16:46:15 +02:00
Justus Klausecker
7c35070b90 zig fmt: apply new cast builtin order 2025-08-03 14:59:56 +02:00
Justus Klausecker
81219493f8 zig fmt: canonicalize nested cast builtin order 2025-08-03 14:54:00 +02:00
Ali Cheraghi
246e1de554
Watch: do not fail when file is removed
before this we would get a crash
2025-08-03 13:16:49 +03:30
Alex Rønne Petersen
a5f891d0b3
Merge pull request #24562 from h57624paen/fix-win-spawn-double-normalize
std.process.Child: fix double path normalization in spawnWindows
2025-08-03 11:19:10 +02:00
Alex Rønne Petersen
fa445d86a1
ci: target baseline instead of spacemit_x60 on riscv64-linux
Doesn't seem to make much of a difference anyway, and LLVM 20 appears to still
have some miscompilations with vector and bitmanip extensions enabled.
2025-08-03 11:05:04 +02:00
Matthew Lugg
c80aa9f719
Merge pull request #22997 from Rexicon226/align-0-reify
sema: compile error on reifying align(0) fields and pointers
2025-08-03 09:58:23 +01:00
Ali Cheraghi
58b9200106
spirv: use packed struct's backing int type for shift value 2025-08-03 12:10:23 +03:30
DialecticalMaterialist
616e69c807 OpenGL SPIR-V support
The support was already there but somebody forgot to allow to use the
calling conventions spirv_fragment and spirv_vertex when having opengl
as os tag.
2025-08-03 10:39:07 +02:00
David Rubin
4d1010d36c llvm: correctly lower double_integer for rv32 2025-08-03 10:22:26 +02:00
Ali Cheraghi
d15a7b1b21
spirv: move more type emitting functions to Module 2025-08-03 04:54:28 +03:30
David Rubin
e82d67233b
disallow alignment on packed union fields 2025-08-02 09:51:26 -07:00
mlugg
e98aeeb73f std.Build: keep compiler alive under -fincremental --webui
Previously, this only applied when using `-fincremental --watch`, but
`--webui` makes the build runner stay alive just like `--watch` does, so
the same logic applies here. Without this, attempting to perform
incremental updates with `--webui` performs full rebuilds. (I did test
that before merging the PR, but at that time I was passing `--watch`
too -- which has since been disallowed -- so I missed that it doesn't
work as expected without that option!)
2025-08-02 08:56:19 +01:00
Alex Rønne Petersen
239efa7e67
Merge branch 'riscv-ci' 2025-08-02 09:41:04 +02:00
Alex Rønne Petersen
bab0de92b7
ci: re-renable riscv64-linux-debug and riscv64-linux-release for master 2025-08-02 09:39:56 +02:00
Alex Rønne Petersen
4ec232a346
ci: set riscv64-linux timeouts to 6 hours 2025-08-02 09:37:53 +02:00
Alex Rønne Petersen
930c6ca49d
ci: don't run test-standalone on riscv64-linux 2025-08-02 09:34:55 +02:00
Alex Rønne Petersen
a0e58501af
ci: use -Dskip-compile-errors on riscv64-linux 2025-08-02 09:34:55 +02:00
Alex Rønne Petersen
bcaae562d6
build: add -Dskip-compile-errors option
Skips tests in test/cases/compile_errors.
2025-08-02 09:34:55 +02:00
Alex Rønne Petersen
761857e3f9
ci: temporarily disable test-link on riscv64-linux
https://github.com/ziglang/zig/issues/24663
2025-08-02 09:34:53 +02:00
Ali Cheraghi
5525a90a47
spirv: remove deduplication ISel 2025-08-02 08:56:39 +03:30
mlugg
abf1795337 std.Build.Watch: add macOS implementation based on FSEventStream
Resolves: #21905
2025-08-02 05:13:13 +01:00
Ali Cheraghi
31de2c873f
spirv: refactor 2025-08-02 04:16:01 +03:30
Andrew Kelley
742956865c
Merge pull request #24614 from ziglang/flate
std.compress.flate: rework decompression and delete compression
2025-08-01 16:34:43 -07:00
mlugg
dcc3e6e1dd build system: replace fuzzing UI with build UI, add time report
This commit replaces the "fuzzer" UI, previously accessed with the
`--fuzz` and `--port` flags, with a more interesting web UI which allows
more interactions with the Zig build system. Most notably, it allows
accessing the data emitted by a new "time report" system, which allows
users to see which parts of Zig programs take the longest to compile.

The option to expose the web UI is `--webui`. By default, it will listen
on `[::1]` on a random port, but any IPv6 or IPv4 address can be
specified with e.g. `--webui=[::1]:8000` or `--webui=127.0.0.1:8000`.
The options `--fuzz` and `--time-report` both imply `--webui` if not
given. Currently, `--webui` is incompatible with `--watch`; specifying
both will cause `zig build` to exit with a fatal error.

When the web UI is enabled, the build runner spawns the web server as
soon as the configure phase completes. The frontend code consists of one
HTML file, one JavaScript file, two CSS files, and a few Zig source
files which are built into a WASM blob on-demand -- this is all very
similar to the old fuzzer UI. Also inherited from the fuzzer UI is that
the build system communicates with web clients over a WebSocket
connection.

When the build finishes, if `--webui` was passed (i.e. if the web server
is running), the build runner does not terminate; it continues running
to serve web requests, allowing interactive control of the build system.

In the web interface is an overall "status" indicating whether a build
is currently running, and also a list of all steps in this build. There
are visual indicators (colors and spinners) for in-progress, succeeded,
and failed steps. There is a "Rebuild" button which will cause the build
system to reset the state of every step (note that this does not affect
caching) and evaluate the step graph again.

If `--time-report` is passed to `zig build`, a new section of the
interface becomes visible, which associates every build step with a
"time report". For most steps, this is just a simple "time taken" value.
However, for `Compile` steps, the compiler communicates with the build
system to provide it with much more interesting information: time taken
for various pipeline phases, with a per-declaration and per-file
breakdown, sorted by slowest declarations/files first. This feature is
still in its early stages: the data can be a little tricky to
understand, and there is no way to, for instance, sort by different
properties, or filter to certain files. However, it has already given us
some interesting statistics, and can be useful for spotting, for
instance, particularly complex and slow compile-time logic.
Additionally, if a compilation uses LLVM, its time report includes the
"LLVM pass timing" information, which was previously accessible with the
(now removed) `-ftime-report` compiler flag.

To make time reports more useful, ZIR and compilation caches are ignored
by the Zig compiler when they are enabled -- in other words, `Compile`
steps *always* run, even if their result should be cached. This means
that the flag can be used to analyze a project's compile time without
having to repeatedly clear cache directory, for instance. However, when
using `-fincremental`, updates other than the first will only show you
the statistics for what changed on that particular update. Notably, this
gives us a fairly nice way to see exactly which declarations were
re-analyzed by an incremental update.

If `--fuzz` is passed to `zig build`, another section of the web
interface becomes visible, this time exposing the fuzzer. This is quite
similar to the fuzzer UI this commit replaces, with only a few cosmetic
tweaks. The interface is closer than before to supporting multiple fuzz
steps at a time (in line with the overall strategy for this build UI,
the goal will be for all of the fuzz steps to be accessible in the same
interface), but still doesn't actually support it. The fuzzer UI looks
quite different under the hood: as a result, various bugs are fixed,
although other bugs remain. For instance, viewing the source code of any
file other than the root of the main module is completely broken (as on
master) due to some bogus file-to-module assignment logic in the fuzzer
UI.

Implementation notes:

* The `lib/build-web/` directory holds the client side of the web UI.

* The general server logic is in `std.Build.WebServer`.

* Fuzzing-specific logic is in `std.Build.Fuzz`.

* `std.Build.abi` is the new home of `std.Build.Fuzz.abi`, since it now
  relates to the build system web UI in general.

* The build runner now has an **actual** general-purpose allocator,
  because thanks to `--watch` and `--webui`, the process can be
  arbitrarily long-lived. The gpa is `std.heap.DebugAllocator`, but the
  arena remains backed by `std.heap.page_allocator` for efficiency. I
  fixed several crashes caused by conflation of `gpa` and `arena` in the
  build runner and `std.Build`, but there may still be some I have
  missed.

* The I/O logic in `std.Build.WebServer` is pretty gnarly; there are a
  *lot* of threads involved. I anticipate this situation improving
  significantly once the `std.Io` interface (with concurrency support)
  is introduced.
2025-08-01 23:48:21 +01:00
David Rubin
5678a600ff
refactor reifyUnion alignment handling 2025-08-01 14:57:16 -07:00
David Rubin
d6c74a95fd
remove usages of .alignment = 0 2025-08-01 14:57:16 -07:00
David Rubin
17330867eb
Sema: compile error on reifying align(0) struct fields 2025-08-01 14:57:16 -07:00
Alex Rønne Petersen
a00edbd52d
Merge pull request #24640 from alexrp/glibc-2.42
glibc 2.42
2025-08-01 19:17:56 +02:00
Andrew Kelley
a6f7927764 std.compress.flate.Decompress: use 64 buffered bits
will have to find out why usize doesn't work for 32 bit targets some
other time
2025-08-01 09:04:27 -07:00
Alex Rønne Petersen
675b1a15a1
glibc: update crt0 code to 2.42 2025-08-01 09:00:27 +02:00
Andrew Kelley
eb17d4562a std.Io.Writer.Hashed: fix bad assert 2025-07-31 22:36:52 -07:00
Ian Johnson
d91744401f fetch: More Git fixes 2025-07-31 22:10:11 -07:00
Andrew Kelley
64814dc986 std.compress.flate.Decompress: respect stream limit 2025-07-31 22:10:11 -07:00
Andrew Kelley
6caa100f0d std.Io.Writer: fix wrong return value from fixedDrain 2025-07-31 22:10:11 -07:00
Andrew Kelley
a7808892f7 std.compress.flate.Decompress: be in indirect or direct mode
depending on whether buffered
2025-07-31 22:10:11 -07:00
Andrew Kelley
6eac56caf7 std.compress.flate.Decompress: allow users to swap out Writer 2025-07-31 22:10:11 -07:00
Andrew Kelley
2024abda6a std.debug.Dwarf: work around API deficiency
need to supply a big enough buffer when working with decompression
2025-07-31 22:10:11 -07:00
Andrew Kelley
95273337c5 fetch: remove checksum logic and fix new I/O API bugs
Thanks Ian Johnson for finding these
2025-07-31 22:10:11 -07:00
Andrew Kelley
c9ff068391 std.compress: fix discard impl and flate error detection 2025-07-31 22:10:11 -07:00
Andrew Kelley
165cd87c12 std.Io.Reader: don't set end to zero
because it may be used as a ring buffer
2025-07-31 22:10:11 -07:00