{"action":"created","issue":{"url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/74","repository_url":"https://api.github.com/repos/facebookexperimental/reason-native","labels_url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/74/comments","events_url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/74/events","html_url":"https://github.com/facebookexperimental/reason-native/pull/74","id":395410027,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODcwNzI4","number":74,"title":"[DO NOT MERGE] Configure esy monorepo workflow (2)","user":{"login":"andreypopp","id":30594,"node_id":"MDQ6VXNlcjMwNTk0","avatar_url":"https://avatars0.githubusercontent.com/u/30594?v=4","gravatar_id":"","url":"https://api.github.com/users/andreypopp","html_url":"https://github.com/andreypopp","followers_url":"https://api.github.com/users/andreypopp/followers","following_url":"https://api.github.com/users/andreypopp/following{/other_user}","gists_url":"https://api.github.com/users/andreypopp/gists{/gist_id}","starred_url":"https://api.github.com/users/andreypopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreypopp/subscriptions","organizations_url":"https://api.github.com/users/andreypopp/orgs","repos_url":"https://api.github.com/users/andreypopp/repos","events_url":"https://api.github.com/users/andreypopp/events{/privacy}","received_events_url":"https://api.github.com/users/andreypopp/received_events","type":"User","site_admin":false},"labels":[{"id":1032158715,"node_id":"MDU6TGFiZWwxMDMyMTU4NzE1","url":"https://api.github.com/repos/facebookexperimental/reason-native/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-01-02T23:06:41Z","updated_at":"2019-01-03T10:05:35Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/facebookexperimental/reason-native/pulls/74","html_url":"https://github.com/facebookexperimental/reason-native/pull/74","diff_url":"https://github.com/facebookexperimental/reason-native/pull/74.diff","patch_url":"https://github.com/facebookexperimental/reason-native/pull/74.patch"},"body":"This is a 2nd attempt at esy monorepo workflow (replaces #42).\n\nThe PR works only with esy nightly builds for now:\n\n```\n% npm install -g @esy-nightly/esy\n```\n\n### How it works\n\n`esy.json` links to each package in the repository using\n`link-dev:./path/to/package.json`.\n\nEach package linked with `link-dev:` behaves exactly like a root package in a regular esy workflow:\n\n- Its corresponding `\"devDependencies\"` are installed\n- `\"buildDev\"` command is executed on build (if it's defined, falls back to `\"build\"`)\n- Build commands have access to their corresponding `\"devDependencies\"`\n\n### Workflow\n\nInstall dependencies:\n\n```\n% esy install\n```\n\nBuild dependencies (each package has access to its `\"devDependencies\"`, runs\n`\"buildDev\"` command if it's defined):\n\n```\n% esy build\n```\n\nBuild dependencies in release mode (run `\"build\"` command w/o access to `\"devDependencies\"`):\n\n```\n% esy build --release\n```\n\n### Discussion\n\n##### Is it possible to run builds commands for a specified package?\n\nYes, use `esy build-package` command:\n\n```\n% esy build-package ./rely.json\n```\n\n##### Is it possible to run commands in a build env of a specified package?\n\nYes, use `esy build-exec` command:\n\n```\n% esy build-exec ./rely.json ls\n```\n\nThe command `esy build-exec CMD` is an analogue of `esy build CMD` command but\nallows to specify the package.\n\n##### Is it possible to make change detection more granular?\n\nWhen one changes sources (do `touch ./src/console/Console.re` for example) all\npackages are being rebuilt (actually they are not being rebuilt, esy just runs\nbuild commands but as dune works incrementally those commands are noop).\n\nIt's possible to make esy detect changes in a more granular fashin but that requires moving package roots into different dirs, for example:\n\n```\n% mv rely.json src/rely/package.json\n```\n\nI've experimented with this approach and it doesn't work with the current setup\nfor `common` - if we move package root to the `src/` then `copy_files` doesn't\nwork as it can't copy files from outside the package root.\n\nIf we change how we vendor code from `common/` dir we can enable more granular\nchange detection with esy.\n\n### Changes\n\n- 394ecfc\n\n  Convert to esy monorepo\n\n  - `esy.json` links to all packages via `link-dev:` This collects & installs\n  all `\"devDependencies\"` for packages and makes them available to `'build\"`\n  command (or `\"buildDev\"` if it's configured).\n\n  - Fixes `src/refmterr/lib/dune` to have access to `Common` (not sure why it's\n  worked before).\n\n  - Adds `\"buildDev\"` with `refmterr` for those packages\n  (`file-context-printer`) which only rely on `refmterr` in dev.\n\n- c53ee3f\n\n  Add @reason-native/tests package\n\n  This package hosts tests.\n\n- 1d24018\n\n  Use esydune wrapper for dune\n\n  This configures `\"build\"` (and `\"buildDev\"` where needed) with `esydune`\n  instead of `dune`. This makes sure we invoke dune with the right arguments,\n  this effectively enables warnings in reason-native.\n\n  Then this commits update `dune` files with flags to disable erroring on 29\n  (unused bindings) and 9 (unbound record fields in patterns) warnings.\n\n- 5310521 Update esy.lock (not for review)"},"comment":{"url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/comments/451100386","html_url":"https://github.com/facebookexperimental/reason-native/pull/74#issuecomment-451100386","issue_url":"https://api.github.com/repos/facebookexperimental/reason-native/issues/74","id":451100386,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTEwMDM4Ng==","user":{"login":"andreypopp","id":30594,"node_id":"MDQ6VXNlcjMwNTk0","avatar_url":"https://avatars0.githubusercontent.com/u/30594?v=4","gravatar_id":"","url":"https://api.github.com/users/andreypopp","html_url":"https://github.com/andreypopp","followers_url":"https://api.github.com/users/andreypopp/followers","following_url":"https://api.github.com/users/andreypopp/following{/other_user}","gists_url":"https://api.github.com/users/andreypopp/gists{/gist_id}","starred_url":"https://api.github.com/users/andreypopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreypopp/subscriptions","organizations_url":"https://api.github.com/users/andreypopp/orgs","repos_url":"https://api.github.com/users/andreypopp/repos","events_url":"https://api.github.com/users/andreypopp/events{/privacy}","received_events_url":"https://api.github.com/users/andreypopp/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T10:05:35Z","updated_at":"2019-01-03T10:05:35Z","author_association":"COLLABORATOR","body":"> I'm confused because I thought that for linked packages with out of source\r\n> builds, esy won't do anything to try to do change detection, it will just call\r\n> the build system for each linked package and expect it to be incremental.  What\r\n> would we gain by doing some more granular sub-package change detection for\r\n> linked packages if we never use that change detection for linked packages?\r\n\r\nNope, we always check for staleness but I think we could indeed don't do that for out of source builds."}}
{"actor":{"display_login":"andreypopp"}}