-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
zig info command - print lib path, std path and global cache path #5394
Conversation
I'm thinking creating a separate file called I guess I'd also need to call Any help on choosing the best approach would be appreciated. |
Found the zig blake2 implementation, working on translating cache_hash.cpp into zig, which is used by current |
I'll work on merging #4635 soon, I think you might be duplicating efforts here |
I'd argue that json output is overkill for this. A simple table would be easier to work with from shell scripts without depending on something like |
Or to add additional argument: |
Oh didn't notice that PR, I'll stop then. Didn't get that far anyway :)
Agreed, that's a good idea |
Figuring out how to pass version from I'd like to split self hosted version resolution into a separate PR and merge this in its current state. |
src-self-hosted/print_info.zig
Outdated
var json_format = false; | ||
for (cmd_args) |arg| { | ||
if (mem.eql(u8, arg, "--json")) { | ||
json_format = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also have a --text
option to set it back to non-json?
Perhaps it should be a --format=json
argument instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's text by default, why add an additional --text
argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's common in many command line tools so that aliases and defaults set in wrappers can be undone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a --format
option, also changed error messages to better match other zig commands.
Found an inconsistency between Linux and OSX that affects this PR: The fix to that is very simple, I can just call |
Actually, looks like symlinks in For example |
Another solution is to remove link resolution in |
Also some help text and error changes to better match the rest of zig
Thanks @Sergeeeek. I made some adjustments and then it landed in e26dda5. |
Implements the enhancement #4427
Creating this PR before everything is finished to get early feedback.
A couple of questions:
stage0 uses Blake2 to compute the compiler id hash, can I use that for self hosted or does it need to be re-implemented?Will be implemented in Partially implement cache hash API in zig #4635How to pass a version string from build.zig? Are there any examples/docs? I haven't found anything.Will use addBuildOptionProgress
Self hosted:
info
command to zigExample output:
Stage 1:
info
command to zig