1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Exit codes not returned correctly

Discussion in 'TCC/LE Support' started by JamieT, Jan 26, 2016.

  1. JamieT

    Joined:
    Nov 17, 2015
    Messages:
    4
    Likes Received:
    0
    I posted this bug a few months ago and had no replies. I am just wondering, should I expect it would ever be fixed? This is pretty significant.

    https://jpsoft.com/forums/threads/s...d-commands-doesnt-work-with-npm-scripts.7009/

    To summarize, in some circumstances, exit codes returned by a process invoked inside a script are not passed on when the script itself exits. This makes any kind of chained process unreliable, e.g. later scripts may execute even though a prior script failed. Since a great many npm packages depend on this kind of functionality for ensuring prerequites to building, testing, and so on succeed, it makes TCC/LE difficult to use with npm and node. But generally, this could affect anything that uses && to chain scripts.

    I created a git repo to demonstrate the problem:

    https://github.com/jamietre/tccle-issue

    The readme shows how to reproduce the problem. The scripts work as expected using normal DOS CMD and bash shells.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,877
    Likes Received:
    30
    Let's make it very simple. Here are two CMD files everyone should be able to run.
    Code:
    v:\> type chain1.cmd
    @echo off
    if "%1" == "1" (cmd /c exit 1) else (echo foo)
    
    v:\> type chain2.cmd
    @echo off
    echo chain2.cmd was executed
    Here's the result of conditional execution with CMD.
    Code:
    V:\> chain1.cmd 1 && chain2.cmd
    
    V:\>
    And here's the result with TCC.
    Code:
    v:\> chain1.cmd 1 && chain2.cmd
    chain2.cmd was executed
    
    v:\>
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,813
    Likes Received:
    82
    Fixed in biuld 14.00.08 (already uploaded). This was some undocumented CMD behavior; TCC/LE is now emulating it.
     
  4. JamieT

    Joined:
    Nov 17, 2015
    Messages:
    4
    Likes Received:
    0
    Verified! Thank you!!
     

Share This Page