{"action":"closed","issue":{"url":"https://api.github.com/repos/github/licensed/issues/53","repository_url":"https://api.github.com/repos/github/licensed","labels_url":"https://api.github.com/repos/github/licensed/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/github/licensed/issues/53/comments","events_url":"https://api.github.com/repos/github/licensed/issues/53/events","html_url":"https://github.com/github/licensed/issues/53","id":332917910,"node_id":"MDU6SXNzdWUzMzI5MTc5MTA=","number":53,"title":"Bundler source doesn't work from exe built with ruby-packer","user":{"login":"jonabc","id":5263772,"node_id":"MDQ6VXNlcjUyNjM3NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/5263772?v=4","gravatar_id":"","url":"https://api.github.com/users/jonabc","html_url":"https://github.com/jonabc","followers_url":"https://api.github.com/users/jonabc/followers","following_url":"https://api.github.com/users/jonabc/following{/other_user}","gists_url":"https://api.github.com/users/jonabc/gists{/gist_id}","starred_url":"https://api.github.com/users/jonabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonabc/subscriptions","organizations_url":"https://api.github.com/users/jonabc/orgs","repos_url":"https://api.github.com/users/jonabc/repos","events_url":"https://api.github.com/users/jonabc/events{/privacy}","received_events_url":"https://api.github.com/users/jonabc/received_events","type":"User","site_admin":true},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-15T21:22:41Z","updated_at":"2018-06-22T18:10:28Z","closed_at":"2018-06-22T18:10:28Z","author_association":"COLLABORATOR","body":"##### Background\r\nhttps://github.com/github/licensed/issues/50 talks about options for creating easily distributable ways of running licensed from non-ruby environments.\r\n\r\nLooking specifically at the executable options, I believe [ruby-packer](https://github.com/pmq20/ruby-packer) is a better choice due to it's easier build pipeline and packaging structure; ruby-packers single executable vs traveling-rubys script + ruby + app.\r\n\r\nThe ruby-packer-built executable contains a squashed file system with ruby + app which leads to...\r\n\r\n##### The problem\r\nWhen licensed is run on the squashed container file system in the executable, the containers rubygems code is used.  In the ruby-packer project, rubygems has local edits that explicitly disallow loading gem paths from outside the container - ([1](https://github.com/pmq20/ruby-packer/blob/e3d28dc56a9afe31e10639b9ae9afa95ec96300b/ruby/lib/rubygems/path_support.rb#L28-L33) [2](https://github.com/pmq20/ruby-packer/blob/e3d28dc56a9afe31e10639b9ae9afa95ec96300b/ruby/lib/rubygems/path_support.rb#L41-L48))\r\n\r\nThis issue presents itself when using `::Bundler::Definition#specs`.  The method turns un-evaluated specifications (LazySpecification) into materialized specifications (Specification).  When Bundler looks through it's known specification sources, it's sources are evaluated using rubygems paths and can only find information from inside of the ruby-packer executables file system.\r\n\r\nThis doesn't work well with the bundler source, who's entire job is to load gemspecs which always exist outside of the container file system. 💣 💥 \r\n\r\n##### The solution\r\nBundler does a lot and needs to support a large number of scenarios.  licensed does not - it requires that bundler has already been run and the environment is ready for sourcing dependencies.  In this scenario information is available at known paths.  Given that information, licensed can sidestep using `::Bundler::Definition#specs` entirely.\r\n\r\nLicensed should be able to get by with the specification information from `::Bundler::Definition#resolve` combined with `::Bundler#specs_path`.  The latter information isn't built using path information from rubygems, which makes it 👍 to configure for use outside of the ruby-packer executable's file system."}}
{"actor":{"display_login":"jonabc"}}