2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 12:35:04 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-02-05 19:39:04 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
introduce std.Build.Module and extract some logic into it
This moves many settings from `std.Build.Step.Compile` and into
`std.Build.Module`, and then makes them transitive.
In other words, it adds support for exposing Zig modules in packages,
which are configured in various ways, such as depending on other link
objects, include paths, or even a different optimization mode.
Now, transitive dependencies will be included in the compilation, so you
can, for example, make a Zig module depend on some C source code, and
expose that Zig module in a package.
Currently, the compiler frontend autogenerates only one
`@import("builtin")` module for the entire compilation, however, a
future enhancement will be to make it honor the differences in modules,
so that modules can be compiled with different optimization modes, code
model, valgrind integration, or even target CPU feature set.
closes #14719
2023-11-28 22:47:34 -07:00
|
|
|
|
2024-07-09 18:17:27 -07:00
|
|
|
|
2024-07-23 21:17:14 -07:00
|
|
|
|
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-07-10 09:18:10 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-16 01:32:43 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-13 13:10:20 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-06-20 12:12:20 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-05-24 22:25:17 +01:00
|
|
|
|
2023-03-03 20:39:40 -07:00
|
|
|
|
2023-08-11 12:19:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-02-01 17:40:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-06 01:52:47 +02:00
|
|
|
|
|
|
|
|
|
2024-02-01 17:40:36 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-02-03 17:22:31 -07:00
|
|
|
|
2023-10-22 16:10:01 +02:00
|
|
|
|
|
|
|
|
|
2024-09-11 09:06:54 +01:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
|
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
|
|
|
|
|
2025-01-17 20:53:30 +01:00
|
|
|
|
|
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-02 22:32:21 +01:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2024-07-24 17:41:44 -07:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-11 16:26:04 -07:00
|
|
|
|
2024-09-02 22:32:21 +01:00
|
|
|
|
std.Build: revert --host-target, --host-cpu, --host-dynamic-linker
This is a partial revert of 105db13536b4dc2affe130cb8d2eee6c97c89bcd.
As we learned from Void Linux packaging, these options are not actually
helpful since the distribution package manager may very well want to
cross-compile the packages that it is building.
So, let's not overcomplicate things. There are already the standard
options: -Dtarget, -Dcpu, and -Ddynamic-linker.
These options are generally provided when the project generates machine
code artifacts, however, there may be a project that does no such thing,
in which case it makes sense for these options to be missing. The Zig
Build System is a general-purpose build system, after all.
2024-04-17 17:57:03 -07:00
|
|
|
|
|
|
|
|
|
2024-07-14 22:27:51 -07:00
|
|
|
|
2024-07-22 16:03:11 -07:00
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2024-10-14 22:57:12 -07:00
|
|
|
|
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-07-10 09:18:10 +01:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-03 17:22:31 -07:00
|
|
|
|
2023-10-19 22:36:11 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-23 11:25:41 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
|
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-16 01:32:43 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-02-13 13:10:20 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-11 09:06:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
zig build: many enhancements related to parallel building
Rework std.Build.Step to have an `owner: *Build` field. This
simplified the implementation of installation steps, as well as provided
some much-needed common API for the new parallelized build system.
--verbose is now defined very concretely: it prints to stderr just
before spawning a child process.
Child process execution is updated to conform to the new
parallel-friendly make() function semantics.
DRY up the failWithCacheError handling code. It now integrates properly
with the step graph instead of incorrectly dumping to stderr and calling
process exit.
In the main CLI, fix `zig fmt` crash when there are no errors and stdin
is used.
Deleted steps:
* EmulatableRunStep - this entire thing can be removed in favor of a
flag added to std.Build.RunStep called `skip_foreign_checks`.
* LogStep - this doesn't really fit with a multi-threaded build runner
and is effectively superseded by the new build summary output.
build runner:
* add -fsummary and -fno-summary to override the default behavior,
which is to print a summary if any of the build steps fail.
* print the dep prefix when emitting error messages for steps.
std.Build.FmtStep:
* This step now supports exclude paths as well as a check flag.
* The check flag decides between two modes, modify mode, and check
mode. These can be used to update source files in place, or to fail
the build, respectively.
Zig's own build.zig:
* The `test-fmt` step will do all the `zig fmt` checking that we expect
to be done. Since the `test` step depends on this one, we can simply
remove the explicit call to `zig fmt` in the CI.
* The new `fmt` step will actually perform `zig fmt` and update source
files in place.
std.Build.RunStep:
* expose max_stdio_size is a field (previously an unchangeable
hard-coded value).
* rework the API. Instead of configuring each stream independently,
there is a `stdio` field where you can choose between
`infer_from_args`, `inherit`, or `check`. These determine whether the
RunStep is considered to have side-effects or not. The previous
field, `condition` is gone.
* when stdio mode is set to `check` there is a slice of any number of
checks to make, which include things like exit code, stderr matching,
or stdout matching.
* remove the ill-defined `print` field.
* when adding an output arg, it takes the opportunity to give itself a
better name.
* The flag `skip_foreign_checks` is added. If this is true, a RunStep
which is configured to check the output of the executed binary will
not fail the build if the binary cannot be executed due to being for
a foreign binary to the host system which is running the build graph.
Command-line arguments such as -fqemu and -fwasmtime may affect
whether a binary is detected as foreign, as well as system
configuration such as Rosetta (macOS) and binfmt_misc (Linux).
- This makes EmulatableRunStep no longer needed.
* Fix the child process handling to properly integrate with the new
bulid API and to avoid deadlocks in stdout/stderr streams by polling
if necessary.
std.Build.RemoveDirStep now uses the open build_root directory handle
instead of an absolute path.
2023-03-01 22:56:37 -07:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
zig build: many enhancements related to parallel building
Rework std.Build.Step to have an `owner: *Build` field. This
simplified the implementation of installation steps, as well as provided
some much-needed common API for the new parallelized build system.
--verbose is now defined very concretely: it prints to stderr just
before spawning a child process.
Child process execution is updated to conform to the new
parallel-friendly make() function semantics.
DRY up the failWithCacheError handling code. It now integrates properly
with the step graph instead of incorrectly dumping to stderr and calling
process exit.
In the main CLI, fix `zig fmt` crash when there are no errors and stdin
is used.
Deleted steps:
* EmulatableRunStep - this entire thing can be removed in favor of a
flag added to std.Build.RunStep called `skip_foreign_checks`.
* LogStep - this doesn't really fit with a multi-threaded build runner
and is effectively superseded by the new build summary output.
build runner:
* add -fsummary and -fno-summary to override the default behavior,
which is to print a summary if any of the build steps fail.
* print the dep prefix when emitting error messages for steps.
std.Build.FmtStep:
* This step now supports exclude paths as well as a check flag.
* The check flag decides between two modes, modify mode, and check
mode. These can be used to update source files in place, or to fail
the build, respectively.
Zig's own build.zig:
* The `test-fmt` step will do all the `zig fmt` checking that we expect
to be done. Since the `test` step depends on this one, we can simply
remove the explicit call to `zig fmt` in the CI.
* The new `fmt` step will actually perform `zig fmt` and update source
files in place.
std.Build.RunStep:
* expose max_stdio_size is a field (previously an unchangeable
hard-coded value).
* rework the API. Instead of configuring each stream independently,
there is a `stdio` field where you can choose between
`infer_from_args`, `inherit`, or `check`. These determine whether the
RunStep is considered to have side-effects or not. The previous
field, `condition` is gone.
* when stdio mode is set to `check` there is a slice of any number of
checks to make, which include things like exit code, stderr matching,
or stdout matching.
* remove the ill-defined `print` field.
* when adding an output arg, it takes the opportunity to give itself a
better name.
* The flag `skip_foreign_checks` is added. If this is true, a RunStep
which is configured to check the output of the executed binary will
not fail the build if the binary cannot be executed due to being for
a foreign binary to the host system which is running the build graph.
Command-line arguments such as -fqemu and -fwasmtime may affect
whether a binary is detected as foreign, as well as system
configuration such as Rosetta (macOS) and binfmt_misc (Linux).
- This makes EmulatableRunStep no longer needed.
* Fix the child process handling to properly integrate with the new
bulid API and to avoid deadlocks in stdout/stderr streams by polling
if necessary.
std.Build.RemoveDirStep now uses the open build_root directory handle
instead of an absolute path.
2023-03-01 22:56:37 -07:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-16 01:32:43 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-13 13:10:20 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-17 22:25:40 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-24 22:25:17 +01:00
|
|
|
|
2023-03-03 20:39:40 -07:00
|
|
|
|
2024-02-01 17:40:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-06 01:52:47 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-09-11 09:06:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-02-13 13:10:20 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
2023-03-09 21:16:53 -07:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 14:25:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 13:25:56 +01:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2025-03-24 13:25:56 +01:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 13:22:08 +01:00
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 00:01:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 00:14:25 +01:00
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2025-03-24 00:14:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 00:01:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-23 22:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2023-03-09 21:16:53 -07:00
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-03-09 21:16:53 -07:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-09 21:16:53 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-01-18 21:31:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
2023-02-21 18:39:22 +01:00
|
|
|
|
2024-02-18 20:34:32 -08:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
Add preliminary support for Windows .manifest files
An embedded manifest file is really just XML data embedded as a RT_MANIFEST resource (ID = 24). Typically, the Windows-only 'Manifest Tool' (`mt.exe`) is used to embed manifest files, and `mt.exe` also seems to perform some transformation of the manifest data before embedding, but in testing it doesn't seem like the transformations are necessary to get the intended result.
So, to handle embedding manifest files, Zig now takes the following approach:
- Generate a .rc file with the contents `1 24 "path-to-manifest.manifest"`
- Compile that generated .rc file into a .res file
- Link the .res file into the final binary
This effectively achieves the same thing as `mt.exe` minus the validation/transformations of the XML data that it performs.
How this is used:
On the command line:
```
zig build-exe main.zig main.manifest
```
(on the command line, specifying a .manifest file when the target object format is not COFF is an error)
or in build.zig:
```
const exe = b.addExecutable(.{
.name = "manifest-test",
.root_source_file = .{ .path = "main.zig" },
.target = target,
.optimize = optimize,
.win32_manifest = .{ .path = "main.manifest" },
});
```
(in build.zig, the manifest file is ignored if the target object format is not COFF)
Note: Currently, only one manifest file can be specified per compilation. This is because the ID of the manifest resource is currently always 1. Specifying multiple manifests could be supported if a way for the user to specify an ID for each manifest is added (manifest IDs must be a u16).
Closes #17406
options
2023-10-09 04:06:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2024-06-18 23:49:21 +05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2024-07-11 16:26:04 -07:00
|
|
|
|
Add preliminary support for Windows .manifest files
An embedded manifest file is really just XML data embedded as a RT_MANIFEST resource (ID = 24). Typically, the Windows-only 'Manifest Tool' (`mt.exe`) is used to embed manifest files, and `mt.exe` also seems to perform some transformation of the manifest data before embedding, but in testing it doesn't seem like the transformations are necessary to get the intended result.
So, to handle embedding manifest files, Zig now takes the following approach:
- Generate a .rc file with the contents `1 24 "path-to-manifest.manifest"`
- Compile that generated .rc file into a .res file
- Link the .res file into the final binary
This effectively achieves the same thing as `mt.exe` minus the validation/transformations of the XML data that it performs.
How this is used:
On the command line:
```
zig build-exe main.zig main.manifest
```
(on the command line, specifying a .manifest file when the target object format is not COFF is an error)
or in build.zig:
```
const exe = b.addExecutable(.{
.name = "manifest-test",
.root_source_file = .{ .path = "main.zig" },
.target = target,
.optimize = optimize,
.win32_manifest = .{ .path = "main.manifest" },
});
```
(in build.zig, the manifest file is ignored if the target object format is not COFF)
Note: Currently, only one manifest file can be specified per compilation. This is because the ID of the manifest resource is currently always 1. Specifying multiple manifests could be supported if a way for the user to specify an ID for each manifest is added (manifest IDs must be a u16).
Closes #17406
options
2023-10-09 04:06:28 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2024-06-18 23:49:21 +05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2024-07-11 16:26:04 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std.Build: add `addLibrary` function (#22554)
Acts as a replacement for `addSharedLibrary` and `addStaticLibrary`, but
linking mode can be changed more easily in build.zig, for example:
In library:
```zig
const linkage = b.option(std.builtin.LinkMode, "linkage", "Link mode for a foo_bar library") orelse .static; // or other default
const lib = b.addLibrary(.{
.linkage = linkage,
.name = "foo_bar",
.root_module = mod,
});
```
In consumer:
```zig
const dep_foo_bar = b.dependency("foo_bar", .{
.target = target,
.optimize = optimize,
.linkage = .static // or dynamic
});
mod.linkLibrary(dep_foor_bar.artifact("foo_bar"));
```
It also matches nicely with `linkLibrary` name.
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2025-01-22 07:29:21 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2024-02-25 14:04:06 +01:00
|
|
|
|
std.Build: extend `test_runner` option to specify whether runner uses `std.zig.Server`
The previous logic here was trying to assume that custom test runners
never used `std.zig.Server` to communicate with the build runner;
however, it was flawed, because modifying the `test_runner` field on
`Step.Compile` would not update this flag. That might have been
intentional (allowing a way for the user to specify a custom test runner
which *does* use the compiler server protocol), but if so, it was a
flawed API, since it was too easy to update one field without updating
the other.
Instead, bundle these two pieces of state into a new type
`std.Build.Step.Compile.TestRunner`. When passing a custom test runner,
you are now *provided* to specify whether it is a "simple" runner, or
whether it uses the compiler server protocol.
This is a breaking change, but is unlikely to affect many people, since
custom test runners are seldom used in the wild.
2025-01-10 10:48:52 +00:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
2025-04-20 17:54:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-03-21 14:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2024-06-18 23:49:21 +05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-04-20 17:54:11 +01:00
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2025-03-05 03:17:54 +00:00
|
|
|
|
2023-04-10 18:09:39 -07:00
|
|
|
|
2023-04-13 16:44:28 -07:00
|
|
|
|
|
|
|
|
|
2024-07-11 16:26:04 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-19 10:49:34 +02:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-09 13:39:34 -05:00
|
|
|
|
zig build: add an OOM-prevention system
The problem is that one may execute too many subprocesses concurrently
that, together, exceed an RSS value that causes the OOM killer to kill
something problematic such as the window manager. Or worse, nothing, and
the system freezes.
This is a real world problem. For example when building LLVM a simple
`ninja install` will bring your system to its knees if you don't know
that you should add `-DLLVM_PARALLEL_LINK_JOBS=1`.
In particular: compiling the zig std lib tests takes about 2G each,
which at 16x at once (8 cores + hyperthreading) is using all 32GB of my
RAM, causing the OOM killer to kill my window manager
The idea here is that you can annotate steps that might use a high
amount of system resources with an upper bound. So for example I could
mark the std lib tests as having an upper bound peak RSS of 3 GiB.
Then the build system will do 2 things:
1. ulimit the child process, so that it will fail if it would exceed
that memory limit.
2. Notice how much system RAM is available and avoid running too many
concurrent jobs at once that would total more than that.
This implements (1) not with an operating system enforced limit, but by
checking the maxrss after a child process exits.
However it does implement (2) correctly.
The available memory used by the build system defaults to the total
system memory, regardless of whether it is used by other processes at
the time of spawning the build runner. This value can be overridden with
the new --maxrss flag to `zig build`. This mechanism will ensure that
the sum total of upper bound RSS memory of concurrent tasks will not
exceed this value.
This system makes it so that project maintainers can annotate
problematic subprocesses, avoiding bug reports from users, who can
blissfully execute `zig build` without worrying about the project's
internals.
Nobody's computer crashes, and the build system uses as much parallelism
as possible without risking OOM. Users do not need to unnecessarily
resort to -j1 when the build system can figure this out for them.
2023-03-06 00:20:11 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-03-03 16:17:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
introduce std.Build.Module and extract some logic into it
This moves many settings from `std.Build.Step.Compile` and into
`std.Build.Module`, and then makes them transitive.
In other words, it adds support for exposing Zig modules in packages,
which are configured in various ways, such as depending on other link
objects, include paths, or even a different optimization mode.
Now, transitive dependencies will be included in the compilation, so you
can, for example, make a Zig module depend on some C source code, and
expose that Zig module in a package.
Currently, the compiler frontend autogenerates only one
`@import("builtin")` module for the entire compilation, however, a
future enhancement will be to make it honor the differences in modules,
so that modules can be compiled with different optimization modes, code
model, valgrind integration, or even target CPU feature set.
closes #14719
2023-11-28 22:47:34 -07:00
|
|
|
|
|
|
|
|
|
2023-03-03 16:17:23 -07:00
|
|
|
|
|
|
|
|
|
2023-02-03 17:22:31 -07:00
|
|
|
|
|
|
|
|
|
2023-03-03 16:17:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
introduce std.Build.Module and extract some logic into it
This moves many settings from `std.Build.Step.Compile` and into
`std.Build.Module`, and then makes them transitive.
In other words, it adds support for exposing Zig modules in packages,
which are configured in various ways, such as depending on other link
objects, include paths, or even a different optimization mode.
Now, transitive dependencies will be included in the compilation, so you
can, for example, make a Zig module depend on some C source code, and
expose that Zig module in a package.
Currently, the compiler frontend autogenerates only one
`@import("builtin")` module for the entire compilation, however, a
future enhancement will be to make it honor the differences in modules,
so that modules can be compiled with different optimization modes, code
model, valgrind integration, or even target CPU feature set.
closes #14719
2023-11-28 22:47:34 -07:00
|
|
|
|
|
|
|
|
|
2023-02-03 17:22:31 -07:00
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-05 16:44:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-13 05:46:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-23 20:49:00 -07:00
|
|
|
|
2024-04-13 15:30:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-05 16:44:03 -07:00
|
|
|
|
std.Build: extend `test_runner` option to specify whether runner uses `std.zig.Server`
The previous logic here was trying to assume that custom test runners
never used `std.zig.Server` to communicate with the build runner;
however, it was flawed, because modifying the `test_runner` field on
`Step.Compile` would not update this flag. That might have been
intentional (allowing a way for the user to specify a custom test runner
which *does* use the compiler server protocol), but if so, it was a
flawed API, since it was too easy to update one field without updating
the other.
Instead, bundle these two pieces of state into a new type
`std.Build.Step.Compile.TestRunner`. When passing a custom test runner,
you are now *provided* to specify whether it is a "simple" runner, or
whether it uses the compiler server protocol.
This is a breaking change, but is unlikely to affect many people, since
custom test runners are seldom used in the wild.
2025-01-10 10:48:52 +00:00
|
|
|
|
|
|
|
|
|
2024-04-13 15:30:03 +02:00
|
|
|
|
|
|
|
|
|
2023-02-05 16:44:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-04 22:44:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-05-24 14:26:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-22 16:10:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-11 09:06:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-07-09 21:47:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-09 21:08:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-06-16 04:42:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-07-14 19:48:08 -07:00
|
|
|
|
|
|
|
|
|
2024-03-19 12:46:38 +01:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-07-05 13:05:56 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-01-18 21:31:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
zig build: many enhancements related to parallel building
Rework std.Build.Step to have an `owner: *Build` field. This
simplified the implementation of installation steps, as well as provided
some much-needed common API for the new parallelized build system.
--verbose is now defined very concretely: it prints to stderr just
before spawning a child process.
Child process execution is updated to conform to the new
parallel-friendly make() function semantics.
DRY up the failWithCacheError handling code. It now integrates properly
with the step graph instead of incorrectly dumping to stderr and calling
process exit.
In the main CLI, fix `zig fmt` crash when there are no errors and stdin
is used.
Deleted steps:
* EmulatableRunStep - this entire thing can be removed in favor of a
flag added to std.Build.RunStep called `skip_foreign_checks`.
* LogStep - this doesn't really fit with a multi-threaded build runner
and is effectively superseded by the new build summary output.
build runner:
* add -fsummary and -fno-summary to override the default behavior,
which is to print a summary if any of the build steps fail.
* print the dep prefix when emitting error messages for steps.
std.Build.FmtStep:
* This step now supports exclude paths as well as a check flag.
* The check flag decides between two modes, modify mode, and check
mode. These can be used to update source files in place, or to fail
the build, respectively.
Zig's own build.zig:
* The `test-fmt` step will do all the `zig fmt` checking that we expect
to be done. Since the `test` step depends on this one, we can simply
remove the explicit call to `zig fmt` in the CI.
* The new `fmt` step will actually perform `zig fmt` and update source
files in place.
std.Build.RunStep:
* expose max_stdio_size is a field (previously an unchangeable
hard-coded value).
* rework the API. Instead of configuring each stream independently,
there is a `stdio` field where you can choose between
`infer_from_args`, `inherit`, or `check`. These determine whether the
RunStep is considered to have side-effects or not. The previous
field, `condition` is gone.
* when stdio mode is set to `check` there is a slice of any number of
checks to make, which include things like exit code, stderr matching,
or stdout matching.
* remove the ill-defined `print` field.
* when adding an output arg, it takes the opportunity to give itself a
better name.
* The flag `skip_foreign_checks` is added. If this is true, a RunStep
which is configured to check the output of the executed binary will
not fail the build if the binary cannot be executed due to being for
a foreign binary to the host system which is running the build graph.
Command-line arguments such as -fqemu and -fwasmtime may affect
whether a binary is detected as foreign, as well as system
configuration such as Rosetta (macOS) and binfmt_misc (Linux).
- This makes EmulatableRunStep no longer needed.
* Fix the child process handling to properly integrate with the new
bulid API and to avoid deadlocks in stdout/stderr streams by polling
if necessary.
std.Build.RemoveDirStep now uses the open build_root directory handle
instead of an absolute path.
2023-03-01 22:56:37 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-03-10 13:03:40 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-09 13:39:34 -05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 22:43:41 -07:00
|
|
|
|
2024-02-01 20:17:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 12:35:04 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-13 21:08:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2024-02-13 21:08:13 +01:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-13 21:08:13 +01:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-12-04 20:30:32 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-24 08:11:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-01-24 08:11:16 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-01-24 08:11:16 +01:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2023-12-04 20:30:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 20:30:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-12-04 20:30:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-12-04 20:30:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2025-06-27 20:05:22 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
|
|
|
|
|
2023-05-16 20:00:47 -07:00
|
|
|
|
2024-06-06 06:02:42 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2025-07-31 21:54:07 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-02-14 02:53:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-28 17:15:06 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-07-19 10:49:34 +02:00
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-03-10 12:17:33 +01:00
|
|
|
|
2024-03-02 23:32:44 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-03-10 12:17:33 +01:00
|
|
|
|
2024-03-02 23:32:44 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-03-10 12:17:33 +01:00
|
|
|
|
2024-03-02 23:32:44 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-03-10 12:17:33 +01:00
|
|
|
|
2024-03-02 23:32:44 +01:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-07-19 10:49:34 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-03-06 22:44:36 -07:00
|
|
|
|
|
|
|
|
|
2023-07-19 10:49:34 +02:00
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-06 22:44:36 -07:00
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-07-30 18:19:39 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-07-30 18:19:39 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 07:08:12 +02:00
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-06-18 07:08:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-26 00:17:56 +05:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 07:08:12 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-04 18:05:40 -07:00
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
2024-06-18 07:08:12 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
2024-06-18 07:08:12 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-19 22:36:11 +02:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-23 11:25:41 -07:00
|
|
|
|
2023-10-19 22:36:11 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-23 11:25:41 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-08-23 21:46:36 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-08-27 21:20:18 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-22 18:46:56 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-22 18:46:56 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-14 02:53:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-19 22:36:11 +02:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-02-28 17:15:06 -07:00
|
|
|
|
2023-02-14 02:53:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-19 22:36:11 +02:00
|
|
|
|
2023-02-14 02:53:05 -07:00
|
|
|
|
2023-02-28 17:15:06 -07:00
|
|
|
|
2023-02-14 02:53:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-03 17:22:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
2023-10-22 16:10:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-11 09:06:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
|
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-02 20:35:14 -07:00
|
|
|
|
build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
and not fetched.
Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.
The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.
std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:
When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.
The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 14:42:29 -07:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-13 00:02:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
2024-02-13 00:02:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-18 03:07:44 -07:00
|
|
|
|
2024-02-13 00:02:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-10 00:25:42 +03:00
|
|
|
|
2024-02-13 00:02:52 +01:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-17 17:51:16 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
package manager: write deps in a flat format, eliminating the FQN concept
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-13 10:46:25 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2023-04-22 18:15:19 +01:00
|
|
|
|
|
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-02-09 10:01:01 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-02-18 19:56:34 +01:00
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2023-01-31 14:02:32 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-04-22 18:15:19 +01:00
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2023-08-10 15:32:55 -07:00
|
|
|
|
|
|
|
|
|
2024-09-27 09:44:44 -06:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-28 02:35:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-22 03:26:11 +01:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-13 12:01:59 -04:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2025-05-22 03:26:11 +01:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2025-06-13 12:01:59 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-13 12:01:59 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-19 10:49:34 +02:00
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2024-07-31 22:54:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-31 22:54:05 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-31 22:54:05 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
2024-07-31 22:54:05 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-31 22:54:05 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
2023-02-14 13:12:47 -07:00
|
|
|
|
|
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-18 00:43:33 +02:00
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2024-07-09 23:14:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
2023-02-14 12:47:45 -07:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
2025-06-13 12:01:59 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
|
|
|
|
|
2024-04-11 14:02:47 -07:00
|
|
|
|
2024-04-09 18:23:48 -07:00
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-05 00:58:48 +02:00
|
|
|
|
2024-05-04 15:12:24 -04:00
|
|
|
|
2023-09-17 19:38:19 +02:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
|
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-27 21:20:18 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
build/LazyPath: Add dirname (#18371)
Adds a variant to the LazyPath union representing a parent directory
of a generated path.
```zig
const LazyPath = union(enum) {
generated_dirname: struct {
generated: *const GeneratedFile,
up: usize,
},
// ...
}
```
These can be constructed with the new method:
```zig
pub fn dirname(self: LazyPath) LazyPath
```
For the cases where the LazyPath is already known
(`.path`, `.cwd_relative`, and `dependency`)
this is evaluated right away.
For dirnames of generated files and their dirnames,
this is evaluated at getPath time.
dirname calls can be chained, but for safety,
they are not allowed to escape outside a root
defined for each case:
- path: This is relative to the build root,
so dirname can't escape outside the build root.
- generated: Can't escape the zig-cache.
- cwd_relative: This can be a relative or absolute path.
If relative, can't escape the current directory,
and if absolute, can't go beyond root (/).
- dependency: Can't escape the dependency's root directory.
Testing:
I've included a standalone case for many of the happy cases.
I couldn't find an easy way to test the negatives, though,
because tests cannot yet expect panics.
2024-01-04 15:47:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-27 21:20:18 -07:00
|
|
|
|
|
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
2025-07-02 11:16:20 -07:00
|
|
|
|
2023-07-29 23:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2024-05-04 14:29:17 -04:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-06 22:44:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-19 17:39:55 -07:00
|
|
|
|
2023-03-06 22:44:36 -07:00
|
|
|
|
2023-03-18 18:32:43 -07:00
|
|
|
|
2023-03-06 22:44:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 12:35:04 -07:00
|
|
|
|
2023-12-05 16:09:07 -07:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 12:35:04 -07:00
|
|
|
|
2024-02-01 19:22:05 -07:00
|
|
|
|
std.Build: revert --host-target, --host-cpu, --host-dynamic-linker
This is a partial revert of 105db13536b4dc2affe130cb8d2eee6c97c89bcd.
As we learned from Void Linux packaging, these options are not actually
helpful since the distribution package manager may very well want to
cross-compile the packages that it is building.
So, let's not overcomplicate things. There are already the standard
options: -Dtarget, -Dcpu, and -Ddynamic-linker.
These options are generally provided when the project generates machine
code artifacts, however, there may be a project that does no such thing,
in which case it makes sense for these options to be missing. The Zig
Build System is a general-purpose build system, after all.
2024-04-17 17:57:03 -07:00
|
|
|
|
|
|
|
|
|
2024-02-01 19:22:05 -07:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
2023-12-05 16:09:07 -07:00
|
|
|
|
2023-12-04 15:26:57 -07:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 12:35:04 -07:00
|
|
|
|
zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.
The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.
* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
`std.Build.Module.addCMacro` is provided.
- remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
- use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
- use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
Along with other fields, those unspecified options will be inherited
from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
to get the host target.
2023-12-02 21:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 23:04:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 15:44:44 -07:00
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 23:04:23 -07:00
|
|
|
|
2024-01-31 22:02:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|
2023-10-21 19:30:45 -04:00
|
|
|
|
2023-05-03 11:49:55 +03:00
|
|
|
|
2023-01-31 00:19:51 -07:00
|
|
|
|