Need help getting a Nim Bot to run on the server


I’ve written my own bot in the Nim language.

I’ve have an script that installs nim, and then compiles the bot. I’ve successfully tested the script on an Unbutu server. When uploading to Halite, after the successful compilation messages, I’m see the following error message,

Did not find a recognized MyBot.* file. Please add one of the following filenames to your zip file: Ada: MyBot.adb C++: CMakeLists.txt C: MyBot.c C#/.NET Core: MyBot.csproj C#/Mono: MyBot.cs VB/Mono: MyBot.vb C++: MyBot.cpp Clojure: project.clj CoffeeScript: D: MyBot.d Dart: MyBot.dart Elixir: mix.exs Erlang: my_bot.erl F#/.NET Core: MyBot.fsproj Forth: MyBot.fs Go: MyBot.go Groovy: MyBot.groovy Haskell: MyBot.hs Haskell/Stack: stack.yaml Java: JavaScript: MyBot.js JAR: MyBot.jar Julia: MyBot.jl Kotlin: MyBot.kt Lisp: MyBot.lisp Lua/LuaJIT: MyBot.lua Lua/Lua5.3: MyBot.lua53 OCaml: Octave: MyBot.m Pascal: MyBot.pas Perl: PHP: MyBot.php Python: Python (PyPy): MyBot.pypy Racket: MyBot.rkt Ruby: MyBot.rb Rust: Cargo.toml Scala: MyBot.scala Scheme: Swift: Package.swift Tcl: MyBot.tcl

What do I need to do? I do have MyBot.nim file in the zip.

my file:

mkdir tools
cd tools
curl -O
tar -xJf nim-0.19.0.tar.xz
cd nim-0.19.0/
cd ../..
tools/nim-0.19.0/bin/nim compile -d:release MyBot.nim
rm -rf tools/nim-0.19.0


Because I love lame ugly hacks, I wrote a javascript wrapper that launches my bot.

This seems to work well locally, but the build process is being marked as failed on the halite server even though it seems to succeed according to the debugging echo’s I’ve added to

The trailing end of the compile step failure email from Halite says:

* Finished bot build
* ls output:
  LANGUAGE MyBot MyBot.js MyBot.nim ai.nim atc.nim engine.nim greetings greetings.nim log.nim tools
* Finished file

End of stdout. 

Which is exactly what I should be seeing. I see the built MyBot file. The stderr report looks good too. What is the build process looking for that is not finding?


So is marked as failing if there is any output on stderr. (For example, running curl).

My new file looks like this:

mkdir tools
cd tools
curl -O 2>&1
tar -xJf nim-0.19.0.tar.xz
cd nim-0.19.0/
sh 2>&1
cd ../..
echo "* Starting bot build"
tools/nim-0.19.0/bin/nim compile -d:release greetings.nim 2>&1
echo "* Finshed bot build"
echo `ls`
rm -rf tools
echo "* Finished file"

And works fine posing as javascript.


Nim isn’t installed on the Halite server environment so it won’t work.


To be clear, I’m now successfully running my Nim bot on the server.


We’ll roll Nim and Kotlin into the next worker OS image: