Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/print_env: print the native target #11741

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

perillo
Copy link
Contributor

@perillo perillo commented May 27, 2022

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.

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.
@perillo perillo changed the title cmd env target src/print_env: print the native target May 27, 2022
@andrewrk
Copy link
Member

Note that this information is available via zig targets:

andy@ark ~> zig targets | jq .native.triple
"x86_64-linux.5.10.110...5.10.110-gnu.2.33"

@perillo
Copy link
Contributor Author

perillo commented May 28, 2022

Note that this information is available via zig targets:

andy@ark ~> zig targets | jq .native.triple
"x86_64-linux.5.10.110...5.10.110-gnu.2.33"

Yes, I'm aware; and using jq will make it convenient for the user. The advantage is that it works right now.

However a possible advantage of zig env is that in future it can show more debug data like zig_backend, link_libc, valgrin_support and the dynamic linker used.
It will also make very convenient for the user to report a bug, since it can just copy and paste the output of zig env, like it is done with the Go language bug template.

Thanks.

@andrewrk
Copy link
Member

I like it. Thank you.

@andrewrk andrewrk merged commit 3250b20 into ziglang:master Sep 14, 2022
jcmoyer added a commit to jcmoyer/zls that referenced this pull request Sep 15, 2022
@@ -21,6 +21,10 @@ pub fn cmdEnv(gpa: Allocator, args: []const []const u8, stdout: std.fs.File.Writ
const global_cache_dir = try introspect.resolveGlobalCacheDir(gpa);
defer gpa.free(global_cache_dir);

const info = try std.zig.system.NativeTargetInfo.detect(gpa, .{});

This comment was marked as resolved.

jcmoyer added a commit to jcmoyer/zls that referenced this pull request Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants