Skip to content

Commit 22ba6d9

Browse files
skletsundmitry-timofeev
authored andcommitted
Fix issue with stable Rust compiler [ECR-3073] (#884)
Fix the path to the 'java_bindings' library passed to JVM so that it matches the location of the library built and used by native ITs. This issue occurred since 1.32.0 on Mac only.
1 parent 8e8170f commit 22ba6d9

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ addons:
2929

3030
env:
3131
global:
32-
- RUST_COMPILER_VERSION=1.32.0
32+
- RUST_COMPILER_VERSION=stable
3333
- OSX_PACKAGES="libsodium rocksdb pkg-config protobuf"
3434
- ROCKSDB_LIB_DIR=/usr/lib
3535
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ You need to install the following dependencies:
1919
* Linux or macOS. Windows support is coming soon. <!-- TODO: Link Java roadmap when it is published -->
2020
* [JDK 1.8+](https://jdk.java.net/12/).
2121
* [Maven 3.5+](https://maven.apache.org/download.cgi).
22-
* [Rust 1.32.0](https://www.rust-lang.org/).
23-
To install a specific Rust version, use `rustup install 1.32.0` command.
22+
* [Stable Rust](https://www.rust-lang.org/tools/install).
2423
* The [system dependencies](https://exonum.com/doc/version/0.11/get-started/install/) of Exonum.
2524
You do _not_ need to manually fetch and compile Exonum.
2625
* For automatic packaging of the Exonum Java app you need [CMake](https://cmake.org/) installed in your system.

exonum-java-binding/core/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
<project.build.headersDirectory>${project.build.directory}/native-headers</project.build.headersDirectory>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24-
<!-- TODO: stable does not work well until ECR-1839 is resolved. -->
25-
<rust.compiler.version>1.32.0</rust.compiler.version>
26-
<rust.compiler.features>resource-manager</rust.compiler.features>
24+
<rust.compiler.version>stable</rust.compiler.version>
25+
<!-- Features for integration testing. At least "resource-manager" is required by Java integration tests. Ideally,
26+
keeping them in sync with the ones that `integration_tests` crate require from the `java_bindings` crate allows
27+
the native integration tests to avoid recompilation of the `java_binding` library. -->
28+
<rust.compiler.features>resource-manager invocation</rust.compiler.features>
2729
<rust.itSubCrate>integration_tests</rust.itSubCrate>
2830
<rust.appSubCrate>exonum-java</rust.appSubCrate>
2931
<!--A directory containing libjava_bindings native library-->

exonum-java-binding/core/rust/integration_tests/src/vm.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,18 @@ fn project_root_dir() -> PathBuf {
182182
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
183183
}
184184

185+
/// The relative path to a directory that contains runtime dependencies of the integration tests
186+
/// executed with `cargo test`. These dependencies include `java_bindings` library, which
187+
/// is also required and loaded by Java code.
188+
///
189+
/// This path is included in `java.library.path` JVM property, so that `java_bindings` library
190+
/// can be discovered and loaded by Java.
185191
#[cfg(debug_assertions)]
186192
fn target_path() -> &'static str {
187-
"target/debug"
193+
"target/debug/deps"
188194
}
189195

190196
#[cfg(not(debug_assertions))]
191197
fn target_path() -> &'static str {
192-
"target/release"
198+
"target/release/deps"
193199
}

exonum-java-binding/core/rust/src/proxy/node.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ pub extern "system" fn Java_com_exonum_binding_service_NodeProxy_nativeSubmit(
117117
service_id: jshort,
118118
transaction_id: jshort,
119119
) -> jbyteArray {
120-
use std::ptr;
121120
use utils::convert_hash;
122121
let res = panic::catch_unwind(|| {
123122
let node = cast_handle::<NodeContext>(node_handle);

exonum-java-binding/tests_profile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ export JAVA_LIB_DIR="$(find ${JAVA_HOME} -type f -name libjvm.\* | xargs -n1 dir
4949
echo "JAVA_LIB_DIR=${JAVA_LIB_DIR}"
5050

5151
# Version of Rust used to build tests.
52-
# Using 1.32.0 until ECR-2982 is fixed.
53-
export RUST_COMPILER_VERSION="${RUST_COMPILER_VERSION:-1.32.0}"
52+
export RUST_COMPILER_VERSION="${RUST_COMPILER_VERSION:-stable}"
5453
echo "RUST_COMPILER_VERSION: ${RUST_COMPILER_VERSION}"
5554

5655
# Find the directory containing Rust libstd.

0 commit comments

Comments
 (0)