{"action":"created","comment":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/201283847","pull_request_review_id":135752319,"id":201283847,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTI4Mzg0Nw==","diff_hunk":"@@ -0,0 +1,47 @@\n+#!/usr/bin/env bash\n+# Prepare environment variables for building and running tests.\n+# This requires executables and libraries to be able to find libjvm and Rust stdlib.\n+#\n+# ¡Keep it MacOS/Ubuntu compatible!\n+#\n+# This profile contains:\n+# - JAVA_HOME - path to currently selected JDK.\n+#   jni-rs with enabled the invocation feature fails to build without JAVA_HOME.\n+# - JAVA_LIB_DIR - path to libjvm.\n+# - RUST_LIB_DIR - path to Rust stdlib.\n+# - RUST_VERSION - Rust version for building tests.\n+# - RUSTFLAGS - Rust build options augmented with JAVA_LIB_DIR and RUST_LIB_DIR.\n+#   That adds paths into search paths where native code at runtime will look for\n+#   dynamically loadable libraries.\n+#   On Linux it is RUNPATH, so LD_LIBRARY_PATH is examined before.\n+#   On MacOS it extends @rpath, so LD_LIBRARY_PATH works as usually.\n+#   This affects all executables (application, tests, libjava_bindings).\n+#   It worth nothing that recent releases of MacOS with enabled by default SIP\n+#   clear LD_LIBRARY_PATH when new shell started.\n+#   Such behavior greatly affects Maven and all that it runs.\n+#   Setting rpath is a good way to fix this flaw in tests.\n+#   On Linux, it is not important whether to prefer RUNPATH or LD_LIBRARY_PATH.\n+\n+\n+# Use the Java that Maven uses.\n+#\n+# Unfortunately, a simple `which java` will not work for some users (e.g., jenv),\n+# hence this a bit complex thing.\n+export JAVA_HOME=\"$(mvn --version | grep 'Java home' | sed 's/.*: //')\"\n+echo \"JAVA_HOME=${JAVA_HOME}\"\n+\n+# Find the directory containing libjvm (the relative path has changed in Java 9).\n+export JAVA_LIB_DIR=\"$(find ${JAVA_HOME} -type f -name libjvm.\\* | xargs -n1 dirname)\"\n+echo \"JAVA_LIB_DIR=${JAVA_LIB_DIR}\"\n+\n+# Version of Rust used to build tests.\n+export RUST_VERSION=\"stable\"\n+echo \"RUST_VERSION: ${RUST_VERSION}\"\n+\n+# Find the directory containing Rust libstd.\n+export RUST_LIB_DIR=$(rustup run ${RUST_VERSION} rustc --print sysroot)/lib\n+echo \"RUST_LIB_DIR: ${RUST_LIB_DIR}\"\n+\n+# Linking options with additional paths for the application and tests.\n+export RUSTFLAGS=\"${RUSTFLAGS:-} -C link-args=-Wl,-rpath,${RUST_LIB_DIR},-rpath,${JAVA_LIB_DIR}\"","path":"tests_profile","position":46,"original_position":46,"commit_id":"1057988ca2b6940664d029cff669754f7dfca91a","original_commit_id":"1057988ca2b6940664d029cff669754f7dfca91a","user":{"login":"alexander-irbis","id":1448323,"node_id":"MDQ6VXNlcjE0NDgzMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1448323?v=4","gravatar_id":"","url":"https://api.github.com/users/alexander-irbis","html_url":"https://github.com/alexander-irbis","followers_url":"https://api.github.com/users/alexander-irbis/followers","following_url":"https://api.github.com/users/alexander-irbis/following{/other_user}","gists_url":"https://api.github.com/users/alexander-irbis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-irbis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-irbis/subscriptions","organizations_url":"https://api.github.com/users/alexander-irbis/orgs","repos_url":"https://api.github.com/users/alexander-irbis/repos","events_url":"https://api.github.com/users/alexander-irbis/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-irbis/received_events","type":"User","site_admin":false},"body":"I take into account existing value of RUSTFLAGS and add \"-C link-args\" to it.\r\nBut it will no affect a scoupe outer to that, where was called the \"source\" command.\r\nAfter restart the script re-evaluates new JAVA_HOME and new JAVA_LIB_DIR.\r\nOnly conflict we can expect is a presense of the \"-C link-args\" option before tests_profile, it will be overrided by our one.\r\nBut correct parsing and modifiing of RUSTFLAGS will not be easy task.\r\nShould we do it now, or should we allow a user with such nontrivial environment resolve conflict on his own?","created_at":"2018-07-10T09:56:10Z","updated_at":"2018-07-10T09:56:10Z","html_url":"https://github.com/exonum/exonum-java-binding/pull/336#discussion_r201283847","pull_request_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/201283847"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/336#discussion_r201283847"},"pull_request":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336"}},"in_reply_to_id":201243057},"pull_request":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336","id":198973427,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTczNDI3","html_url":"https://github.com/exonum/exonum-java-binding/pull/336","diff_url":"https://github.com/exonum/exonum-java-binding/pull/336.diff","patch_url":"https://github.com/exonum/exonum-java-binding/pull/336.patch","issue_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/336","number":336,"state":"open","locked":false,"title":"Improve build on Mac (with SIP) [ECR-1793]","user":{"login":"alexander-irbis","id":1448323,"node_id":"MDQ6VXNlcjE0NDgzMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1448323?v=4","gravatar_id":"","url":"https://api.github.com/users/alexander-irbis","html_url":"https://github.com/alexander-irbis","followers_url":"https://api.github.com/users/alexander-irbis/followers","following_url":"https://api.github.com/users/alexander-irbis/following{/other_user}","gists_url":"https://api.github.com/users/alexander-irbis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-irbis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-irbis/subscriptions","organizations_url":"https://api.github.com/users/alexander-irbis/orgs","repos_url":"https://api.github.com/users/alexander-irbis/repos","events_url":"https://api.github.com/users/alexander-irbis/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-irbis/received_events","type":"User","site_admin":false},"body":"## Overview\r\n\r\nReplaces a usage of LD_LIBRARY_PATH in run time with the rpath linker option. \r\n\r\n---\r\nSee: https://jira.bf.local/browse/ECR-1793\r\n\r\n\r\n### Definition of Done\r\n\r\n- [ ] Build instructions are updated\r\n- [x] There are no TODOs left in the code\r\n- [x] Change is covered by automated [tests](https://github.com/exonum/exonum-java-binding/blob/master/CONTRIBUTING.md#tests)\r\n- [x] The [continuous integration build](https://www.travis-ci.org/exonum/exonum-java-binding) passes\r\n","created_at":"2018-07-03T14:00:03Z","updated_at":"2018-07-10T09:56:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b9f9986d37705929b844b630020625af5aa1439","assignee":null,"assignees":[],"requested_reviewers":[{"login":"DarkEld3r","id":2997902,"node_id":"MDQ6VXNlcjI5OTc5MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/2997902?v=4","gravatar_id":"","url":"https://api.github.com/users/DarkEld3r","html_url":"https://github.com/DarkEld3r","followers_url":"https://api.github.com/users/DarkEld3r/followers","following_url":"https://api.github.com/users/DarkEld3r/following{/other_user}","gists_url":"https://api.github.com/users/DarkEld3r/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkEld3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkEld3r/subscriptions","organizations_url":"https://api.github.com/users/DarkEld3r/orgs","repos_url":"https://api.github.com/users/DarkEld3r/repos","events_url":"https://api.github.com/users/DarkEld3r/events{/privacy}","received_events_url":"https://api.github.com/users/DarkEld3r/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336/commits","review_comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336/comments","review_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/336/comments","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/1057988ca2b6940664d029cff669754f7dfca91a","head":{"label":"alexander-irbis:ultimately-fix-macos-ld_library_path-ECR-1793","ref":"ultimately-fix-macos-ld_library_path-ECR-1793","sha":"1057988ca2b6940664d029cff669754f7dfca91a","user":{"login":"alexander-irbis","id":1448323,"node_id":"MDQ6VXNlcjE0NDgzMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1448323?v=4","gravatar_id":"","url":"https://api.github.com/users/alexander-irbis","html_url":"https://github.com/alexander-irbis","followers_url":"https://api.github.com/users/alexander-irbis/followers","following_url":"https://api.github.com/users/alexander-irbis/following{/other_user}","gists_url":"https://api.github.com/users/alexander-irbis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-irbis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-irbis/subscriptions","organizations_url":"https://api.github.com/users/alexander-irbis/orgs","repos_url":"https://api.github.com/users/alexander-irbis/repos","events_url":"https://api.github.com/users/alexander-irbis/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-irbis/received_events","type":"User","site_admin":false},"repo":{"id":138063232,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgwNjMyMzI=","name":"exonum-java-binding","full_name":"alexander-irbis/exonum-java-binding","owner":{"login":"alexander-irbis","id":1448323,"node_id":"MDQ6VXNlcjE0NDgzMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1448323?v=4","gravatar_id":"","url":"https://api.github.com/users/alexander-irbis","html_url":"https://github.com/alexander-irbis","followers_url":"https://api.github.com/users/alexander-irbis/followers","following_url":"https://api.github.com/users/alexander-irbis/following{/other_user}","gists_url":"https://api.github.com/users/alexander-irbis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-irbis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-irbis/subscriptions","organizations_url":"https://api.github.com/users/alexander-irbis/orgs","repos_url":"https://api.github.com/users/alexander-irbis/repos","events_url":"https://api.github.com/users/alexander-irbis/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-irbis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexander-irbis/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":true,"url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding","forks_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/alexander-irbis/exonum-java-binding/deployments","created_at":"2018-06-20T17:12:54Z","updated_at":"2018-06-20T17:12:57Z","pushed_at":"2018-07-09T10:33:26Z","git_url":"git://github.com/alexander-irbis/exonum-java-binding.git","ssh_url":"git@github.com:alexander-irbis/exonum-java-binding.git","clone_url":"https://github.com/alexander-irbis/exonum-java-binding.git","svn_url":"https://github.com/alexander-irbis/exonum-java-binding","homepage":"http://exonum.com","size":1678,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"exonum:master","ref":"master","sha":"5af6dcafbd35a59511ae593ff8affe0216bf7aeb","user":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"repo":{"id":92375988,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3NTk4OA==","name":"exonum-java-binding","full_name":"exonum/exonum-java-binding","owner":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exonum/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":false,"url":"https://api.github.com/repos/exonum/exonum-java-binding","forks_url":"https://api.github.com/repos/exonum/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/exonum/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exonum/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exonum/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/exonum/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/exonum/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/exonum/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/exonum/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/exonum/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/exonum/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/exonum/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/exonum/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/exonum/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exonum/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/exonum/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exonum/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/exonum/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/exonum/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exonum/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/exonum/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/exonum/exonum-java-binding/deployments","created_at":"2017-05-25T07:12:56Z","updated_at":"2018-07-09T19:50:03Z","pushed_at":"2018-07-10T09:10:03Z","git_url":"git://github.com/exonum/exonum-java-binding.git","ssh_url":"git@github.com:exonum/exonum-java-binding.git","clone_url":"https://github.com/exonum/exonum-java-binding.git","svn_url":"https://github.com/exonum/exonum-java-binding","homepage":"http://exonum.com","size":1686,"stargazers_count":39,"watchers_count":39,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":8,"open_issues":21,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/336"},"issue":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/336"},"comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/1057988ca2b6940664d029cff669754f7dfca91a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexander-irbis"}}