eclipse / kuksa.val

kuksa.val
Apache License 2.0
95 stars 51 forks source link

RISC V support #666

Closed SebastianSchildt closed 6 months ago

SebastianSchildt commented 1 year ago

As this question pops up pretty regularly these days... Create this issue for tracking

Currently RISC V is not supported, the main culprit are the required RUST crypto libs for TLS and the JWT tokens that rely on the "ring" base library https://github.com/briansmith/ring

There have been issues and PRs raised for almost two years, but while the Git is sort of active the whole project seems to be semi-abandoned and has not had a release in a long time.

The most recent developments seem to be in this PR,

https://github.com/briansmith/ring/pull/1627

so if RISC V support is crucial for you, try to move things over there.

argerus commented 1 year ago

Maybe this newly announced funding will result in a new release supporting more targets (including RISC-V).

In parallel with the FIPS-related work, I will release the 0.17 version of ring that supports a much wider set of targets than ring has supported up to now.

SebastianSchildt commented 1 year ago

Nice, somebody found money for that guy. Lets hope 🙏 something comes out, my RISC board is getting bored without KUKSA and a second one is on the way already (https://milkv.io/duo 😄 ).

SebastianSchildt commented 1 year ago

Just tracking some progress: Meanwhile https://github.com/briansmith/ring/pull/1627 is merged, however just doing

[patch.crates-io]
ring = { git = 'https://github.com/briansmith/ring.git', branch='main' }

is not enough, as this is currently tagged version 0.17 so 0.16.20 is still being pulled from rustls and jsonwebtoken.

As a "hack" I tried clonign ring, changing Cargo.toml claiming main to be version 0.16.22 and refernecing it like

ring = { path = '/path/to/patched-ring' }

However, "unfortunately" they use their version numbers correctly, i.e. the current ring library is not compatible at least with rustls (did not dig deeper).

So it looks like

SebastianSchildt commented 1 year ago

Apparently rustls is already work in progress: https://github.com/rustls/rustls/pull/1508

SebastianSchildt commented 11 months ago

So we might wanna try -aftter 0.4.1 release - upgrading some dependecnies.

Meanwhile we have the required ring 0.17 released

https://crates.io/crates/ring

And rusttls https://crates.io/crates/rustls/0.21.8

as well as jsonwebtoken https://crates.io/crates/jsonwebtoken/9.1.0

have versions upgraded to the new ring

argerus commented 11 months ago

Created a PR (#694) with updated dependencies. cross build --target riscv64gc-unknown-linux-gnu doesn't fail at least...

SebastianSchildt commented 11 months ago

Nice. Will try on target :)

SebastianSchildt commented 11 months ago

With #694 should work on RISC now, keeping this open, as we are not building it by default currently. Let's see what is possible there

SebastianSchildt commented 11 months ago

kuksa-client docker might take a while as distroless is not supporting riscv yet https://github.com/GoogleContainerTools/distroless/issues/1269

However, I guess we can sit this one out, as the pypi wheel should work fine

SebastianSchildt commented 10 months ago

Ok let's I played with it, and would suggest post poning kuksa-client support/container a bit. It is not impossible, but it suffers the same issue we had with ARM builds for the GRPC wheels a while ago: They don't exist, so it needs to be compiled. That is more than 3 hours when doing it via QEMU. So let's sit this one out for now. If somebody has a reasonably fast RISC V target, there is no issue why a pip install should not work, but for our CI it seems too heavy currently