Skip to content

Remove rustflags for zkVM compilation upon upstream fix #862

@shariqnaiyer

Description

@shariqnaiyer

Describe the task

The following issue found an issue in compiling for zkVMs when building with hashsig: #857

PR #861 introduced a temporary workaround to building for zkvms with getrandom as building for a zkvm lead to the following error:

Building for a zkVM target leads to the following error:

error: target is not supported. You may need to define a custom backend see: https://docs.rs/getrandom/#custom-backends
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.2/src/backends.rs:176:9
    |
176 | /         compile_error!("target is not supported. You may need to define \
177 | |                         a custom backend see: \
178 | |                         https://docs.rs/getrandom/#custom-backends");
    | |____________________________________________________________________^

The current workaround for us is to use the following rustflag that allows building getrandom with a custom backend.

[target.'cfg(target_os = "zkvm")']
rustflags = ["--cfg", "getrandom_backend=\"custom\""]

We want to have this fixed upstream and remove this workaround from our codebase. Issues related to this issue in upstream repositories (hash-sig and plonky3) will be linked below.

Plonky3: Plonky3/Plonky3#1089
Hash-sig: b-wagn/hash-sig#90

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions