Open ltfschoen opened 4 years ago
thread 'main' panicked at 'called
Option::unwrap()
on aNone
value', /cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.9/build.rs:364:34
Did you try building ring
in isolation?
open-ethereum currently doesn't support big-endian platforms https://github.com/OpenEthereum/open-ethereum/blob/3ccfe735aa579f89a1f8de192a7625084a6f530f/ethash/src/compute.rs#L265-L268
we also might have problems with parity-common crates https://github.com/paritytech/parity-common/issues/27
I was reading through the "ring" README file, and they mention
Sometimes things are broken with Nightly Rust. We prioritize keeping things working on Stable So I tried recompiling on Rust "stable" but encountered the same error.
They also say in BUILD.md of the "ring" repo:
ring targets the current stable release of Rust and Cargo. We also verify that the current beta and nightly releases work
I'm not sure what's using "ring" as a dependency, but it's using version ring-0.16.9
https://github.com/briansmith/ring/commit/56cddd73d20fc440007c893cbd49d9e7633ae697, whereas the latest version of ring is 0.16.11 https://github.com/briansmith/ring/commit/da4f7ba2b955fbf8e37fe652ab6c26527564f52f, so perhaps 0.16.9 doesn't support the latest version of Rust stable or nightly version of Rust that I'm using, which is rustc 1.41.1 (f3e1a954d 2020-02-24).
@dvdplm I tried building ring-0.16.11 from source and it builds successfully with the latest Rust stable version rustc 1.41.1 (f3e1a954d 2020-02-24)
But when I try to build the older ring-0.16.9 from source when using the latest Rust stable version rustc 1.41.1 (f3e1a954d 2020-02-24)
, it fails with the following error.
ls @ ~/code/src/ltfschoen/ring - [56cddd73d20fc440007c893cbd49d9e7633ae697] $ cargo build --release
Compiling ring v0.16.9 (/Users/ls/code/src/ltfschoen/ring)
warning: lint `legacy_directory_ownership` has been removed: `converted into hard error, see https://github.com/rust-lang/rust/issues/37872`
--> build.rs:20:5
|
20 | legacy_directory_ownership,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
error: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
--> build.rs:421:10
|
421 | libs.into_iter()
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
note: lint level defined here
--> build.rs:33:5
|
33 | warnings
| ^^^^^^^^
= note: `#[forbid(array_into_iter)]` implied by `#[forbid(warnings)]`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
error: aborting due to previous error
error: could not compile `ring`.
To learn more, run the command again with --verbose.
So I had a look at Open Ethereum's cargo.lock file, and the following dependencies are using "ring":
[[package]]
name = "webpki"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "rustls"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e"
dependencies = [
"base64 0.10.1",
"log",
"ring",
"sct",
"webpki",
]
[[package]]
name = "sct"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c"
dependencies = [
"ring",
"untrusted",
]
And the following dependency uses "webpki" and "rustls" (where "rustls" uses "sct"):
[[package]]
name = "hyper-rustls"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b66a4973381d01141ed0a4f20070d47a232c764642dd6217d3d93f7a1f952ea5"
dependencies = [
"bytes",
"ct-logs",
"futures",
"hyper",
"rustls",
"rustls-native-certs",
"tokio-io",
"tokio-rustls",
"webpki",
]
And "hyper-rustls" is in a Cargo.toml file, so perhaps if we update that to its latest stable version then the other dependencies (i.e. "webpki", "rustls" (which replaced "openssl" library, see here), and "sct") will also use their latest versions, and then it's just a matter of making updates to Open Ethereum codebase to make it build with the latest versions. And I can't find any Open Ethereum Issues that mention there being a requirement to update "hyper-rustls".
Should a new issue be added to update Open Ethereum to use the latest stable version of "hyper-rustls"?
Then it occurred to me that perhaps doing that already an existing Open Ethereum Issue...
So first I found the following Issue that appears to indicate the repo is due for an update to the "ring" dependency https://github.com/OpenEthereum/open-ethereum/issues/11544
And then I found this issue https://github.com/OpenEthereum/open-ethereum/issues/7915. @tomaka are you still going to use "ring" to resolve this issue even though it's a "problematic library"?
And I also found this issue which appears to have been caused by "rustls-native-certs", which is a dependency of "hyper-rustls" https://github.com/OpenEthereum/open-ethereum/issues/11515
I've since tried reverting to an older version ring-0.16.5 (with rustc 1.36.0) unsuccessfully. I've also tried updating to hyper-rustls 0.20.0 unsuccessfully.
ring
is problematic is that the majority of implementations depend on assembly rather than source, thus not cross-platform and doesn't work for WASM, MIPS or similar.OpenSSL
anymore more than for certificates from hyper-rustls
And I also found this issue which appears to have been caused by "rustls-native-certs", which is a dependency of "hyper-rustls" #11515
Great, thanks
It would be great if you could create another tracking issue/rename this one which summaries what need to be done in order to get OpenEthereum
to compile for MIPS/BE :)
@niklasad1 I've created a tracking issue here https://github.com/openethereum/openethereum/issues/11563
Hey, this branch https://github.com/knarz/ring/tree/bigendian has a patch that makes ring work on the s360 arch and is applied to the 0.16.9
version of the crate.
Edit: Not s360, but s390x, sorry
@knarz i tried forking https://github.com/knarz/ring and then cloning the fork and fetching the 'bigendian' branch git fetch origin bigendian:bigendian && git checkout bigendian
.
I checked if s360 arch was supported by cross, but the closest I could find here was s390x. So I ran
RUST_BACKTRACE=1 QEMU_STRACE=1 cross build --target s390x-unknown-linux-gnu --release
, which required a small change https://github.com/knarz/ring/compare/bigendian...ltfschoen:bigendian?expand=1, and then when I ran it again I got the following error:
ls @ ~/code/src/ltfschoen/ring - [bigendian] $ RUST_BACKTRACE=1 QEMU_STRACE=1 cross build --target s390x-unknown-linux-gnu --release info: downloading component 'rust-std' for 's390x-unknown-linux-gnu' 19.5 MiB / 19.5 MiB (100 %) 4.1 MiB/s in 5s ETA: 0s info: installing component 'rust-std' for 's390x-unknown-linux-gnu' Unable to find image 'rustembedded/cross:s390x-unknown-linux-gnu-0.2.0' locally s390x-unknown-linux-gnu-0.2.0: Pulling from rustembedded/cross fe703b657a32: Already exists f9df1fafd224: Already exists a645a4b887f9: Already exists 57db7fe0b522: Already exists fd5eb1dae638: Pull complete b737b1aa458a: Pull complete ebe922695700: Pull complete 25f818714196: Pull complete 51846252d77b: Pull complete 33501c307ac6: Pull complete 45f447272a84: Pull complete b4cfcdce639c: Pull complete cc1ce785c1b0: Pull complete d4b535e6cdc5: Pull complete 76878529c2cc: Pull complete b8fe6886ab5e: Pull complete a7e971cfb355: Pull complete 3261ee26d2d9: Pull complete Digest: sha256:8840442382fa84b947087cec646f81802c28a425c365ce3c32b51bf5bf924e19 Status: Downloaded newer image for rustembedded/cross:s390x-unknown-linux-gnu-0.2.0 Compiling untrusted v0.7.0 Compiling lazy_static v1.4.0 Compiling libc v0.2.68 warning: lint `legacy_directory_ownership` has been removed: `converted into hard error, see https://github.com/rust-lang/rust/issues/37872` --> build.rs:20:5 | 20 | legacy_directory_ownership, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(renamed_and_removed_lints)]` on by default Compiling ring v0.16.9 (/project) error: failed to run custom build command for `ring v0.16.9 (/project)` Caused by: process didn't exit successfully: `/target/release/build/ring-f66cff03479ab192/build-script-build` (exit code: 101) --- stdout CARGO: /rust/bin/cargo CARGO_CFG_DEBUG_ASSERTIONS: CARGO_CFG_PROC_MACRO: CARGO_CFG_TARGET_ARCH: s390x CARGO_CFG_TARGET_ENDIAN: big CARGO_CFG_TARGET_ENV: gnu CARGO_CFG_TARGET_FAMILY: unix CARGO_CFG_TARGET_OS: linux CARGO_CFG_TARGET_POINTER_WIDTH: 64 CARGO_CFG_TARGET_VENDOR: unknown CARGO_CFG_UNIX: CARGO_FEATURE_ALLOC: 1 CARGO_FEATURE_DEFAULT: 1 CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1 CARGO_FEATURE_LAZY_STATIC: 1 CARGO_HOME: /cargo CARGO_MAKEFLAGS: --jobserver-fds=5,6 -j --jobserver-auth=5,6 -j CARGO_MANIFEST_DIR: /project CARGO_MANIFEST_LINKS: ring-asm CARGO_PKG_AUTHORS: Brian SmithCARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust. CARGO_PKG_HOMEPAGE: CARGO_PKG_NAME: ring CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring CARGO_PKG_VERSION: 0.16.9 CARGO_PKG_VERSION_MAJOR: 0 CARGO_PKG_VERSION_MINOR: 16 CARGO_PKG_VERSION_PATCH: 9 CARGO_PKG_VERSION_PRE: CARGO_TARGET_DIR: /target CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER: s390x-linux-gnu-gcc CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER: /linux-runner s390x CC_s390x_unknown_linux_gnu: s390x-linux-gnu-gcc CROSS_RUNNER: CXX_s390x_unknown_linux_gnu: s390x-linux-gnu-g++ DEBUG: false HOME: / HOST: x86_64-unknown-linux-gnu HOSTNAME: 70399a773b57 LD_LIBRARY_PATH: /target/release/deps:/rust/lib NUM_JOBS: 6 OPT_LEVEL: 3 OUT_DIR: /target/s390x-unknown-linux-gnu/release/build/ring-0f5362b98cee1d36/out PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/rust/bin PROFILE: release PWD: /project QEMU_LD_PREFIX: /usr/s390x-linux-gnu QEMU_STRACE: 1 RUSTC: rustc RUSTC_LINKER: s390x-linux-gnu-gcc RUSTDOC: rustdoc RUST_TEST_THREADS: 1 SSL_CERT_DIR: /usr/lib/ssl/certs SSL_CERT_FILE: /usr/lib/ssl/certs/ca-certificates.crt TARGET: s390x-unknown-linux-gnu TERM: xterm USER: ls XARGO_HOME: /xargo --- stderr thread 'main' panicked at '"include/GFp/s390x_arch.h": Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:771:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed
I also forked 'sct.rs', 'webpki', and 'rustls'. The plan was to update Cargo.toml in each of them as follows:
ring = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
sct = { git = "https://github.com/ltfschoen/sct.rs", branch = "bigendian" }
webpki = { git = "https://github.com/ltfschoen/webpki", branch = "bigendian" }
ring = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
ring = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
rustls = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
webpki = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
Then lastly to update 'open-ethereum' (my fork) dependencies to use my forks, as follows, when they are ready:
hyper-rustls = { git = "https://github.com/ltfschoen/ring", branch = "bigendian" }
as an alternative to the above, i'm in the process of getting access to a IBM Z mainframe via VM by registering for community access at https://linuxone.cloud.marist.edu/cloud/#/register?flag=vm (instead of running on macOS)
Hey, I made a mistake. Of course it's s390x and not s360.
In the Cargo.toml
I added the following:
[patch.crates-io]
ring = { path = "../ring"}
That should replace all ring
crates with the patched version, so no need to fork everything.
I published some forks, that allow the client to be built on the s390x
using a couple of patched crates.
https://github.com/knarz/parity-common/tree/bigendian https://github.com/knarz/openethereum/tree/ring
The above openethereum fork will expect ring
and parity-common
directories to be available in ../
. (See the Cargo.toml
in the openethereum client).
With these patches, starting the client once works but shutting it down and restarting again fails.
This is just the output of cargo run -- -l "debug"
after restarting once:
2020-03-24 03:24:10 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 0 events, 0.000s
2020-03-24 03:24:10 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 1 events, 0.000s
2020-03-24 03:24:10 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 0 events, 0.000s
2020-03-24 03:24:10 fetch DEBUG fetch processing requests ...
2020-03-24 03:24:11 main WARN kvdb_rocksdb DB corrupted: Invalid argument: You have to open all column families. Column families not opened: col8, col7, col6, col1, col0, col2, col3, col4, col5, attempting repair
2020-03-24 03:24:11 fetch DEBUG tokio_reactor loop process - 1 events, 0.000s
2020-03-24 03:24:11 fetch DEBUG fetch fetch background thread finished
2020-03-24 03:24:11 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 1 events, 0.000s
2020-03-24 03:24:11 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 0 events, 0.000s
2020-03-24 03:24:11 tokio-runtime-worker-0 DEBUG tokio_reactor loop process - 1 events, 0.000s
Failed to open database Custom { kind: Other, error: Error { message: "Invalid argument: Column family not found: : col5" } }
With a PoA demo setup (as per https://wiki.parity.io/Demo-PoA-tutorial.html) I get a strange error I haven't been able to track down yet:
2020-03-24 03:29:02 main INFO ethcore_service::service Configured for DemoPoA using AuthorityRound engine
====================
stack backtrace:
0: panic_hook::gen_panic_msg
at util/panic-hook/src/lib.rs:71
1: panic_hook::set_with::{{closure}}
at util/panic-hook/src/lib.rs:44
2: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:476
3: rust_begin_unwind
at src/libstd/panicking.rs:380
4: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
5: core::option::expect_none_failed
at src/libcore/option.rs:1199
6: core::result::Result<T,E>::expect
at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/result.rs:991
7: journaldb::overlayrecentdb::OverlayRecentDB::read_overlay
at util/journaldb/src/overlayrecentdb.rs:180
8: journaldb::overlayrecentdb::OverlayRecentDB::new
at util/journaldb/src/overlayrecentdb.rs:147
9: journaldb::new
at util/journaldb/src/lib.rs:195
10: ethcore::client::client::Client::new
at ethcore/src/client/client.rs:723
11: ethcore_service::service::ClientService::start
at ethcore/service/src/service.rs:123
12: open_ethereum::run::execute_impl
at /home/pocadm2/openethereum/parity/run.rs:563
13: open_ethereum::run::execute
at /home/pocadm2/openethereum/parity/run.rs:930
14: open_ethereum::execute
at /home/pocadm2/openethereum/parity/lib.rs:205
15: open_ethereum::start
at /home/pocadm2/openethereum/parity/lib.rs:249
16: parity::main_direct
at parity/main.rs:276
17: parity::main
at parity/main.rs:453
18: std::rt::lang_start::{{closure}}
at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/rt.rs:67
19: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:52
std::panicking::try::do_call
at src/libstd/panicking.rs:305
20: __rust_try
21: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:86
22: std::panicking::try
at src/libstd/panicking.rs:281
std::panic::catch_unwind
at src/libstd/panic.rs:394
std::rt::lang_start_internal
at src/libstd/rt.rs:51
23: std::rt::lang_start
at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/rt.rs:67
24: main
25: __libc_start_main
26: <unknown>
Thread 'main' panicked at 'Low-level database error.: Custom { kind: Other, error: Error { message: "Corruption: Snappy not supported or corrupted Snappy compressed block contents" } }', util/journaldb/src/overlayrecentdb.rs:180
This is a bug. Please report it at:
https://github.com/OpenEthereum/open-ethereum/issues/new
Aborted
uname -a
returnsDarwin 18.7.0 Darwin Kernel Version 18.7.0; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
)expected
I was expecting (hoping) it would compile successfully.
actual
I've attempted to try to use Linux in a Docker Container to build Open Ethereum to MIPS (big endian hardware) using Cross, however I'm currently encountered this issue https://github.com/docker/for-linux/issues/951, which is a progression from my initial issue https://github.com/rust-embedded/cross/issues/385. All the code and detailed steps that I've taken are included in this WIP PR in my fork https://github.com/ltfschoen/open-ethereum/pull/1.
So whilst I was waiting for help I've tried to just try building Open Ethereum to MIPS using Cross directly on my macOS local machine.
However, after installing relevant dependencies for Parity Ethereum on macOS by running my script dependencies_mac.sh,
Then cloning Open Ethereum with:
Then usually I'd run
cargo build --release --features final
and it would build successfully.However I want to use
cross
https://github.com/rust-embedded/cross (instead ofcargo
) to build to a MIPS (big endian hardware) release target (instead of little endian hardware), but I get the error shown below: