{"action":"closed","issue":{"url":"https://api.github.com/repos/bsansouci/jengaroot/issues/3","repository_url":"https://api.github.com/repos/bsansouci/jengaroot","labels_url":"https://api.github.com/repos/bsansouci/jengaroot/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/bsansouci/jengaroot/issues/3/comments","events_url":"https://api.github.com/repos/bsansouci/jengaroot/issues/3/events","html_url":"https://github.com/bsansouci/jengaroot/issues/3","id":151202686,"number":3,"title":"Perceived differences between jengaroot and magic","user":{"login":"bsansouci","id":4534692,"avatar_url":"https://avatars.githubusercontent.com/u/4534692?v=3","gravatar_id":"","url":"https://api.github.com/users/bsansouci","html_url":"https://github.com/bsansouci","followers_url":"https://api.github.com/users/bsansouci/followers","following_url":"https://api.github.com/users/bsansouci/following{/other_user}","gists_url":"https://api.github.com/users/bsansouci/gists{/gist_id}","starred_url":"https://api.github.com/users/bsansouci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsansouci/subscriptions","organizations_url":"https://api.github.com/users/bsansouci/orgs","repos_url":"https://api.github.com/users/bsansouci/repos","events_url":"https://api.github.com/users/bsansouci/events{/privacy}","received_events_url":"https://api.github.com/users/bsansouci/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-26T18:13:32Z","updated_at":"2016-05-12T06:06:49Z","closed_at":"2016-05-12T06:06:49Z","body":"This is more of tracker issue, or an open discussion, about the best way to modify jengaroot to fit our needs.\r\nUltimately, we want one jbuild file (or package.json) at the top level (project root) that describe everything needed to build the whole project. We might have jbuild files in the dependency folder (if they get publish with it) that would describe how to build that dependency. We also want to have all build artifacts in `topLevelDir/_build` instead of mingled with the source code.\r\n\r\nRight now the problem seems to be that jengaroot crawls the directory tree and checks for jbuild files in every folder, which are then used to generate rules which cannot have targets outside of the current scope directory (where the jbuild file is). This is enforced by `check_for_non_local_rules`. I'm guessing the reason for this restriction is to avoid circular dependencies between build artifacts causing the build process to never reach a fixed point. Though this makes sense with the current way jengaroot works, we need to generate all artifacts inside a `_build` folder.\r\n\r\nMy guess as a way to approach this is to basically modify [executables_rules](https://github.com/bsansouci/jengaroot/blob/9249e8bfa4b85230bc097a0393726d648dfbea33/jenga/root.ml#L4098) to use recursively build from a `src` folder using [native_compile_ml](https://github.com/bsansouci/jengaroot/blob/9249e8bfa4b85230bc097a0393726d648dfbea33/jenga/root.ml#L2838) or [byte_compile_ml](https://github.com/bsansouci/jengaroot/blob/9249e8bfa4b85230bc097a0393726d648dfbea33/jenga/root.ml#L2894) and then modify [link_executable](https://github.com/bsansouci/jengaroot/blob/9249e8bfa4b85230bc097a0393726d648dfbea33/jenga/root.ml#L4045) to link against `topLevelDir/_build/...` build artifacts instead of `topLevelDir/src/...`.\r\n\r\nThis would break the symmetry of jengaroot, where each sub-folder decides on how to compile its code, and its parent doesn't need to know anything about it (or jenga will error if it can't find modules etc...). I'm not sure why we'd want that \"purity\", because it prevents us from moving the build artifacts inside a specific folder. "}}