28 Commits
Author SHA1 Message Date
Matthew Lugg f6751410e9 build: run some tests with -flegalize-all
It's useful to run both a little-endian and a big-endian target here,
because some legalizations are susceptible to endianness bugs, e.g. any
related to bitwise operations or to `packed` (aka `bitpack`) types.

When modifying legalizations or adding new ones, they can be tested by
running `zig build test-modules -Donly-legalize` to limit to the targets
which pass `-flegalize-all`.

This makes it much easier to facilitate external contributions towards
https://codeberg.org/ziglang/zig/issues/36719, and will prevent
legalization passes from bit-rotting in the future.
2026-10-26 14:17:03 +00:00
Alex Rønne Petersen 9092424fc3 make -ffunction-sections and -fdata-sections resolved config options
In preparation for giving them defaults that depend on the target and backend.
2026-10-26 11:02:42 +01:00
Andrew Kelley c3cdf48407 Configuration: store unlazy dependencies differently
steps are many; unlazy dependencies are few
2026-10-15 16:37:06 -07:00
Andrew Kelley 2c18bccf44 std.Build: lazy dependencies can associate with steps
and serialize the configuration
2026-10-15 16:00:57 -07:00
Jacob Young 11958a306f test: implement new runner 2026-09-26 19:08:50 -04:00
Andrew Kelley b844605c52 build system: translate-c supports arbitrary c flags
closes #35568
2026-09-22 08:57:25 +02:00
Andrew Kelley 177e62218e std.Build.Serialize: serialize step extended data
before calculating capacity for appending steps
2026-09-19 19:08:25 +02:00
Andrew Kelley c106e27595 std.Build.Step.Options: add addOptionPathDirectory
Now, when adding an option that is a file path, one must explicitly
choose between:
* `addOptionPath` (must be a file)
* `addOptionPathDirectory` (must be a directory)
* `addOptionPathUntracked` (opt out of dependency tracking)

closes #35766
2026-09-17 21:04:22 -07:00
Brandon Black 5ede6a167e Build.Step.Options: addOptionPathUntracked
This interface is like `addOptionPath`, but does not assume that
the provided `LazyPath` represents a generated file, and does not
set up any further dependencies on whatever the path represents.

This supports use-cases like setting an `.install_prefix` -based
default directory path option for the application to use as a
fallback when the user does not provide an override.  Example:

    options.addOptionPathUntracked(
        "DefaultConfigDir",
        b.graph.path(
            .install_prefix,
            b.pathJoin(&.{ "etc", "myapp" }),
        ),
    );
2026-09-18 04:31:03 +02:00
Andrew Kelley d142f63f89 std.Build.Cache: fix adding files
no longer adding unwanted padding bytes
2026-09-16 13:12:47 -07:00
lg 39512c3e55 compiler: add support for patchable functions 2026-09-16 19:21:21 +02:00
Pavel Verigo 7051f8e73b wasm: add --growable-table 2026-08-18 17:43:59 +02:00
Andrew Kelley 5d7cf3f34d zig build: revert package related changes to Configuration
partial revert of 8e48a5c524
partial revert of 8380531aec

fixes regression in the build system causing crash when trying to build
ffmpeg project from the ecosystem.

upon closer inspection, I don't think this is the right direction for
adding this data to Configuration. Let's try again and be a little more
careful about it.
2026-08-14 12:40:19 +02:00
Andrew Kelley e0f7e43a54 build system: rework user input options
followups from 8e48a5c524 along with
other related changes.

- user input options should not be serialized into Configuration.
- more helpful log messages when invalid -D arguments are provided
- use array hash maps in various places, simplifying iteration and
  sorting.
- when creating a package instance, sort the user input options once,
  before the lookup, rather than creating a fresh hash map and sorting
  it on every call to hash (wtf!)
  - when sorting, don't use ascii case insensitivity (wtf!!)
- simplify the detection of invalid arguments passed to zig build
- use package hash rather than file system path in package instance key
2026-08-13 23:40:03 -07:00
Andrew Kelley 896945d8dd std.Build.Serialize: better array awareness 2026-08-13 23:40:03 -07:00
Andrew Kelley 396ddd4443 std.Build.Serialize: use block to limit var scope 2026-08-13 23:40:03 -07:00
Andrew Kelley e82505d5dc std.Build.Configuration: rename PackageInstance to Package.Instance 2026-08-13 23:40:03 -07:00
hemisputnik e98205bd17 std.Build.Configuration: serialize package instance public modules 2026-08-10 11:20:46 +03:00
hemisputnik 3d50222f9b std.Build.Configuration: reintroduce serialization of std.Build instances 2026-08-10 11:20:19 +03:00
hemisputnik af6ee1a799 std.Build.Serialize: use addDeduped instead of addExtra for package deps 2026-08-09 15:25:13 +03:00
hemisputnik 92b04c5b6c std.Build.Serialize: use array hash map index trick for package_map 2026-08-09 15:25:12 +03:00
Andrew Kelley 8380531aec Merge pull request 'Serialize packages and root dependencies into configuration file' (#36419) from hemisputnik/zig:work/36387-configuration-deps into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36419
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-08-08 21:48:00 +02:00
hemisputnik 0f332fd536 std.Build.Configuration: serialize packages and their dependencies
The serializer now traverses the builder's available_deps and their
dependencies recursively, and serializes them into Configuration.packages.
2026-08-08 09:02:31 +03:00
Andrew Kelley 127e2d8088 ability to forward third party integration arguments to child processes
This provides a way to forward, e.g. the `-fqemu` argument from
`zig build` to a child process during Maker execution without providing
the information to the configuration logic.
2026-08-07 11:19:55 -07:00
Techatrix cbf00af868 std.Build: remove unused libc flag from compile step
Whether libc and libcpp need to be linked is resolved on the maker side
in `Maker/Step/Compile.zig`.
2026-08-06 19:54:20 +02:00
Techatrix 988613be67 std.Build.Configuration: improve storage of preopens in run steps 2026-08-04 19:48:09 +02:00
Justus Klausecker 69a26976ed zig fmt
Converts usages of `@intFromEnum` and `@enumFromInt` to instead use the
new `@backingInt` and `@fromBackingInt` builtins.
2026-07-17 23:30:26 +02:00
Andrew Kelley 8923dd4ca2 move main configurer logic to std.Build.Serialize 2026-07-01 14:15:31 -07:00