16 Commits

Author SHA1 Message Date
Andrew Kelley
a4380a30f5 move zig libc command to be lazily built
part of #19063

This is a prerequisite for doing the same for Resinator.
2024-02-27 22:55:00 -07:00
Andrew Kelley
dbdb87502d std.Target: add DynamicLinker 2024-01-01 17:51:18 -07:00
Andrew Kelley
63f9af87d3 zig env: back to json output
changed my mind I liked it better before. this reverts
053119083c2c93cb1fc4129bc647c03301f4010d.
2023-10-18 15:50:00 -07:00
Andrew Kelley
09dea957ed rework zig env
Introduce introspect.EnvVar which tracks all the environment variables
that are observed by the compiler, so that we can print them with `zig
env`.

The `zig env` command now prints both the resolved values as well as all
the possibly observed environment variables.
2023-10-17 21:27:09 -07:00
Manlio Perillo
053119083c zig env: remove the json output
The current json output is not very convenient to use from the shell or
a Zig program.
An example using the shell: `zig env | jq -r .lib_dir`.

Remove the json output, and instead use the POSIX shell syntax:
  name="value"

Additionally, when args is not empty, assume each argument is the
environment variable name and print the associated value.
Unrecognized environment variables are ignored.

The new output format has been copied from `go env`, with the difference
that `go env` uses OS specific syntax for windows and plan9.

Define the environment variables in a single place, in order to avoid
possible bugs.
2023-10-17 20:10:23 -07:00
Josh Wolfe
8924f81d8c
std.json: Unify stringify and writeStream (#16405) 2023-07-21 19:56:46 -04:00
Josh Wolfe
018b743c7a
std: Rewrite low-level json api to support streaming (#15602) 2023-05-13 14:31:53 -04:00
Andrew Kelley
17596c79a9 stage2: fix compile error merge conflict
3250b20ceabea044bd4c7b1653d76d7069840058 had a silent merge conflict
with master branch; fixed now.
2022-09-14 16:41:53 -07:00
Manlio Perillo
3250b20cea src/print_env: print the native target
Add the native target triple to the zig env command output.

The target triple is formatted the same way as it is done in the
zig targets command.
2022-09-14 19:28:47 -04:00
Cody Tapscott
bb9cd6db1c stage2: Move WASI/Zig-specific selfExePath to introspect.zig 2022-04-18 23:06:49 -07:00
Lee Cannon
85de022c56
allocgate: std Allocator interface refactor 2021-11-30 23:32:47 +00:00
Jacob G-W
9fffffb07b fix code broken from previous commit 2021-06-21 17:03:03 -07:00
Jay Petacat
a9b505fa77 Reduce use of deprecated IO types
Related: #4917
2021-01-07 23:48:58 -08:00
LemonBoy
1c13ca5a05 stage2: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
g-w1
51a904677c
update depreciated code (#7502)
* `zig env`:

* fix depreciated interface, update outStream -> writer
* make code more readable by updating `anytype` -> `std.fs.File.Writer`
2020-12-23 13:01:29 +02:00
Andrew Kelley
528832bd3a rename src-self-hosted/ to src/ 2020-09-21 18:38:55 -07:00