elba build
stale if project open in repl #74Description
Problem
When a file is opened in the repl and is subsequently changed but not rebuilt in the repl, elba build
does not use the file's current state for the output binary, but instead uses the old code still in use by the repl.
Minimal example
In the first terminal:
$ mkdir rebuild
$ cd rebuild
$ elba init
$ elba repl
You could also replace elba repl
with idris src/Main.idr
, both cause the problem.
Now change the "Hello, world!"
to anything else, save the file, and open another terminal in the rebuild
folder:
$ elba build
$ ./target/bin/rebuild
"Hello, world!"
You should see the "Hello, world!" from the old file that's still open in the repl.
Additional info
Seemingly there's still a lot of work going on in this situation (it takes 5s instead of 0.7s to build), so presumably some compilation is actually happening, but is then not being used.
idris src/Main.idr -o rebuild
does not suffer from the same problem.