Code Monkey home page Code Monkey logo

Comments (2)

canelhasmateus avatar canelhasmateus commented on May 28, 2024

While trying to reproduce:

a.nim:

echo  "I'm Running"
quit( 1 )

nim c -r a.nim

PS C:\Users\Mateus\Desktop\workspace\nimskull> nim c -r a.nim
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\nim.cfg' [Conf]    
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\config.nims' [Conf]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
9866 lines; 0.025s; 10.715MiB peakmem; proj: C:\Users\Mateus\Desktop\workspace\nimskull\a.nim; out: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe [SuccessX]
Hint: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe  [Exec]
I'm Running
Error: execution of an external program failed: 'C:\Users\Mateus\Desktop\workspace\nimskull\a.exe '
PS C:\Users\Mateus\Desktop\workspace\nimskull>

That is - the exit code isn't being printed anymore. Is this to be expected?

from nimskull.

canelhasmateus avatar canelhasmateus commented on May 28, 2024

On further Testing:

a.nim

quit( 0 )

and Running nim c -r a.nim ; echo "The last exit code was $LASTEXITCODE"

PS C:\Users\Mateus\Desktop\workspace\nimskull>      
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\config.nims' [Conf]
........................................................
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: a.nim
Hint:  [Link]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
26431 lines; 1.464s; 31.605MiB peakmem; proj: C:\Users\Mateus\Desktop\workspace\nimskull\a.nim; out: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe [SuccessX]
Hint: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe  [Exec]
The last exit code was 0

Accordingly, by changing the file

quit(1)

we get

Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\config.nims' [Conf]
........................................................
CC: a.nim
Hint:  [Link]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
26431 lines; 0.549s; 31.598MiB peakmem; proj: C:\Users\Mateus\Desktop\workspace\nimskull\a.nim; out: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe [SuccessX]
Hint: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe  [Exec]
Error: execution of an external program failed: 'C:\Users\Mateus\Desktop\workspace\nimskull\a.exe '
The last exit code was 1

Unexpectedly, however, by using

quit(137)
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\Mateus\Desktop\workspace\nimskull\config\config.nims' [Conf]
........................................................
CC: a.nim
Hint:  [Link]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
26431 lines; 0.535s; 31.539MiB peakmem; proj: C:\Users\Mateus\Desktop\workspace\nimskull\a.nim; out: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe [SuccessX]
Hint: C:\Users\Mateus\Desktop\workspace\nimskull\a.exe  [Exec]
Error: execution of an external program failed: 'C:\Users\Mateus\Desktop\workspace\nimskull\a.exe '
The last exit code was 1

This might be a issue with how windows handles exit codes and all. However, unlike your example, failure / success information ( at least ) seems to be correctly propagated to the os.
Is the original behaviour still existing?

from nimskull.

Related Issues (20)

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.