)]}'
{
  "commit": "90b9220f554fb7675181f0543c2c77287c8b6dac",
  "tree": "248468aa7eb37585f4c33fdd7f82ec7153511ccd",
  "parents": [
    "921b4a408cb2ce50e4eb8336ce41c398c805566b"
  ],
  "author": {
    "name": "Johnathan Van Why",
    "email": "jrvanwhy@google.com",
    "time": "Wed Jan 13 21:44:30 2021 -0800"
  },
  "committer": {
    "name": "Johnathan Van Why",
    "email": "jrvanwhy@google.com",
    "time": "Wed Jan 13 21:44:30 2021 -0800"
  },
  "message": "Update libtock\u0027s build script to not conflict with libtock_runtime\u0027s build script and remove the broken empty_main example.\n\nI made changes to libtock_runtime\u0027s linker scripts and the changes were not having any effect.\n\nExplanation: According to the cargo reference, build scripts should only write to OUT_DIR [1]. This is not enforced, and libtock\u0027s build script wrote `layout.ld` directly in `libtock`\u0027s source directory. This works for libtock because rust-lld is executed in the cargo workspace directory, which is libtock\u0027s source directory, so the linker was able to find layout.ld. However, after libtock has been build once, when the linker runs for libtock_runtime, there are two layout.ld files present: the file in OUT_DIR from libtock_runtime\u0027s build script and a leftover layout.ld file from the last time libtock was compiled. The linker selected the layout.ld file in the libtock package, which is not the one we wanted it to select. There isn\u0027t a way to change this behavior by the linker.\n\nTo avoid this, I changed libtock\u0027s build script to copy its layout.ld into OUT_DIR, isolating it from libtock_runtime. I also removed layout.ld from .gitignore. So that the include from layout.ld to layout_generic.ld works, I also made it copy layout_generic.ld into OUT_DIR (the same way libtock_runtime\u0027s new build script works).\n\nThis then broke libtock_core\u0027s example, `empty_main`. libtock_core does not have a linker script mechanism, and its build was relying on the presence of layout.ld from libtock\u0027s build script. This is a bug, and was never caught.\n\nI added the `empty_main` example before I redirected my libtock_platform efforts at Tock 2.0. At that time, I was planning to add libtock_runtime to libtock_core. However, when I changed my libtock_platform efforts to the Tock 2.0 ABI, it was no longer possible to add libtock_runtime to libtock_core. It also means that empty_main isn\u0027t very useful (it measures the size of code I\u0027m replacing rather than refactoring), so I deleted it.\n\n[1] https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ae858ab75c1a7637e10b1b4b8fe621af44f74d51",
      "old_mode": 33188,
      "old_path": ".gitignore",
      "new_id": "2bcb93fec5f7c866d6ef3e29866592cd44d63055",
      "new_mode": 33188,
      "new_path": ".gitignore"
    },
    {
      "type": "modify",
      "old_id": "b24d3d2ebdcdf12733c82162537103b46ff7353f",
      "old_mode": 33188,
      "old_path": "build.rs",
      "new_id": "bc492f90844be7cdb1b34d150a6de5d5543fe7d0",
      "new_mode": 33188,
      "new_path": "build.rs"
    },
    {
      "type": "delete",
      "old_id": "a3644b7e657aa6b8c8ed9b3b855ea18b6d95336e",
      "old_mode": 33188,
      "old_path": "core/examples/empty_main.rs",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    }
  ]
}
