The Goal: package an executable "Hello, world" program in Idris2
I'm working from the docs, which gives descriptions of the package fields but sadly doesn't provide any examples.
The issue: "File Not Found" compilation errors on the builddir and outputdir
Below is a walkthrough of my directory structure and contents.
$ ls
kata.ipkg README.md src
$ ls src/
Index.idr
$ cat src/Index.idr
module Index
main : IO ()
main = putStrLn "Hello, world"
$ cat kata.ipkg
package kata
authors = "eleanorofs"
builddir = "build"
bugtracker = "https://gitlab.com/eleanorofs/idris-kata/-/issues"
executable = "src/Index.idr"
outputdir = "dist"
homepage = "https://gitlab.com/eleanorofs/idris-kata"
main = Index
maintainers = "eleanorofs"
opts = "--cg node --directive pretty"
readme = "./README.md"
sourcedir = "./src"
sourceloc = "https://gitlab.com/eleanorofs/idris-kata"
version = 0.0.1
$ idris2 --build kata.ipkg
1/1: Building Index (./src/Index.idr)
Uncaught error: File error (dist/src/Index.idr): File Not Found
When I delete the outputdir
line, it gives me the same error, but on the builddir
(build/exec/src/Index.idr instead.
Questions
This makes me think I've misunderstood something pretty fundamental about how this compiler is supposed to work.
Idris itself maintains the contents of build/ and dist/, right? So there's nothing I need to do to those directories, right?
If so, why does it succeed in building Index.idr but then thow an error trying to find the files that I would have expected it to generate itself?