{"action":"created","comment":{"url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/comments/178640548","pull_request_review_id":108730691,"id":178640548,"diff_hunk":"@@ -0,0 +1,202 @@\n+/* Copyright 2016 Endless Mobile, Inc. */\n+\n+#include <gio/gio.h>\n+#include <glib.h>\n+\n+#include <string.h>\n+\n+static char *services_version;\n+\n+static GOptionEntry entries[] = {\n+  { \"services-version\", 's', 0, G_OPTION_ARG_STRING, &services_version, \"The eks-search-provider version to use\", \"VERSION\" },\n+  { NULL }\n+};\n+\n+static GSubprocess *\n+spawnv_with_appended_paths_and_fds (const char * const  *argv,\n+                                    const char * const  *executable_paths,\n+                                    const char * const  *ld_library_paths,\n+                                    const char * const  *xdg_data_dirs,\n+                                    GError             **error)\n+{\n+  g_autoptr(GSubprocessLauncher) launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_INHERIT_FDS);\n+  g_autofree char *executable_path_variable = g_strjoinv (\":\", (GStrv) executable_paths);\n+  g_autofree char *ld_library_path_variable = g_strjoinv (\":\", (GStrv) ld_library_paths);\n+  g_autofree char *xdg_data_dirs_variable = g_strjoinv (\":\", (GStrv) xdg_data_dirs);\n+\n+  g_subprocess_launcher_setenv (launcher, \"PATH\", executable_path_variable, TRUE);\n+  g_subprocess_launcher_setenv (launcher, \"LD_LIBRARY_PATH\", ld_library_path_variable, TRUE);\n+  g_subprocess_launcher_setenv (launcher, \"XDG_DATA_DIRS\", xdg_data_dirs_variable, TRUE);\n+\n+  return g_subprocess_launcher_spawnv (launcher, argv, error); \n+}\n+\n+/* Try and find an installed and mounted SDK with the highest priority,\n+ * the first item having the highest priority. */\n+static gboolean\n+find_sdk_with_highest_priority (const char * const  *sdks_in_priority_order,\n+                                const char          **out_sdk,\n+                                GError             **error)","path":"multi-services/eks-multi-services-dispatcher.c","position":39,"original_position":39,"commit_id":"9c462039ba0c57da92beda999ddc56605c9f1b7a","original_commit_id":"9c462039ba0c57da92beda999ddc56605c9f1b7a","user":{"login":"smspillaz","id":775309,"avatar_url":"https://avatars3.githubusercontent.com/u/775309?v=4","gravatar_id":"","url":"https://api.github.com/users/smspillaz","html_url":"https://github.com/smspillaz","followers_url":"https://api.github.com/users/smspillaz/followers","following_url":"https://api.github.com/users/smspillaz/following{/other_user}","gists_url":"https://api.github.com/users/smspillaz/gists{/gist_id}","starred_url":"https://api.github.com/users/smspillaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smspillaz/subscriptions","organizations_url":"https://api.github.com/users/smspillaz/orgs","repos_url":"https://api.github.com/users/smspillaz/repos","events_url":"https://api.github.com/users/smspillaz/events{/privacy}","received_events_url":"https://api.github.com/users/smspillaz/received_events","type":"User","site_admin":false},"body":"It should, if it doesn't that's my omission","created_at":"2018-04-02T20:26:12Z","updated_at":"2018-04-02T20:26:12Z","html_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1#discussion_r178640548","pull_request_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/comments/178640548"},"html":{"href":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1#discussion_r178640548"},"pull_request":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1"}},"in_reply_to_id":178635755},"pull_request":{"url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1","id":178677736,"html_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1","diff_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1.diff","patch_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1.patch","issue_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/1","number":1,"state":"open","locked":false,"title":"multi-services: Add com.endlessm.EknServicesMultiplexer flatpak","user":{"login":"smspillaz","id":775309,"avatar_url":"https://avatars3.githubusercontent.com/u/775309?v=4","gravatar_id":"","url":"https://api.github.com/users/smspillaz","html_url":"https://github.com/smspillaz","followers_url":"https://api.github.com/users/smspillaz/followers","following_url":"https://api.github.com/users/smspillaz/following{/other_user}","gists_url":"https://api.github.com/users/smspillaz/gists{/gist_id}","starred_url":"https://api.github.com/users/smspillaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smspillaz/subscriptions","organizations_url":"https://api.github.com/users/smspillaz/orgs","repos_url":"https://api.github.com/users/smspillaz/repos","events_url":"https://api.github.com/users/smspillaz/events{/privacy}","received_events_url":"https://api.github.com/users/smspillaz/received_events","type":"User","site_admin":false},"body":"This actually adds two build manifests. The first,\r\ncom.endlessm.BaseEknServicesMultiplexer is a \"base\" flatpak which merely\r\nadds the extension points for the extensions defined in each\r\neos-knowledge-services version (eg, com.endlessm.EknSerivces.Extension).\r\n\r\nThat flatpak is then used as a \"base\" for com.endlessm.EknServicesMultiplexer\r\nwhich will get those extensions mounted at build-time so that we can copy\r\ntheir contents into the right place in com.endlessm.EknServicesMultiplexer.\r\n\r\ncom.endlessm.EknServicesMultiplexer itself is made up of a few things. First,\r\nit mounts every available SDK as an extension using the flatpak \"tagged extension\r\nnames\" feature introduced in flatpak 0.11.4. Second, it exports the d-bus service\r\nfiles for each eos-knowledge-services version, all of which point to a \"multiplexer\"\r\nbinary.\r\n\r\nThe \"multiplexer\" binary (eks-multi-services-dispatcher) takes a single argument,\r\n--services-version and uses that to try and find the highest-versioned compatible\r\nSDK and sets LD_LIBRARY_PATH and friends, then executes the correct eks-search-provider\r\nbinary that was copied in place at build time.\r\n\r\nhttps://phabricator.endlessm.com/T21822","created_at":"2018-03-31T11:08:23Z","updated_at":"2018-04-02T20:26:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b639f3a946bc73d493efdd41eb34c9e49c96971a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1/commits","review_comments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1/comments","review_comment_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/1/comments","statuses_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/statuses/9c462039ba0c57da92beda999ddc56605c9f1b7a","head":{"label":"endlessm:T21822","ref":"T21822","sha":"9c462039ba0c57da92beda999ddc56605c9f1b7a","user":{"login":"endlessm","id":1930958,"avatar_url":"https://avatars1.githubusercontent.com/u/1930958?v=4","gravatar_id":"","url":"https://api.github.com/users/endlessm","html_url":"https://github.com/endlessm","followers_url":"https://api.github.com/users/endlessm/followers","following_url":"https://api.github.com/users/endlessm/following{/other_user}","gists_url":"https://api.github.com/users/endlessm/gists{/gist_id}","starred_url":"https://api.github.com/users/endlessm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endlessm/subscriptions","organizations_url":"https://api.github.com/users/endlessm/orgs","repos_url":"https://api.github.com/users/endlessm/repos","events_url":"https://api.github.com/users/endlessm/events{/privacy}","received_events_url":"https://api.github.com/users/endlessm/received_events","type":"Organization","site_admin":false},"repo":{"id":127523685,"name":"eos-knowledge-services-multiplexer","full_name":"endlessm/eos-knowledge-services-multiplexer","owner":{"login":"endlessm","id":1930958,"avatar_url":"https://avatars1.githubusercontent.com/u/1930958?v=4","gravatar_id":"","url":"https://api.github.com/users/endlessm","html_url":"https://github.com/endlessm","followers_url":"https://api.github.com/users/endlessm/followers","following_url":"https://api.github.com/users/endlessm/following{/other_user}","gists_url":"https://api.github.com/users/endlessm/gists{/gist_id}","starred_url":"https://api.github.com/users/endlessm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endlessm/subscriptions","organizations_url":"https://api.github.com/users/endlessm/orgs","repos_url":"https://api.github.com/users/endlessm/repos","events_url":"https://api.github.com/users/endlessm/events{/privacy}","received_events_url":"https://api.github.com/users/endlessm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer","description":"Flatpak wrapper to ship and run multiple EknServices versions","fork":false,"url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer","forks_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/forks","keys_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/teams","hooks_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/hooks","issue_events_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/events{/number}","events_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/events","assignees_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/assignees{/user}","branches_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/branches{/branch}","tags_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/tags","blobs_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/refs{/sha}","trees_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/statuses/{sha}","languages_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/languages","stargazers_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/stargazers","contributors_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/contributors","subscribers_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/subscribers","subscription_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/subscription","commits_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/commits{/sha}","git_commits_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/commits{/sha}","comments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/comments{/number}","issue_comment_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/comments{/number}","contents_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/contents/{+path}","compare_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/merges","archive_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/downloads","issues_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues{/number}","pulls_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls{/number}","milestones_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/milestones{/number}","notifications_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/labels{/name}","releases_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/releases{/id}","deployments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/deployments","created_at":"2018-03-31T10:49:26Z","updated_at":"2018-03-31T11:07:46Z","pushed_at":"2018-04-02T09:23:55Z","git_url":"git://github.com/endlessm/eos-knowledge-services-multiplexer.git","ssh_url":"git@github.com:endlessm/eos-knowledge-services-multiplexer.git","clone_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer.git","svn_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"endlessm:master","ref":"master","sha":"ca5dfe036f64e54c31274b4cc9fc2363fbd27cf9","user":{"login":"endlessm","id":1930958,"avatar_url":"https://avatars1.githubusercontent.com/u/1930958?v=4","gravatar_id":"","url":"https://api.github.com/users/endlessm","html_url":"https://github.com/endlessm","followers_url":"https://api.github.com/users/endlessm/followers","following_url":"https://api.github.com/users/endlessm/following{/other_user}","gists_url":"https://api.github.com/users/endlessm/gists{/gist_id}","starred_url":"https://api.github.com/users/endlessm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endlessm/subscriptions","organizations_url":"https://api.github.com/users/endlessm/orgs","repos_url":"https://api.github.com/users/endlessm/repos","events_url":"https://api.github.com/users/endlessm/events{/privacy}","received_events_url":"https://api.github.com/users/endlessm/received_events","type":"Organization","site_admin":false},"repo":{"id":127523685,"name":"eos-knowledge-services-multiplexer","full_name":"endlessm/eos-knowledge-services-multiplexer","owner":{"login":"endlessm","id":1930958,"avatar_url":"https://avatars1.githubusercontent.com/u/1930958?v=4","gravatar_id":"","url":"https://api.github.com/users/endlessm","html_url":"https://github.com/endlessm","followers_url":"https://api.github.com/users/endlessm/followers","following_url":"https://api.github.com/users/endlessm/following{/other_user}","gists_url":"https://api.github.com/users/endlessm/gists{/gist_id}","starred_url":"https://api.github.com/users/endlessm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endlessm/subscriptions","organizations_url":"https://api.github.com/users/endlessm/orgs","repos_url":"https://api.github.com/users/endlessm/repos","events_url":"https://api.github.com/users/endlessm/events{/privacy}","received_events_url":"https://api.github.com/users/endlessm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer","description":"Flatpak wrapper to ship and run multiple EknServices versions","fork":false,"url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer","forks_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/forks","keys_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/teams","hooks_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/hooks","issue_events_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/events{/number}","events_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/events","assignees_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/assignees{/user}","branches_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/branches{/branch}","tags_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/tags","blobs_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/refs{/sha}","trees_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/statuses/{sha}","languages_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/languages","stargazers_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/stargazers","contributors_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/contributors","subscribers_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/subscribers","subscription_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/subscription","commits_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/commits{/sha}","git_commits_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/git/commits{/sha}","comments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/comments{/number}","issue_comment_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/comments{/number}","contents_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/contents/{+path}","compare_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/merges","archive_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/downloads","issues_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues{/number}","pulls_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls{/number}","milestones_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/milestones{/number}","notifications_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/labels{/name}","releases_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/releases{/id}","deployments_url":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/deployments","created_at":"2018-03-31T10:49:26Z","updated_at":"2018-03-31T11:07:46Z","pushed_at":"2018-04-02T09:23:55Z","git_url":"git://github.com/endlessm/eos-knowledge-services-multiplexer.git","ssh_url":"git@github.com:endlessm/eos-knowledge-services-multiplexer.git","clone_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer.git","svn_url":"https://github.com/endlessm/eos-knowledge-services-multiplexer","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1"},"html":{"href":"https://github.com/endlessm/eos-knowledge-services-multiplexer/pull/1"},"issue":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/1"},"comments":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/endlessm/eos-knowledge-services-multiplexer/statuses/9c462039ba0c57da92beda999ddc56605c9f1b7a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"smspillaz"}}