Giter VIP home page Giter VIP logo

psutil-nim's People

Contributors

bung87 avatar iffy avatar johnscillieri avatar juancarlospaco avatar techno-fox avatar xbello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

psutil-nim's Issues

Error: unhandled exception: over- or underflow [OverflowError]

I was testing the script disk_usage.nim

When compiled with 64bit it works, however, with 32bit gives the error
/opt/psutil-nim/scripts/disk_usage.nim(34) disk_usage
/opt/psutil-nim/scripts/disk_usage.nim(26) main
/home/kittytechno/.nimble/pkgs/psutil-0.6.0/psutil/psutil_posix.nim(206) disk_usage
/home/kittytechno/.choosenim/toolchains/nim-1.2.0/lib/system/fatal.nim(49) sysFatal
Error: unhandled exception: over- or underflow [OverflowError]

Wrong import of sys/socket.h in windows

The lib is importing a linux library in windows, so it gives a C-level error:

C:\Users\Administrator\nimcache\test_r\@m..@s..@s..@s..@sUsers@sAdministrator@s.
nimble@[email protected]@spsutil@spsutil_windows.nim.c:10:10: fatal error: sys
/socket.h: No such file or directory
   10 | #include <sys/socket.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

psutil_posix.nim(89, 24) Error: type mismatch: got (int, int literal(0))

z@z ~/.n/p/psutil-0.5.0> nim c psutil_posix.nim 
Hint: used config file '/home/z/Nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: psutil_posix [Processing]
Hint: posix [Processing]
Hint: times [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: algorithm [Processing]
Hint: tables [Processing]
Hint: hashes [Processing]
Hint: common [Processing]
Hint: nativesockets [Processing]
Hint: os [Processing]
Hint: ospaths [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
psutil_posix.nim(89, 24) Error: type mismatch: got (int, int literal(0))
but expected one of: 
proc kill(a1: Pid; a2: cint): cint

invalid indentation on macos M2

/Users/tester/.nimble/pkgs2/psutil-0.6.0-965ce8f561bbbd908402979a36bb3eac5cc50897/psutil/psutil_posix.nim(55, 47) Error: invalid indentation

after I import psutil and I got the above error, using nim2.0.0

Does not work with nim 1.0.0+

Hello,

There was a backward incompatible change in nim 1.0.0 that removed isDigit for string args.

So with newer nim versions, this fails:

git clone https://github.com/johnscillieri/psutil-nim psutil
cd psutil
nim c -r tests/test_posix.nim    
psutil/src/psutil/psutil_linux.nim(158, 47) Error: type mismatch: got <string>
but expected one of:
proc isDigit(c: char): bool
  first type mismatch at position: 1
  required type for c: char
  but expression 'it.path' is of type: string

expression: isdigit(it.path)

Discontinued?

Is this project discontinued? May it even be finished?

Thanks!

Type Issues

Type Issues in Windows side of psutil. I assume something changed in winim but I am uncertain.
Linux compiles and runs without issues.

Nim Version

nim -v
Nim Compiler Version 1.4.4 [Windows: amd64]
Compiled at 2021-02-23
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release

winim version

nimble install winim
Downloading https://github.com/khchen/winim using git
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building winim/winim/winimx.exe using c backend
    Prompt: [email protected] already exists. Overwrite? [y/N]
    Answer: N

psutil version

nimble install psutil
Downloading https://github.com/juancarlospaco/psutil-nim using git
  Verifying dependencies for [email protected]
 Installing [email protected]
    Prompt: [email protected] already exists. Overwrite? [y/N]
    Answer: N

compilation output

C:\Users\user\processlist>nim c mytest.nim
Hint: used config file 'C:\nim-1.4.4\config\nim.cfg' [Conf]
Hint: used config file 'C:\nim-1.4.4\config\config.nims' [Conf]
...................................................................................................
C:\Users\user\.nimble\pkgs\psutil-0.6.0\psutil\psutil_windows.nim(151, 30) Error: type mismatch: got <HANDLE, HMODULE, array[0..259, TCHAR], DWORD>
but expected one of:
proc GetModuleBaseName(hProcess: HANDLE; hModule: HMODULE; lpBaseName: LPWSTR;
                       nSize: DWORD): DWORD
  first type mismatch at position: 3
  required type for lpBaseName: LPWSTR
  but expression 'szProcessName' is of type: array[0..259, TCHAR]

expression: GetModuleBaseName(hProcess, hMod, szProcessName, cast[DWORD](len(szProcessName)))

The issues are not limited to this proc. I tried to run down my list of issues that I had as a result of trying to create a windows process list. Unfortunately the type issues go a bit deeper than I understand at this point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.