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

error[E0599]: no method named description_ found for struct KeyRejected in the current scope #323

Closed
Richard-Rogalski opened this issue Aug 6, 2023 · 8 comments

Comments

@Richard-Rogalski
Copy link

CPU: ppc64le (power8)
Rust: rustc 1.71.0-nightly (8ede3aae2 2023-07-12) (gentoo) and also rustc 1.71.0 (8ede3aae2 2023-07-12) (gentoo)
Version: jsonwebtoken = "8.3.0"

I think this problem is because of either ppc64le, or (more likely) ring. Upstream ring does not have support on PPC, but IBM has a fork that does, https://github.com/IBM/ring/ . The error is:

error[E0599]: no method named `description_` found for struct `KeyRejected` in the current scope
  --> /var/tmp/portage/net-im/conduit-9999/work/cargo_home/gentoo/jsonwebtoken/src/crypto/rsa.rs:42:49
   |
42 |         .map_err(|e| ErrorKind::InvalidRsaKey(e.description_()))?;
   |                                                 ^^^^^^^^^^^^ method not found in `KeyRejected`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `jsonwebtoken` (lib) due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name jsonwebtoken --edition=2021 /var/tmp/portage/net-im/conduit-9999/work/cargo_home/gentoo/jsonwebtoken/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C codegen-units=32 --cfg 'feature="default"' --cfg 'feature="pem"' --cfg 'feature="simple_asn1"' --cfg 'feature="use_pem"' -C metadata=48a81f1bd416dd9f -C extra-filename=-48a81f1bd416dd9f --out-dir /var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps -L dependency=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps --extern base64=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libbase64-e05657e6542dfd9f.rmeta --extern pem=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libpem-1f44a576910ccc45.rmeta --extern ring=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libring-d49a705281785793.rmeta --extern serde=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libserde-99876933d86d440f.rmeta --extern serde_json=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libserde_json-92c2cc54494772bc.rmeta --extern simple_asn1=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/deps/libsimple_asn1-ba92fdae2f5fe6a0.rmeta --cap-lints allow -C target-cpu=pwr8 -C opt-level=3 -C strip=symbols -L native=/var/tmp/portage/net-im/conduit-9999/work/conduit-9999/target/release/build/ring-a13e0b7e1f166cbf/out` (exit status: 1)

Full build log will be attached below.

I don't know much about rust or where the issue really lies.... but I would be willing to (try) making a PR to make ring optional in favor of the system openssl (openssl-sys), if that would be alright :)
( if that is alright, can I also get an estimate on how hard that would be :b )

build.log

@robfreed
Copy link

robfreed commented Aug 6, 2023

Welp, unsure if this helps, but it builds if e.description_()) is replaced by ErrorKind::RsaFailedSigning.

Note that this isn't a proper fix

We'll have to wait for a proper fix. I wonder what changed prior the introduction of e.description_()).

@robfreed
Copy link

robfreed commented Aug 6, 2023

Looks like e.description_() was added in 30571ca. Reverting it should probably make it work. Unsure of the impact if this commit was reverted.

@robfreed
Copy link

robfreed commented Aug 6, 2023

fyi: Richard and I both have ppc64le (power8) systems

@Keats
Copy link
Owner

Keats commented Aug 8, 2023

It seems present in the fork? https://github.com/IBM/ring/blob/master/src/error.rs#L153 but not in the ppc branch: https://github.com/IBM/ring/blob/ppc-0.16.20/src/error.rs#L134

@robfreed
Copy link

robfreed commented Aug 9, 2023

Hmm, thanks for pointing that out. I didn't look to see if it was present in the ppc branch. I locally added it in the ppc branch and it now builds fine. (We are building conduit)

(I did a quick "fix", so it's not a proper fix, but it works. I'll have to check that out then)

I only added this part

    /// The value returned from <Self as std::error::Error>::description()
    pub fn description_(&self) -> &'static str {
        self.0
    }

builds fine, but it's missing most of 30571ca.

Thanks for pointing that out!

LIBCLANG_PATH="/usr/lib/llvm/15/lib64/" cargo build --release
   [...]
   Compiling jsonwebtoken v8.3.0
   [...]
    Finished release [optimized] target(s) in 6m 29s

@Richard-Rogalski you can temporarily do this

@Richard-Rogalski
Copy link
Author

ugh, I'll make a PR to IBM/ring I guess.. thanks y'all <3

@erichte-ibm
Copy link

Hi, I just pushed a revised version of ppc-0.16.20 to IBM/ring that is actually based on 0.16. The original version included some commits intended for a future version that should not have been there, hopefully this should address the issue. As it was a git history rewrite, you may need to force a clean rebuild to make sure it fetches the new version. Please let me know if you encounter any issues.

@robfreed
Copy link

Thank you so much! Just in time for my birthday!

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

No branches or pull requests

4 participants