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

vdoctor: fix format, windows, tcc #23361

Merged
merged 11 commits into from
Jan 4, 2025
Merged

vdoctor: fix format, windows, tcc #23361

merged 11 commits into from
Jan 4, 2025

Conversation

kbkpbot
Copy link
Contributor

@kbkpbot kbkpbot commented Jan 4, 2025

This PR will

  1. create a nice looking vdoctor output;
  2. fix windows ANSI->UTF-8 text encoding;
  3. fix windows get CPU name;
  4. add tcc -v to output;
  5. add gcc,clang,glibc version detect;
  6. add msvc version detect under Windows;
  7. remove path contains non-ANSI character/spaces warning;
  8. add free memory / total memory;
  9. remove emcc detection;

New v doctor will output:

~/v/测试/dir contains spaces$ v doctor
|V full version      |V 0.4.9 3ed799e
|:-------------------|:-------------------
|OS                  |linux, Ubuntu 24.04.1 LTS
|Processor           |8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
|Memory              |2.97GB/15.51GB
|                    |
|V executable        |/media/HD/github/kbkpbot/v/v
|V last modified time|2025-01-03 23:45:18
|                    |
|V home dir          |OK, value: /media/HD/github/kbkpbot/v
|VMODULES            |OK, value: /home/mars/.vmodules
|VTMP                |OK, value: /tmp/v_1000
|Current working dir |contains spaces, contains these non ASCII characters: [``, ``], value: /home/mars/v/测试/dir contains spaces
|                    |
|Git version         |git version 2.43.0
|V git status        |weekly.2024.53-29-g1fbb77e1-dirty (2 commit(s) behind V master)
|.git/config present |true
|                    |
|CC version          |cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
|gcc version         |gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
|clang version       |Ubuntu clang version 18.1.3 (1ubuntu1)
|tcc version         |tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
|tcc git status      |thirdparty-linux-amd64 0134e9b9
|glibc version       |ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

By copy this vdoctor output to github, you will get a nice looking markdown format:

Linux:

V full version V 0.4.9 3ed799e
OS linux, Ubuntu 24.04.1 LTS
Processor 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Memory 2.97GB/15.51GB
V executable /media/HD/github/kbkpbot/v/v
V last modified time 2025-01-03 23:45:18
V home dir OK, value: /media/HD/github/kbkpbot/v
VMODULES OK, value: /home/mars/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir contains spaces, contains these non ASCII characters: [, ], value: /home/mars/v/测试/dir contains spaces
Git version git version 2.43.0
V git status weekly.2024.53-29-g1fbb77e1-dirty (2 commit(s) behind V master)
.git/config present true
CC version cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
gcc version gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
clang version Ubuntu clang version 18.1.3 (1ubuntu1)
tcc version tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status thirdparty-linux-amd64 0134e9b9
glibc version ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

Windows :

V full version V 0.4.9 3ed799e
OS windows, Microsoft Windows 10 企业版 LTSC 19044 64 位
Processor 16 cpus, 64bit, little endian, AMD Ryzen 7 7840H with Radeon 780M Graphics
Memory 1.36GB/27.69GB
V executable D:\v\v\v\v.exe
V last modified time 2025-01-03 23:42:23
V home dir OK, value: D:\v\v\v
VMODULES OK, value: C:\Users\DDT.vmodules
VTMP OK, value: C:\Users\DDT\AppData\Local\Temp\v_0
Current working dir contains spaces, contains these non ASCII characters: [, ], value: D:\测试tmp\v test dir contain space
Git version git version 2.43.0.windows.1
V git status weekly.2024.53-19-g3ed799ef-dirty (2 commit(s) behind V master)
.git/config present true
CC version N/A
gcc version N/A
clang version N/A
msvc version 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.39.33523 版
tcc version tcc version 0.9.28rc 2024-12-30_mob@68000c01* (x86_64 Windows)
tcc git status N/A
glibc version N/A

cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
kbkpbot and others added 4 commits January 4, 2025 09:58
@JalonSolov
Copy link
Contributor

Please also update the first comment here if you change the output, so people can see up front what they'll be getting. :-)

cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
a.line('CC version', a.cmd(command: 'cc --version'))
a.line('emcc version', a.cmd(command: 'emcc --version'))
a.line('GCC version', a.cmd(command: 'gcc --version'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to capitalize GCC. Leave it as just gcc version like the rest for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, remove emcc detection...

Copy link
Member

@spytheman spytheman Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, emcc detection should stay.

It is useful for diagnosing problems when you want to compile games to wasm through:
v -os wasm32_emscripten examples/2048/

If that does not work, a report, including the output of v doctor can help pinpoint the problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment before that was only about the capitalization of GCC, perhaps that was misleading, sorry. I did not meant to approve the removal of emcc - I thought it is just moved/reordered.

cmd/tools/vdoctor.v Outdated Show resolved Hide resolved
@spytheman
Copy link
Member

spytheman commented Jan 4, 2025

Excellent work overall. The new look is much cleaner and easier and faster to scan at a glance.

@spytheman spytheman merged commit 30de072 into vlang:master Jan 4, 2025
26 checks passed
@kbkpbot kbkpbot deleted the fix-vdoctor branch January 4, 2025 09:41
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.

3 participants