Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN rust dependency won't build on ppc64le #5691

Open
grubles opened this issue Nov 3, 2022 · 14 comments
Open

CLN rust dependency won't build on ppc64le #5691

grubles opened this issue Nov 3, 2022 · 14 comments
Assignees
Labels
build powerpc64le rust Issue related to rust

Comments

@grubles
Copy link
Contributor

grubles commented Nov 3, 2022

Rocky Linux 9's rustc and cargo versions:

$ rustc --version
rustc 1.58.1 (Red Hat 1.58.1-1.el9)
$ cargo --version
cargo 1.58.0

I've recently been hitting this error building CLN master:

genidx doc/index.rst
(cd plugins; cargo build --quiet --examples)
error: failed to parse manifest at `/home/user/builds/lightning/Cargo.toml`

Caused by:
  feature `strip` is required

  The package requires the Cargo feature called `strip`, but that feature is not stabilized in this version of Cargo (1.58.0).
  Consider trying a newer version of Cargo (this may require the nightly release).
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option for more information about the status of this feature.
make: *** [plugins/Makefile:210: target/debug/examples/cln-plugin-startup] Error 101
@vincenzopalazzo
Copy link
Collaborator

yeah, this is bad because we do not have the control over distribution version, what about installing rust from the official install script?
https://www.rust-lang.org/tools/install

@whitslack
Copy link
Collaborator

My Gentoo ebuild for Core Lightning deletes the strip = "debuginfo" line from Cargo.toml because stripping binaries for installation is the responsibility of the package manager, not of the build system, and stripping can be suppressed through Portage's nostrip feature flag, which doesn't work if the build system has already done it. Presumably if you delete that line as well, then your antique version of Cargo won't complain about it.

@grubles
Copy link
Contributor Author

grubles commented Nov 6, 2022

Commenting out the strip = "debuginfo" helps the build progress some, but then errors again. Looks like I'll have to reinstall rust using rustup in order to get a more recent version.

(cd plugins; cargo build --quiet --examples)
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/user/builds/lightning/target/debug/build/ring-4dd82f7f52552798/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: build failed
make: *** [plugins/Makefile:210: target/debug/examples/cln-plugin-startup] Error 101
rm external/ppc64le-redhat-linux/libwally-core-build/src/secp256k1/libsecp256k1.la

@grubles
Copy link
Contributor Author

grubles commented Nov 7, 2022

Hrmmm even with a newer rustc, I get the same error:

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/user/builds/lightning/target/debug/build/ring-7f3889cbf68c3d25/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [plugins/Makefile:210: target/debug/examples/cln-plugin-startup] Error 101
rm external/ppc64le-redhat-linux/libwally-core-build/src/secp256k1/libsecp256k1.la
$ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

@cdecker
Copy link
Member

cdecker commented Nov 7, 2022

We could use HAVE_CARGO configure value reflect whether we have a rustc that is recent enough.

@vincenzopalazzo
Copy link
Collaborator

I think it is not a version problem but ring does not support some platform briansmith/ring#562 and the error is a little bit cryptic because it is caused by this unwrap.

I think the only solution is disabling rust?

@grubles
Copy link
Contributor Author

grubles commented Nov 8, 2022

I was starting to suspect that was the case since I'm running on powerpc64le rather than ARM or x86. :-/

@cdecker
Copy link
Member

cdecker commented Nov 8, 2022

Ok, then we might get away by setting RUST=0 in config.vars, that'll tell make to skip Rust components. Sadly that means that the cln-grpc will also not be compiled.

@grubles grubles changed the title Rocky Linux 9 rust might be too old for CLN now CLN rust dependency won't build on ppc64le Nov 8, 2022
@grubles
Copy link
Contributor Author

grubles commented Nov 8, 2022

The --disable-rust configure flag seems to work for this.

@whitslack
Copy link
Collaborator

The --disable-rust configure flag seems to work for this.

That's how we disable building+installing the Rust components on Gentoo when the user configures USE="-rust" despite having Rust installed. Works perfectly.

@vincenzopalazzo vincenzopalazzo added build rust Issue related to rust powerpc64le labels Nov 8, 2022
@cdecker
Copy link
Member

cdecker commented Nov 9, 2022

Yeah, sorry about that, hopefully ring adds support to ppc, alternatively we could fall back on openssl rather than rustls (which then pulls in ring as a transitive dependency). Though not quite sure how to realize that type of config changes from the ./configure script to the Cargo.toml in plugins/grpc-plugin, but we'll find a way.

@cdecker cdecker self-assigned this Nov 9, 2022
@grubles
Copy link
Contributor Author

grubles commented Dec 3, 2022

It looks like ring is making progress towards a C fallback for all little endian archs actually. briansmith/ring#1455

@grubles
Copy link
Contributor Author

grubles commented Jan 19, 2024

cargo build --quiet --example cln-plugin-startup
cargo build --quiet --example cln-plugin-reentrant
cargo build --quiet --bin cln-grpc
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/user/builds/lightning/target/debug/build/ring-9115534fec60a59d/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.16.20/build.rs:358:10:
  called `Option::unwrap()` on a `None` value
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [cln-rpc/Makefile:18: target/debug/examples/cln-plugin-reentrant] Error 101
make: *** Waiting for unfinished jobs....

Do we need to use the older ring 0.16.20 still? The latest version can build on ppc64le now.

@whitslack
Copy link
Collaborator

The hell arising from the contemporary obsession with version pinning and static linking. 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build powerpc64le rust Issue related to rust
Projects
None yet
Development

No branches or pull requests

4 participants