)]}'
{
  "commit": "62b3e7680de54d9edd9916bc04768bcfca7d633e",
  "tree": "3dcc6104ada8c2273bf1e6c03a2931e2c6c27f40",
  "parents": [
    "604fe250038530280f5976499957c96cc73c4543"
  ],
  "author": {
    "name": "Rupert Swarbrick",
    "email": "rswarbrick@lowrisc.org",
    "time": "Fri Jan 29 15:21:49 2021 +0000"
  },
  "committer": {
    "name": "Rupert Swarbrick",
    "email": "rswarbrick@gmail.com",
    "time": "Fri Jan 29 16:26:00 2021 +0000"
  },
  "message": "[dvsim] Generate FUSESOC_IGNORE at top of scratch root\n\nThis is a bit of a work-around for a race condition that was causing\nall sorts of confusing CI failures. This crops up the second time you\nrun a \"primary config\" (list of configurations), if you do that second\nrun with a high parallelism.\n\nSuppose you\u0027ve done a dvsim lint run already and you have two IP\nblocks, A and B. At this point, you\u0027ll have generated .core files\nsomewhere inside A\u0027s build directory, protected by a FUSESOC_IGNORE\nfile.\n\nNow you start a new run. Two fusesoc processes (for A and B,\nrespectively) start to race. The one for A cleans its build directory,\nessentially running \"rm -rf\" on the generated tree. This works\ntop-down, deleting files and directories. Within a directory, it works\nin the order that files come back from readdir. What happens if\nFUSESOC_IGNORE appears in the list before the directories containing\nthe core files?\n\nThe \"rm -rf\" process deletes the FUSESOC_IGNORE file. Now suppose that\nthe kernel suspends that process and switches over to the fusesoc\nprocess for block B. That process can now merrily read its way down\nthe build directory. There\u0027s no FUSESOC_IGNORE file, so it looks in\ncore A\u0027s generated core files and finds some. Oops.\n\nNow the process for block B gets suspended and we\u0027re back to A, which\nfinishes up deleting stuff. When we get back to B again, it tries to\nload that juicy core file that it found... which isn\u0027t there any\nmore. Total confusion!\n\nDebugging this was made much worse by the fact that the time stamps\nhave all since been trashed by core A\u0027s fusesoc run, which has since\nhelpfully re-created all the files!\n\nOne \"proper\" fix would be to delete the old build directory more\ncarefully, ensuring that the generated core files get deleted before\nFUSESOC_IGNORE. That seems rather difficult, though. Ideally, we\u0027d\nwant to move that logic back to fusesoc, rather than calling \"rm -rf\"\nourselves.\n\nAnother possible fix would be to move this \"touch\" operation into the\nvarious flow configurations that need it. I\u0027m not so keen on that,\nthough, because now we duplicate the logic all over the place.\n\nI\u0027m hoping this commit will be reverted and replaced by a better\nsolution soon :-)\n\nSigned-off-by: Rupert Swarbrick \u003crswarbrick@lowrisc.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7f2fdea75d458d3353da9c1651c0b3753eea1b27",
      "old_mode": 33261,
      "old_path": "util/dvsim/dvsim.py",
      "new_id": "64e6e3e457f49f5b788057ed45b25a356ad13fa7",
      "new_mode": 33261,
      "new_path": "util/dvsim/dvsim.py"
    }
  ]
}
