{"action":"created","issue":{"url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/42","repository_url":"https://api.github.com/repos/burtonageo/cargo-bundle","labels_url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/42/comments","events_url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/42/events","html_url":"https://github.com/burtonageo/cargo-bundle/issues/42","id":294670420,"number":42,"title":"Make cargo-build cargo workspace aware","user":{"login":"andrewdavidmackenzie","id":5529132,"avatar_url":"https://avatars2.githubusercontent.com/u/5529132?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewdavidmackenzie","html_url":"https://github.com/andrewdavidmackenzie","followers_url":"https://api.github.com/users/andrewdavidmackenzie/followers","following_url":"https://api.github.com/users/andrewdavidmackenzie/following{/other_user}","gists_url":"https://api.github.com/users/andrewdavidmackenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewdavidmackenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewdavidmackenzie/subscriptions","organizations_url":"https://api.github.com/users/andrewdavidmackenzie/orgs","repos_url":"https://api.github.com/users/andrewdavidmackenzie/repos","events_url":"https://api.github.com/users/andrewdavidmackenzie/events{/privacy}","received_events_url":"https://api.github.com/users/andrewdavidmackenzie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-06T08:27:05Z","updated_at":"2018-02-25T00:59:41Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Problem\r\n===\r\nAt the moment cargo-build is not aware of cargo workspaces.\r\n\r\nSo, when it is used in a \"member\" project of a workspace the target directory is calculated incorrectly, and it does not find the files constructed (e.g. binary) by cargo prior to it running and they cannot be packaged.\r\n\r\nRunning cargo bundle currently in a member directory of such a project will lead to this output:\r\n\r\n```\r\ncargo bundle\r\n    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs\r\n    Bundling flowc.app\r\nError: the source path is not an existing regular file\r\n```\r\n\r\nProposed Solution\r\n===\r\nMake cargo-build aware of workspaces. \r\n\r\nWhen it runs, search for cargo workspaces in the parent directories (need to check if that is recursive and multiple levels or not), and parse that Cargo.toml to determine the correct target directory to us.\r\n\r\nNeed to check for any ways that the standard target directory can be overridden. \r\nAccording to this issue (https://github.com/rust-lang/cargo/pull/1657) there are at least two:\r\n\r\n`build.target-dir configuration key\r\n`\r\n(I'm not sure if that is in Cargo.toml, or any of the .cargo/config files that might apply!)\r\n\r\n`CARGO_TARGET_DIR=foo; cargo run args\r\n`\r\n\r\nI suspect I might not get all that 100% correct first time, but help fleshing out the correct spec and algorithm for determining what the `target` directory should be would be appreciated."},"comment":{"url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/comments/368273481","html_url":"https://github.com/burtonageo/cargo-bundle/issues/42#issuecomment-368273481","issue_url":"https://api.github.com/repos/burtonageo/cargo-bundle/issues/42","id":368273481,"user":{"login":"andrewdavidmackenzie","id":5529132,"avatar_url":"https://avatars2.githubusercontent.com/u/5529132?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewdavidmackenzie","html_url":"https://github.com/andrewdavidmackenzie","followers_url":"https://api.github.com/users/andrewdavidmackenzie/followers","following_url":"https://api.github.com/users/andrewdavidmackenzie/following{/other_user}","gists_url":"https://api.github.com/users/andrewdavidmackenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewdavidmackenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewdavidmackenzie/subscriptions","organizations_url":"https://api.github.com/users/andrewdavidmackenzie/orgs","repos_url":"https://api.github.com/users/andrewdavidmackenzie/repos","events_url":"https://api.github.com/users/andrewdavidmackenzie/events{/privacy}","received_events_url":"https://api.github.com/users/andrewdavidmackenzie/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T00:59:40Z","updated_at":"2018-02-25T00:59:40Z","author_association":"CONTRIBUTOR","body":"We can close this issue now, no?\r\n\r\nA release with support for workspaces would be great now, and then I'd work on the original need to bundle resources from libs...."}}
{"actor":{"display_login":"andrewdavidmackenzie"}}