Menu

#3702 Cross-build requires todos, needs better error message

open
nobody
None
Build
5
2024-01-29
2024-01-26
No

Trying to cross-build a snapshot fails when there is no todos binary:

echo '@setlocal enabledelayedexpansion && python -x "%~f0" %* & exit /b !ERRORLEVEL!' | \
  cat - /home/sdcc-builder/build/sdcc-build/build/i686-w64-mingw32/sdcc/sdcc/bin/as2gbmap | \
  todos > /home/sdcc-builder/build/sdcc-build/build/i686-w64-mingw32/sdcc/sdcc/bin/as2gbmap.cmd && \
  rm /home/sdcc-builder/build/sdcc-build/build/i686-w64-mingw32/sdcc/sdcc/bin/as2gbmap
/bin/sh: 3: todos: not found

To someone not familiar with bash, this error message is not that clear. Did something go wrong with python? What is that "todos" (looks like some todo list)?
On debian, todos is a binary in the tofrodos package.

Discussion

  • Philipp Klaus Krause

    • Category: other --> Build
     
  • Maarten Brock

    Maarten Brock - 2024-01-29

    todos (to DOS) is the utility from tofrodos (to & from DOS) with DOS being MS-DOS or some such. It is used here to create the Windows .cmd batch file. It basically replaces every LF by CR/LF. An alternative is unix2dos.

    But this whole line looks like a difficult way to create that file IMHO. Why echo, then cat? And why not insert an escaped \r\n in the appropriate place?

     

Log in to post a comment.