chris-hinson / rustfuck

brainfuck compiler and virtual machine emulator
2 stars 0 forks source link

Assemble-only mode does not work consistently on Windows #2

Open Elsklivet opened 1 year ago

Elsklivet commented 1 year ago

Summary

Running rustfuck on Windows with the -a flag emits an error saying something about a non-existent file, and does not produce a file.asm.

Steps to Reproduce

  1. Compile rustfuck on Windows 10 with cargo build --release
  2. Copy the executable into its own directory with a file.b Brainfuck source file
  3. Run ./rustfuck.exe -a file.b

Expected Output: Successfully assemble the given Brainfuck source into a file file.asm.

Actual Output:

running -a that file does not exist. Exiting without running

Notes

In #1, I noted that running without any flags does appear to generate an assembly file, but it does not have the same name as the output file and cannot be assembled by NASM on Windows. The README states that linking could be a problem, but I was not expecting assembly generation alone to fail.

Elsklivet commented 1 year ago

After some investigation into #1, I think this issue is caused by a strictly expected ordering of arguments, where filename comes first and flags come after. Additionally, flags themselves are not parsed correctly on Windows unless they exclude the preceding -, it seems.

Resolution of #1 will resolve this issue.