17 Commits

Author SHA1 Message Date
Jonathan Marler
71f69190ef some fixes to the EnvMap HashContext 2022-05-11 18:41:23 -06:00
Ryan Liptak
a2069612a5 Fix regression in RunStep.addPathDir
`key` was never being given a value, caused by b83cea12f31feaa0aff9489d5f7bd6159d284567
2022-05-11 18:40:53 -06:00
Jonathan Marler
9e89000ffc Update usages of process.getEnvMap and change BufMap -> EnvMap where applicable
# Conflicts:
#	lib/std/build/RunStep.zig
2022-05-11 18:40:53 -06:00
Jimmi Holst Christensen
a0a2ce92ca std: Do not allocate the result for ChildProcess.init
Instead, just return ChildProcess directly. This structure does not
require a stable address, so we can put it on the stack just fine. If
someone wants it on the heap they should do.

  const proc = try allocator.create(ChildProcess);
  proc.* = ChildProcess.init(args, allocator);
2022-04-29 22:50:34 -04:00
Cody Tapscott
c1cf158729 Replace argvCmd with std.mem.join 2022-02-06 22:21:46 -07:00
Cody Tapscott
5065830aa0 Avoid depending on child process execution when not supported by host OS
In accordance with the requesting issue (#10750):
- `zig test` skips any tests that it cannot spawn, returning success
- `zig run` and `zig build` exit with failure, reporting the command the cannot be run
- `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change
- Native `libc` Detection is not supported

Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
2022-02-06 22:21:46 -07:00
Lee Cannon
c54a7ca4b2 allow expected_exit_code to be null 2022-01-24 17:29:19 +02:00
Andrew Kelley
902df103c6 std lib API deprecations for the upcoming 0.9.0 release
See #3811
2021-11-30 00:13:07 -07:00
Jonathan Marler
9c1c1d478d add print field to RunStep
A new print field is added to RunStep that will control whether it prints the cmd before running it.  By default it will be set to builder.verbose which means it will print only if builder.verbose is true.
2021-11-16 16:35:12 -05:00
Jonathan Marler
da2b615efb distinguish between unexpected child process exit code and unclean exit
This modifies the error for an unexpected exit code from the ChildProcess of RunStep to be UnexpectedExitCode rather than UncleanExit.  This allows the handler of the error to distinguish between an error reported by the ChildProcess, and an error executing the ChildProcess, which is an important dinstinction when it comes to know what information to report to the user.  For example, if you have a ChildProcess that you know reports its own errors, an unexpected exit code would mean the error is already reported, but an unclean exit would mean that child process was not able to report any error.
2021-10-21 17:03:00 -04:00
Andrew Kelley
6115cf2240 migrate from std.Target.current to @import("builtin").target
closes #9388
closes #9321
2021-10-04 23:48:55 -07:00
Andrew Kelley
d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00
Lee Cannon
c234d4790e
Add option to hide build command on compilation error to build_runner (#8513)
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-07-27 21:30:53 -04:00
Veikka Tuominen
4b72b0560d make remaining enums in build.zig snake_case 2021-06-11 16:01:30 +03:00
Felix (xq) Queißner
98941cf27c Makes output path stuff more sane. 2021-06-11 10:43:38 +03:00
Felix (xq) Queißner
27bd0971bb Changes to .path instead of .getPathFn. Changes LibExeObjStep to also provide FileSource. 2021-06-11 10:39:50 +03:00
Felix (xq) Queißner
56cb0b5ca0 Moves files to file-global struct layout. 2021-06-11 10:33:27 +03:00