Commit Graph

196 Commits

Author SHA1 Message Date
Jakub Konka 1e5075f812 lib/std/Build/Step/CheckObject: dump section as string 2024-04-15 18:06:44 +02:00
jd d23a8e83d4 std.Build.Step.ConfigHeader: better error message 2024-04-15 04:10:13 -07:00
Andrew Kelley a59ad719d2 std.Build.Step.ConfigHeader: better error message 2024-04-13 05:14:08 -07:00
Andrew Kelley 499a202a13 std.Build: revert the breaking changes only
The previous commit deleted the deprecated API and then made all the
follow-up changes; this commit reverts only the breaking API changes.
This commit can be reverted once 0.12.0 is tagged.
2024-04-11 14:09:58 -07:00
Andrew Kelley b30ad74908 remove deprecated LazyPath.path union tag 2024-04-11 14:02:47 -07:00
Andrew Kelley 7fb5a0b18b introduce std.Build.path; deprecate LazyPath.relative
This adds the *std.Build owner to LazyPath so that lazy paths returned
from a dependency can be used in the application without friction or
footguns.

closes #19313
2024-04-10 15:02:20 -07:00
Andrew Kelley 355cceebc7 Merge pull request #18920 from castholm/fmtId
`std.zig.fmtId`: conditionally escape primitives/`_` (breaking)
2024-04-07 19:22:35 -07:00
Carl Åstholm eee5400b7d Account for dependency boundaries when duping headers
This is a temporary workaround that can be revered if/when 'path'
lazy paths are updated to encode which build root they are relative to.
2024-04-07 15:34:47 +02:00
Carl Åstholm d99e44a157 Document added/updated functions
Also renames `addHeaders` to `addHeadersDirectory` for clarity.
2024-04-07 15:34:47 +02:00
Carl Åstholm 5af4e91e00 Oops, forgot to dupe installations in installLibraryHeaders
Added test coverage for `installLibraryHeaders`
2024-04-07 15:34:47 +02:00
Carl Åstholm 8ce3a8b604 WriteFile.addCopyDirectory should include all files by default 2024-04-07 15:34:47 +02:00
Carl Åstholm e16db29887 Implement WriteFile.addCopyDirectory 2024-04-07 15:34:47 +02:00
Carl Åstholm 2c7be4f8dd Create an include tree of installed headers for dependent modules 2024-04-07 15:34:46 +02:00
Carl Åstholm ff0bec60b7 Remove dest_builder field from InstallDir/File
This is no longer needed after the installed headers refactoring.
2024-04-07 15:34:46 +02:00
Carl Åstholm 0b7123f41d std.Build: correct behavior of Step.Compile.installHeader
Previously, `Step.Compile.installHeader` and friends would incorrectly
modify the default `install` top-level step, when the intent was for
headers to get bundled with and installed alongside an artifact. This
change set implements the intended behavior.

This carries with it some breaking changes; `installHeader` and
`installConfigHeader` both have new signatures, and
`installHeadersDirectory` and `installHeadersDirectoryOptions` have been
merged into `installHeaders`.
2024-04-07 15:32:44 +02:00
Carl Åstholm 4c393c7468 Update usages of fmtId/isValidId
`{}` for decls
`{p}` for enum fields
`{p_}` for struct fields and in contexts following a `.`

Elsewhere, `{p}` was used since it's equivalent to the old behavior.
2024-04-07 14:47:11 +02:00
Jacob Young eb723a4070 Update uses of @fieldParentPtr to use RLS 2024-03-30 20:50:48 -04:00
Jacob Young e409afb79b Update uses of @fieldParentPtr to pass a pointer type 2024-03-30 20:50:48 -04:00
Ryan Liptak 4e428415e5 Build.Step.Compile: Add mingw_unicode_entry_point field
Corresponds to the `-municode` CLI flag
2024-03-27 10:06:06 +00:00
Luis Cáceres 29e41c6850 std.Build: dupe provided paths for Step.Fmt.create() 2024-03-26 13:54:24 +02:00
Andrew Kelley c52a2c338d std.Build.Step.Run: documentation for addFileArg and friends
Someone on IRC got these functions mixed up, and it sure would have been
helpful to have these docs in the first place, eh?
2024-03-18 23:52:52 -07:00
Reokodoku 1206604262 Implementing structs and better enums in build options 2024-03-18 02:46:54 +00:00
Nguyễn Gia Phong f13401ac69 Fix stuttering stderr in Zig test log
Before this fix, the stderr FIFO was advanced by the length
of the trimmed message, thus the next error log contained
the tail of that message.
2024-03-15 16:45:58 +02:00
Tristan Ross 9d70d614ae std.builtin: make link mode fields lowercase 2024-03-11 07:09:10 -07:00
Dillen Meijboom 377ecc6afb feat: add support for --enable-new-dtags and --disable-new-dtags 2024-03-06 17:52:05 -08:00
binarycraft007 a7a5f4cf4d objcopy: support multiple only sections 2024-03-01 09:23:54 -08:00
Jacob Young d656c2a7ab test: rework how filtering works
* make test names contain the fully qualified name
 * make test filters match the fully qualified name
 * allow multiple test filters, where a test is skipped if it does not
   match any of the specified filters
2024-02-25 19:12:08 -08:00
David Rubin 3eacd1b2e5 change addCSourceFiles to use LazyPath instead Dependency (#19017)
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
2024-02-24 16:12:04 -05:00
Andrew Kelley 54bbc73f85 Merge pull request #18712 from Vexu/std.options
std: make options a struct instance instead of a namespace
2024-02-09 13:38:42 -08:00
Andrew Kelley 370438943e std.Build: revert moving some fields to Graph
On second thought, let's keep a bunch of these flags how they already
were.

Partial revert of the previous commit.
2024-02-02 20:43:01 -07:00
Andrew Kelley 105db13536 std.Build: implement --host-target, --host-cpu, --host-dynamic-linker
This also makes a long-overdue change of extracting common state from
Build into a shared Graph object.

Getting the semantics right for these flags turned out to be quite
tricky. In the end it works like this:
* The override only happens when the target is fully native, with no
  additional query parameters, such as versions or CPU features added.
* The override affects the resolved Target but leaves the original Query
  unmodified.
* The "is native?" detection logic operates on the original, unmodified
  query. This makes it possible to provide invalid host target
  information, causing confusing errors to occur. Don't do that.

There are some minor breaking changes to std.Build API such as the fact
that `b.zig_exe` is now moved to `b.graph.zig_exe`, as well as a handful
of other similar flags.
2024-02-02 20:43:01 -07:00
Jakub Konka 92deebcd66 cli+build: handle -ObjC flag and route it to MachO linker 2024-02-02 22:00:16 +01:00
Veikka Tuominen a4f27e8987 remove std.io.Mode 2024-02-01 15:22:36 +02:00
Gustavo C. Viegas fc48bbdf90 std.Build.Step.TranslateC: fix use of outdated Module in createModule 2024-01-31 02:46:05 +02:00
Ian Johnson 27d2d8e81f Apply cflags from pkg-config to all dependent modules
Closes #18628

This commit splits the arguments obtained from pkg-config into two
groups, cflags and libs, and consistently applies the cflags to each
individual module linking the library while applying the libs only once
for each compilation.
2024-01-29 14:08:41 -08:00
MrDmitry c84e086a2f Get rid of direct dependency on std.fmt
Replace unnecessary panic with step error
2024-01-26 15:59:05 -05:00
MrDmitry 9ecbf53388 Minor formatting, removed duplicate test case 2024-01-26 13:33:17 -05:00
MrDmitry 3e6f07e617 Add escaped character processing 2024-01-26 13:33:17 -05:00
MrDmitry 834f8d45ba Rewrite replace_variables with CMake-specific version
Behavior matches CMake's CMP0053 policy that is the current standard for
variable expansion for `configure_file()`
2024-01-26 13:33:17 -05:00
Tobias Simetsreiter 20abf1394a align naming and fix module creation from TranslateC 2024-01-26 15:25:52 +02:00
MrDmitry 2dfec13ef0 Fix last_index after variable substitution
Iterative passes should start at the end of the previous substitution
2024-01-21 03:16:09 -05:00
Andrew Kelley 2dea375450 std.Build.Compile: handle modules sans root source files
Uses the new `-M[name][=src]` CLI syntax to omit the source when the
module does not have a zig root source file.

Only some kinds of link objects imply that this should happen.
2024-01-19 22:28:07 -07:00
Andrew Kelley ab82132749 zig build: add doc comments for functions related to options
closes #18204
2024-01-18 22:01:09 -07:00
Krzysztof Wolicki 7116b02210 Allow multiple options using the same enum type 2024-01-15 23:08:11 -08:00
Jakub Konka a8b9f0cf22 std/Build/Step/Compile: do not propagate deps of complex addObject step 2024-01-14 23:07:21 +01:00
Carl Åstholm 0f9345ea9a Expose -f(no-)formatted-panics to the build system (again) 2024-01-13 22:07:34 -08:00
Andrew Kelley 45ec851733 zig build: handle stderr more elegantly
* Specifically recognize stderr as a different concept than an error
  message in Step results.
* Display it differently when only stderr occurs but the build proceeds
  successfully.

closes #18473
2024-01-10 17:11:26 -08:00
dhash 9bb6430318 Add support for --(no-)undefined-version
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Samuel Cantero <scanterog@gmail.com>
Co-authored-by: Giorgos Georgiou <giorgos.georgiou@datadoghq.com>
Co-authored-by: Carl Åstholm <carl@astholm.se>
2024-01-09 17:24:11 +01:00
Andrew Kelley 60094cc3fc Merge pull request #18491 from ziglang/fix-mod-link-obj-path
std.Build.Step.Compile: fix link object paths
2024-01-09 01:11:15 -08:00
Andrew Kelley cf5a5dc8b5 std.Build.Step.Compile: fix link object paths
They were being resolved relative to the wrong owner.

closes #18460
2024-01-08 18:24:14 -07:00