Open omnibs opened 3 years ago
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources.
Not sure if it's relevant, but we were also observing o.dat
get corrupted.
@evancz Any plans to make the compiler able to run in parallel?
Any updates on this?
I have one potential update. In my experience, Elm has a file based lock so that parallel elm make
actually run in sequence. However, there is no lock for the “dependencies” part of the compilation – that’s where I’ve seen failures. So what I did in my case was to first run elm make --output /dev/null Dummy.elm
to force the dependencies stuff to be done, then I started my parallel elm make
processes.
We tried serial dependency fetching -> parallel compilation
, and can report it didn't work for us. We still ran into the same issue described in the OP and had to quickly revert.
I'm not contesting @lydell's report tho. The trick might indeed reduce the likelihood of corruption, but that reduction wasn't enough to prevent corruption from happening frequently in a codebase with so many Elm apps to be compiled in parallel as NoRedInk's codebase.
Quick Summary: Elm make running in parallel corrupts
elm-stuff/0.19.1/i.dat
Running elm-make in parallel to compile different entry points every now and then errors out with the message below:
Additional Details
This has been mentioned in https://github.com/elm/compiler/issues/1830#issuecomment-727259777, we found it by searching for the error message.
We were facing the same problem when using
esbuild
's elm plugin. I opened an issue on the plugin's side here: https://github.com/phenax/esbuild-plugin-elm/issues/2There might be other spots https://github.com/elm/compiler/commit/054fa04074fd819958affd04a526e10f69aa5197 didn't cover that might be worth locking on.
Work-around
Don't let
elm
run in parallel.It might be hard to track who's launching
elm
in parallel. It was for us. To track down all places we wrapped theelm
executable in a shell script that blew everyelm
up when launching more than one instance ofelm
in parallel. This way we also caught a failures in the already-runningelm
callsite once a parallel launch was attempted.