learn-ocaml icon indicating copy to clipboard operation
learn-ocaml copied to clipboard

Fix `learn-ocaml build -j 2` issue

Open erikmd opened this issue 4 years ago • 1 comments

This PR is intended to Reproduce and Fix ocaml-sf/learn-ocaml#414

erikmd avatar Sep 08 '21 15:09 erikmd

Hi all,

I've tried 2 different fixes in this PR (tweak Lwt_utils.mkdir_p (in my reverted commit) or just calling Lwt_utils.mkdir_p once more).

Both fix the issue mentioned in issue #414: Avoid Cannot process exercises: Unix.Unix_error(Unix.EEXIST, "mkdir", "./www/static")

However, the issue is more pervasive than what I thought at first sight: despite this potential fix, the parallel processing is still broken… because we get randomly, with the 2-exercises demo repositiory, one of these outcomes:

  1. OK
Learnocaml v.0.12 running.
Updating app at ./www
demo2                        [OK]
demo                         [OK]
  1. Partial build and freeze (the build process hangs):
Updating app at ./www
demo2                        [OK]
  1. something yet more strange:
Learnocaml v.0.12 running.
Updating app at ./www
Grader error: Lwt.Resolution_loop.Canceled
demo                       [FAILED]
demo2                        [OK]
demo                         [OK]

So, I'm going to postpone this for the time being − fixing this parallel build issue would be nice, but will require more investigation in src/repo/learnocaml_process_exercise_repository.ml

(FTR, the outputs above mention "0.12" but the tested version was obviously the commits from this PR; anyway, I think "the ambient version number" should be bumped in master anytime soon, and after each release)

erikmd avatar Sep 08 '21 17:09 erikmd