Giter Site home page Giter Site logo

Comments (5)

Kingcom avatar Kingcom commented on July 16, 2024

Can you check if this still happens, and if so provide a full test case? As far as I can tell, all errors lead to a return value of 1 from main.

from armips.

Prof9 avatar Prof9 commented on July 16, 2024

Yeah, it still happens. Using current nightly:

test1.asm

.error "deliberate error"

test2.asm

.gba
.open "test.bin","test.bin",0
.close

test.bat

@echo off
armips test1.asm
if errorlevel 1 ( echo armips exited with errors )
armips test2.asm
if errorlevel 1 ( echo armips exited with errors )
echo done

Produces:

test1.asm(1) error: deliberate error
Aborting.
armips exited with errors
test2.asm(3) fatal error: Could not copy file test.bin
done

There's no "armips exited with errors" being printed after the second run.

from armips.

sp1187 avatar sp1187 commented on July 16, 2024

I think this error may be Windows-only, as I do not get any error messages at all in the second case on Linux when a test.bin exists. Linux is likely less restrictive about opening files multiple times than Windows here. When I do not have a test.bin file, I get fatal error: Could not open file test.bin as expected.

For reference, here is the script I ported to Linux from test.bat:

armips test1.asm || echo "armips exited with errors"
armips test2.asm || echo "armips exited with errors"
echo "done"

and the script output (when test.bin exists):

/home/simon/ppriv/armipstest/test1.asm(1) error: deliberate error
Aborting.
armips exited with errors
done

from armips.

Prof9 avatar Prof9 commented on July 16, 2024

Ah, I see the confusion. You're right in that the exit code is 1 if there is no test.bin. However, if test.bin does exist, then it returns exit code 0 instead.

EDIT: For reference:

test1.asm

.gba
.open "exists.bin","exists.bin",0
.close

test2asm

.gba
.open "doesntexist.bin","doesntexist.bin",0
.close

test.bat

@echo off
armips test1.asm
if errorlevel 1 ( echo armips exited with errors )
armips test2.asm
if errorlevel 1 ( echo armips exited with errors )
echo done

Produces:

test1.asm(2) fatal error: Could not open file doesntexist.bin
Aborting.
armips exited with errors
test2.asm(3) fatal error: Could not copy file exists.bin
done

EDIT2:
It looks like the error occurs on line 3 (.close) for test2.asm, so maybe the .close directive isn't forwarding errors properly?

from armips.

Kingcom avatar Kingcom commented on July 16, 2024

The problem is that the error is only detected in the encoding stage, as CopyFileW (correctly) fails to copy a file to itself. On Linux the copying is done manually, apparently with non-blocking files. Currently errors are not supposed to happen during the encode stage. I'll add a check to ensure the source and target files are different.

from armips.

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.