A very confusing reqwest build dependency problem

Here is part of my code snippet,just send request of get()

    let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(10, 0, 0, 0)), 855);
    let client = Client::builder()
        .min_tls_version(Version::TLS_1_2)
        .no_proxy()
        .build()
        .unwrap();


    client.get(&url_login_https).send()

and my Cargo.toml dependencies configuration here, and let me explain

aarch64-pc-windows-msvc and riscv64gc-unknown-linux-gnu are built with default-tls. rustls-tls does not support these two platforms, because the dependent library ring of rustls does not support

[dependencies]
serde_json = { version = "1.0", features = ["alloc"], default-features = false }

[target.'cfg(not(any(all(target_arch = "aarch64", target_os = "windows"), all(target_arch = "riscv64gc", target_os = "linux"))))'.dependencies]
reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-features = false }

[target.aarch64-pc-windows-msvc.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[target.riscv64gc-unknown-linux-gnu.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }


when i build it in GitHub, it encounter

I swear, before adding riscv64gc-unknown-linux-gnu it worked exactly as I expected.
Before, I had aarch64-pc-windows-msvc, its reqwest used default-tls, and did not add ring dependencies when building. And now, i add riscv64gc-unknown-linux-gnu, it encounter error.

In one word, i want to know why i not specify rustls-tls but it appear ring dependency. And how to fix it.

and the cargo tree like this, althouht ring seems appear, but it only occur in the specify target.

network-master v2.0.3 (C:\usr\code\rust\Network-Master-Rust)
β”œβ”€β”€ reqwest v0.11.18
β”‚   β”œβ”€β”€ base64 v0.21.2
β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”œβ”€β”€ encoding_rs v0.8.32
β”‚   β”‚   └── cfg-if v1.0.0
β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”œβ”€β”€ futures-util v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-io v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-macro v0.3.28 (proc-macro)
β”‚   β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.64
β”‚   β”‚   β”‚   β”‚   └── unicode-ident v1.0.10
β”‚   β”‚   β”‚   β”œβ”€β”€ quote v1.0.29
β”‚   β”‚   β”‚   β”‚   └── proc-macro2 v1.0.64 (*)
β”‚   β”‚   β”‚   └── syn v2.0.25
β”‚   β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.64 (*)
β”‚   β”‚   β”‚       β”œβ”€β”€ quote v1.0.29 (*)
β”‚   β”‚   β”‚       └── unicode-ident v1.0.10
β”‚   β”‚   β”œβ”€β”€ futures-task v0.3.28
β”‚   β”‚   β”œβ”€β”€ memchr v2.5.0
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ pin-utils v0.1.0
β”‚   β”‚   └── slab v0.4.8
β”‚   β”‚       [build-dependencies]
β”‚   β”‚       └── autocfg v1.1.0
β”‚   β”œβ”€β”€ h2 v0.3.20
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”‚   └── itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ indexmap v1.9.3
β”‚   β”‚   β”‚   └── hashbrown v0.12.3
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ slab v0.4.8 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ mio v0.8.8
β”‚   β”‚   β”‚   β”‚   └── windows-sys v0.48.0
β”‚   β”‚   β”‚   β”‚       └── windows-targets v0.48.1
β”‚   β”‚   β”‚   β”‚           └── windows_x86_64_gnu v0.48.0
β”‚   β”‚   β”‚   β”œβ”€β”€ num_cpus v1.16.0
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   β”œβ”€β”€ socket2 v0.4.9
β”‚   β”‚   β”‚   β”‚   └── winapi v0.3.9
β”‚   β”‚   β”‚   β”‚       └── winapi-x86_64-pc-windows-gnu v0.4.0
β”‚   β”‚   β”‚   └── windows-sys v0.48.0 (*)
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ tokio-util v0.7.8
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”‚   └── tracing v0.1.37
β”‚   β”‚   β”‚       β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”‚       β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚       └── tracing-core v0.1.31
β”‚   β”‚   β”‚           └── once_cell v1.18.0
β”‚   β”‚   └── tracing v0.1.37 (*)
β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”œβ”€β”€ http-body v0.4.5
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   └── pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ hyper v0.14.27
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ futures-channel v0.3.28
β”‚   β”‚   β”‚   └── futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ h2 v0.3.20 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ http-body v0.4.5 (*)
β”‚   β”‚   β”œβ”€β”€ httparse v1.8.0
β”‚   β”‚   β”œβ”€β”€ httpdate v1.0.2
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ socket2 v0.4.9 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”‚   β”œβ”€β”€ tracing v0.1.37 (*)
β”‚   β”‚   └── want v0.3.1
β”‚   β”‚       └── try-lock v0.2.4
β”‚   β”œβ”€β”€ hyper-rustls v0.24.1
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ hyper v0.14.27 (*)
β”‚   β”‚   β”œβ”€β”€ rustls v0.21.5
β”‚   β”‚   β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ spin v0.5.2
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ untrusted v0.7.1
β”‚   β”‚   β”‚   β”‚   └── winapi v0.3.9 (*)
β”‚   β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   β”‚   └── cc v1.0.79
β”‚   β”‚   β”‚   β”œβ”€β”€ rustls-webpki v0.101.1
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚   β”‚   └── untrusted v0.7.1
β”‚   β”‚   β”‚   └── sct v0.7.0
β”‚   β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚       └── untrusted v0.7.1
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   └── tokio-rustls v0.24.1
β”‚   β”‚       β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”‚       └── tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ ipnet v2.8.0
β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”œβ”€β”€ mime v0.3.17
β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”œβ”€β”€ percent-encoding v2.3.0
β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”œβ”€β”€ rustls-pemfile v1.0.3
β”‚   β”‚   └── base64 v0.21.2
β”‚   β”œβ”€β”€ serde v1.0.171
β”‚   β”œβ”€β”€ serde_urlencoded v0.7.1
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0
β”‚   β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ ryu v1.0.14
β”‚   β”‚   └── serde v1.0.171
β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ tokio-rustls v0.24.1 (*)
β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”œβ”€β”€ url v2.4.0
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0 (*)
β”‚   β”‚   β”œβ”€β”€ idna v0.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ unicode-bidi v0.3.13
β”‚   β”‚   β”‚   └── unicode-normalization v0.1.22
β”‚   β”‚   β”‚       └── tinyvec v1.6.0
β”‚   β”‚   β”‚           └── tinyvec_macros v0.1.1
β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   β”œβ”€β”€ webpki-roots v0.22.6
β”‚   β”‚   └── webpki v0.22.0
β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚       └── untrusted v0.7.1
β”‚   └── winreg v0.10.1
β”‚       └── winapi v0.3.9 (*)
└── serde_json v1.0.102
    β”œβ”€β”€ itoa v1.0.8
    β”œβ”€β”€ ryu v1.0.14
    └── serde v1.0.171

My program here change android target to riscv and modify README Β· mobeicanyue/Campus-Network-Master-Rust@ade9476 (github.com)

Or maybe I just made a typo here?

All images are broken for me.

null

Anyone else?
Can someone tell me if this code is written correctly?
The logic of the code is that except aarch64-pc-windows-msvc and riscv64gc-unknown-linux-gnu use the reqwest configuration in the first paragraph, otherwise it is the following configuration.

[target.'cfg(not(any(all(target_arch = "aarch64", target_os = "windows"), all(target_arch = "riscv64gc", target_os = "linux"))))'.dependencies]
reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-features = false }

[target.aarch64-pc-windows-msvc.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[target.riscv64gc-unknown-linux-gnu.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

:pleading_face:

This looks like the dependency graph for the windows target. What is the output of cargo tree --target riscv64gc-unknown-linux-gnu?

1 Like

sorry,output here

cargo tree --target riscv64gc-unknown-linux-gnu
campus-network-master v2.0.3 (/home/sana/Code/rust/Network-Master-Rust)
β”œβ”€β”€ openssl v0.10.55
β”‚   β”œβ”€β”€ bitflags v1.3.2
β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”œβ”€β”€ foreign-types v0.3.2
β”‚   β”‚   └── foreign-types-shared v0.1.1
β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”œβ”€β”€ openssl-macros v0.1.1 (proc-macro)
β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.64
β”‚   β”‚   β”‚   └── unicode-ident v1.0.10
β”‚   β”‚   β”œβ”€β”€ quote v1.0.29
β”‚   β”‚   β”‚   └── proc-macro2 v1.0.64 (*)
β”‚   β”‚   └── syn v2.0.25
β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.64 (*)
β”‚   β”‚       β”œβ”€β”€ quote v1.0.29 (*)
β”‚   β”‚       └── unicode-ident v1.0.10
β”‚   └── openssl-sys v0.9.90
β”‚       └── libc v0.2.147
β”‚       [build-dependencies]
β”‚       β”œβ”€β”€ cc v1.0.79
β”‚       β”œβ”€β”€ openssl-src v111.26.0+1.1.1u
β”‚       β”‚   └── cc v1.0.79
β”‚       └── pkg-config v0.3.27
β”œβ”€β”€ reqwest v0.11.18
β”‚   β”œβ”€β”€ base64 v0.21.2
β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”œβ”€β”€ encoding_rs v0.8.32
β”‚   β”‚   └── cfg-if v1.0.0
β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”œβ”€β”€ futures-util v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-io v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-macro v0.3.28 (proc-macro)
β”‚   β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.64 (*)
β”‚   β”‚   β”‚   β”œβ”€β”€ quote v1.0.29 (*)
β”‚   β”‚   β”‚   └── syn v2.0.25 (*)
β”‚   β”‚   β”œβ”€β”€ futures-task v0.3.28
β”‚   β”‚   β”œβ”€β”€ memchr v2.5.0
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ pin-utils v0.1.0
β”‚   β”‚   └── slab v0.4.8
β”‚   β”‚       [build-dependencies]
β”‚   β”‚       └── autocfg v1.1.0
β”‚   β”œβ”€β”€ h2 v0.3.20
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”‚   └── itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ indexmap v1.9.3
β”‚   β”‚   β”‚   └── hashbrown v0.12.3
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ slab v0.4.8 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ mio v0.8.8
β”‚   β”‚   β”‚   β”‚   └── libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ num_cpus v1.16.0
β”‚   β”‚   β”‚   β”‚   └── libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   └── socket2 v0.4.9
β”‚   β”‚   β”‚       └── libc v0.2.147
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ tokio-util v0.7.8
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”‚   └── tracing v0.1.37
β”‚   β”‚   β”‚       β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”‚       β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚       └── tracing-core v0.1.31
β”‚   β”‚   β”‚           └── once_cell v1.18.0
β”‚   β”‚   └── tracing v0.1.37 (*)
β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”œβ”€β”€ http-body v0.4.5
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   └── pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ hyper v0.14.27
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ futures-channel v0.3.28
β”‚   β”‚   β”‚   └── futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ h2 v0.3.20 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ http-body v0.4.5 (*)
β”‚   β”‚   β”œβ”€β”€ httparse v1.8.0
β”‚   β”‚   β”œβ”€β”€ httpdate v1.0.2
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ socket2 v0.4.9 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”‚   β”œβ”€β”€ tracing v0.1.37 (*)
β”‚   β”‚   └── want v0.3.1
β”‚   β”‚       └── try-lock v0.2.4
β”‚   β”œβ”€β”€ hyper-rustls v0.24.1
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ hyper v0.14.27 (*)
β”‚   β”‚   β”œβ”€β”€ rustls v0.21.5
β”‚   β”‚   β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”‚   β”‚   β”‚   └── untrusted v0.7.1
β”‚   β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   β”‚   └── cc v1.0.79
β”‚   β”‚   β”‚   β”œβ”€β”€ rustls-webpki v0.101.1
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚   β”‚   └── untrusted v0.7.1
β”‚   β”‚   β”‚   └── sct v0.7.0
β”‚   β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚       └── untrusted v0.7.1
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   └── tokio-rustls v0.24.1
β”‚   β”‚       β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”‚       └── tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ hyper-tls v0.5.0
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ hyper v0.14.27 (*)
β”‚   β”‚   β”œβ”€β”€ native-tls v0.2.11
β”‚   β”‚   β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”‚   β”‚   β”œβ”€β”€ openssl v0.10.55 (*)
β”‚   β”‚   β”‚   β”œβ”€β”€ openssl-probe v0.1.5
β”‚   β”‚   β”‚   └── openssl-sys v0.9.90 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   └── tokio-native-tls v0.3.1
β”‚   β”‚       β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”‚       └── tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ ipnet v2.8.0
β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”œβ”€β”€ mime v0.3.17
β”‚   β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”œβ”€β”€ percent-encoding v2.3.0
β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”œβ”€β”€ rustls-pemfile v1.0.3
β”‚   β”‚   └── base64 v0.21.2
β”‚   β”œβ”€β”€ serde v1.0.171
β”‚   β”œβ”€β”€ serde_urlencoded v0.7.1
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0
β”‚   β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.8
β”‚   β”‚   β”œβ”€β”€ ryu v1.0.14
β”‚   β”‚   └── serde v1.0.171
β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ tokio-native-tls v0.3.1 (*)
β”‚   β”œβ”€β”€ tokio-rustls v0.24.1 (*)
β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”œβ”€β”€ url v2.4.0
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0 (*)
β”‚   β”‚   β”œβ”€β”€ idna v0.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ unicode-bidi v0.3.13
β”‚   β”‚   β”‚   └── unicode-normalization v0.1.22
β”‚   β”‚   β”‚       └── tinyvec v1.6.0
β”‚   β”‚   β”‚           └── tinyvec_macros v0.1.1
β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   └── webpki-roots v0.22.6
β”‚       └── webpki v0.22.0
β”‚           β”œβ”€β”€ ring v0.16.20 (*)
β”‚           └── untrusted v0.7.1
└── serde_json v1.0.102
    β”œβ”€β”€ itoa v1.0.8
    β”œβ”€β”€ ryu v1.0.14
    └── serde v1.0.171
cargo tree --target riscv64gc-unknown-linux-gnu | grep ring
β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚           β”œβ”€β”€ ring v0.16.20 (*)

I don't know why this is so confusing

You know, arm windows doesn't use ring but openssl, although risc-linux configuration is the same as it.

Do you have resolver = "2" in your Cargo.toml under [package]? Without it I think Cargo unifies features between all targets.

I don't familiar with resolver.

Here is my Cargo.toml

[package]
name = "network-master"
version = "2.0.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde_json = { version = "1.0", features = ["alloc"], default-features = false }

[target.'cfg(not(all(target_arch = "aarch64", target_os = "windows")))'.dependencies]
reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-features = false }

[target.aarch64-pc-windows-msvc.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[profile.release]
codegen-units = 1
lto = true
opt-level = "z"

I don't see resolver = "2", so try putting it under the line with edition = "2021"

Ok, adding it

[package]
name = "network-master"
version = "2.0.3"
edition = "2021"

resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde_json = { version = "1.0", features = ["alloc"], default-features = false }

[target.'cfg(not(any(all(target_arch = "aarch64", target_os = "windows"), all(target_arch = "riscv64gc", target_os = "linux"))))'.dependencies]
reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-features = false }

[target.aarch64-pc-windows-msvc.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[target.riscv64gc-unknown-linux-gnu.dependencies]
openssl = { version = "0.10"}
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[profile.release]
codegen-units = 1
lto = true
opt-level = "z"

I run

cargo clean

And then

cargo build --target riscv64gc-unknown-linux-gnu
   Compiling libc v0.2.147
   Compiling cc v1.0.79
   Compiling autocfg v1.1.0
   Compiling once_cell v1.18.0
   Compiling proc-macro2 v1.0.65
   Compiling unicode-ident v1.0.11
   Compiling quote v1.0.30
   Compiling pin-project-lite v0.2.10
   Compiling cfg-if v1.0.0
   Compiling bytes v1.4.0
   Compiling pkg-config v0.3.27
   Compiling futures-core v0.3.28
   Compiling untrusted v0.7.1
   Compiling itoa v1.0.9
   Compiling memchr v2.5.0
   Compiling futures-task v0.3.28
   Compiling fnv v1.0.7
   Compiling tracing-core v0.1.31
   Compiling futures-util v0.3.28
   Compiling log v0.4.19
   Compiling openssl v0.10.55
   Compiling http v0.2.9
   Compiling futures-sink v0.3.28
   Compiling tokio v1.29.1
   Compiling slab v0.4.8
   Compiling indexmap v1.9.3
   Compiling tracing v0.1.37
   Compiling futures-io v0.3.28
   Compiling foreign-types-shared v0.1.1
   Compiling futures-channel v0.3.28
   Compiling hashbrown v0.12.3
   Compiling httparse v1.8.0
   Compiling num_cpus v1.16.0
   Compiling socket2 v0.4.9
   Compiling syn v2.0.26
   Compiling mio v0.8.8
   Compiling pin-utils v0.1.0
   Compiling foreign-types v0.3.2
   Compiling try-lock v0.2.4
   Compiling native-tls v0.2.11
   Compiling bitflags v1.3.2
   Compiling tinyvec_macros v0.1.1
   Compiling serde v1.0.171
   Compiling rustls v0.21.5
   Compiling tinyvec v1.6.0
   Compiling http-body v0.4.5
   Compiling want v0.3.1
   Compiling percent-encoding v2.3.0
   Compiling httpdate v1.0.2
   Compiling tower-service v0.3.2
   Compiling openssl-probe v0.1.5
   Compiling form_urlencoded v1.2.0
   Compiling ring v0.16.20
   Compiling openssl-sys v0.9.90
   Compiling unicode-bidi v0.3.13
   Compiling ryu v1.0.15
   Compiling serde_json v1.0.103
   Compiling unicode-normalization v0.1.22
   Compiling base64 v0.21.2
   Compiling encoding_rs v0.8.32
   Compiling mime v0.3.17
   Compiling ipnet v2.8.0
   Compiling rustls-pemfile v1.0.3
   Compiling idna v0.4.0
error: failed to run custom build command for `openssl-sys v0.9.90`

Caused by:
  process didn't exit successfully: `/home/sana/Code/rust/Network-Master-Rust/target/debug/build/openssl-sys-84f10e479eab1726/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_riscv64gc-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_riscv64gc_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_riscv64gc-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_riscv64gc_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_riscv64gc-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_riscv64gc_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: pkg-config has not been configured to support cross-compilation.

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.

  --- stderr
  thread 'main' panicked at '

  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = riscv64gc-unknown-linux-gnu
  openssl-sys = 0.9.90

  ', /home/sana/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

I confirmed I installed openssl and pkgconfig on my PC. And github do so.

cargo tree --target riscv64gc-unknown-linux-gnu 
network-master v2.0.3 (/home/sana/Code/rust/Network-Master-Rust)
β”œβ”€β”€ openssl v0.10.55
β”‚   β”œβ”€β”€ bitflags v1.3.2
β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”œβ”€β”€ foreign-types v0.3.2
β”‚   β”‚   └── foreign-types-shared v0.1.1
β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”œβ”€β”€ openssl-macros v0.1.1 (proc-macro)
β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.65
β”‚   β”‚   β”‚   └── unicode-ident v1.0.11
β”‚   β”‚   β”œβ”€β”€ quote v1.0.30
β”‚   β”‚   β”‚   └── proc-macro2 v1.0.65 (*)
β”‚   β”‚   └── syn v2.0.26
β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.65 (*)
β”‚   β”‚       β”œβ”€β”€ quote v1.0.30 (*)
β”‚   β”‚       └── unicode-ident v1.0.11
β”‚   └── openssl-sys v0.9.90
β”‚       └── libc v0.2.147
β”‚       [build-dependencies]
β”‚       β”œβ”€β”€ cc v1.0.79
β”‚       └── pkg-config v0.3.27
β”œβ”€β”€ reqwest v0.11.18
β”‚   β”œβ”€β”€ base64 v0.21.2
β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”œβ”€β”€ encoding_rs v0.8.32
β”‚   β”‚   └── cfg-if v1.0.0
β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”œβ”€β”€ futures-util v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-io v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-macro v0.3.28 (proc-macro)
β”‚   β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.65 (*)
β”‚   β”‚   β”‚   β”œβ”€β”€ quote v1.0.30 (*)
β”‚   β”‚   β”‚   └── syn v2.0.26 (*)
β”‚   β”‚   β”œβ”€β”€ futures-task v0.3.28
β”‚   β”‚   β”œβ”€β”€ memchr v2.5.0
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ pin-utils v0.1.0
β”‚   β”‚   └── slab v0.4.8
β”‚   β”‚       [build-dependencies]
β”‚   β”‚       └── autocfg v1.1.0
β”‚   β”œβ”€β”€ h2 v0.3.20
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ fnv v1.0.7
β”‚   β”‚   β”‚   └── itoa v1.0.9
β”‚   β”‚   β”œβ”€β”€ indexmap v1.9.3
β”‚   β”‚   β”‚   └── hashbrown v0.12.3
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ slab v0.4.8 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ mio v0.8.8
β”‚   β”‚   β”‚   β”‚   └── libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ num_cpus v1.16.0
β”‚   β”‚   β”‚   β”‚   └── libc v0.2.147
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   └── socket2 v0.4.9
β”‚   β”‚   β”‚       └── libc v0.2.147
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.1.0
β”‚   β”‚   β”œβ”€β”€ tokio-util v0.7.8
β”‚   β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ futures-sink v0.3.28
β”‚   β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”‚   └── tracing v0.1.37
β”‚   β”‚   β”‚       β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”‚       β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”‚       └── tracing-core v0.1.31
β”‚   β”‚   β”‚           └── once_cell v1.18.0
β”‚   β”‚   └── tracing v0.1.37 (*)
β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”œβ”€β”€ http-body v0.4.5
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   └── pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ hyper v0.14.27
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ futures-channel v0.3.28
β”‚   β”‚   β”‚   └── futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-core v0.3.28
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ h2 v0.3.20 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ http-body v0.4.5 (*)
β”‚   β”‚   β”œβ”€β”€ httparse v1.8.0
β”‚   β”‚   β”œβ”€β”€ httpdate v1.0.2
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.9
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”‚   β”œβ”€β”€ socket2 v0.4.9 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”‚   β”œβ”€β”€ tracing v0.1.37 (*)
β”‚   β”‚   └── want v0.3.1
β”‚   β”‚       └── try-lock v0.2.4
β”‚   β”œβ”€β”€ hyper-rustls v0.24.1
β”‚   β”‚   β”œβ”€β”€ futures-util v0.3.28 (*)
β”‚   β”‚   β”œβ”€β”€ http v0.2.9 (*)
β”‚   β”‚   β”œβ”€β”€ hyper v0.14.27 (*)
β”‚   β”‚   β”œβ”€β”€ rustls v0.21.5
β”‚   β”‚   β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ libc v0.2.147
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”‚   β”‚   β”‚   └── untrusted v0.7.1
β”‚   β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   β”‚   └── cc v1.0.79
β”‚   β”‚   β”‚   β”œβ”€β”€ rustls-webpki v0.101.1
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚   β”‚   └── untrusted v0.7.1
β”‚   β”‚   β”‚   └── sct v0.7.0
β”‚   β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚       └── untrusted v0.7.1
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   └── tokio-rustls v0.24.1
β”‚   β”‚       β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”‚       └── tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ hyper-tls v0.5.0
β”‚   β”‚   β”œβ”€β”€ bytes v1.4.0
β”‚   β”‚   β”œβ”€β”€ hyper v0.14.27 (*)
β”‚   β”‚   β”œβ”€β”€ native-tls v0.2.11
β”‚   β”‚   β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”‚   β”‚   β”œβ”€β”€ openssl v0.10.55 (*)
β”‚   β”‚   β”‚   β”œβ”€β”€ openssl-probe v0.1.5
β”‚   β”‚   β”‚   └── openssl-sys v0.9.90 (*)
β”‚   β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”‚   └── tokio-native-tls v0.3.1
β”‚   β”‚       β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”‚       └── tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ ipnet v2.8.0
β”‚   β”œβ”€β”€ log v0.4.19
β”‚   β”œβ”€β”€ mime v0.3.17
β”‚   β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”œβ”€β”€ once_cell v1.18.0
β”‚   β”œβ”€β”€ percent-encoding v2.3.0
β”‚   β”œβ”€β”€ pin-project-lite v0.2.10
β”‚   β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”œβ”€β”€ rustls-pemfile v1.0.3
β”‚   β”‚   └── base64 v0.21.2
β”‚   β”œβ”€β”€ serde v1.0.171
β”‚   β”œβ”€β”€ serde_urlencoded v0.7.1
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0
β”‚   β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.9
β”‚   β”‚   β”œβ”€β”€ ryu v1.0.15
β”‚   β”‚   └── serde v1.0.171
β”‚   β”œβ”€β”€ tokio v1.29.1 (*)
β”‚   β”œβ”€β”€ tokio-native-tls v0.3.1 (*)
β”‚   β”œβ”€β”€ tokio-rustls v0.24.1 (*)
β”‚   β”œβ”€β”€ tower-service v0.3.2
β”‚   β”œβ”€β”€ url v2.4.0
β”‚   β”‚   β”œβ”€β”€ form_urlencoded v1.2.0 (*)
β”‚   β”‚   β”œβ”€β”€ idna v0.4.0
β”‚   β”‚   β”‚   β”œβ”€β”€ unicode-bidi v0.3.13
β”‚   β”‚   β”‚   └── unicode-normalization v0.1.22
β”‚   β”‚   β”‚       └── tinyvec v1.6.0
β”‚   β”‚   β”‚           └── tinyvec_macros v0.1.1
β”‚   β”‚   └── percent-encoding v2.3.0
β”‚   └── webpki-roots v0.22.6
β”‚       └── webpki v0.22.0
β”‚           β”œβ”€β”€ ring v0.16.20 (*)
β”‚           └── untrusted v0.7.1
└── serde_json v1.0.103
    β”œβ”€β”€ itoa v1.0.9
    β”œβ”€β”€ ryu v1.0.15
    └── serde v1.0.171

Can you see? ring still here.

cargo tree --target riscv64gc-unknown-linux-gnu | grep ring
β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ring v0.16.20 (*)
β”‚   β”‚   β”‚       β”œβ”€β”€ ring v0.16.20 (*)
β”‚           β”œβ”€β”€ ring v0.16.20 (*)

And rustls

cargo tree --target riscv64gc-unknown-linux-gnu | grep tls 
β”‚   β”œβ”€β”€ hyper-rustls v0.24.1
β”‚   β”‚   β”œβ”€β”€ rustls v0.21.5
β”‚   β”‚   β”‚   β”œβ”€β”€ rustls-webpki v0.101.1
β”‚   β”‚   └── tokio-rustls v0.24.1
β”‚   β”‚       β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”œβ”€β”€ hyper-tls v0.5.0
β”‚   β”‚   β”œβ”€β”€ native-tls v0.2.11
β”‚   β”‚   └── tokio-native-tls v0.3.1
β”‚   β”‚       β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”œβ”€β”€ native-tls v0.2.11 (*)
β”‚   β”œβ”€β”€ rustls v0.21.5 (*)
β”‚   β”œβ”€β”€ rustls-pemfile v1.0.3
β”‚   β”œβ”€β”€ tokio-native-tls v0.3.1 (*)
β”‚   β”œβ”€β”€ tokio-rustls v0.24.1 (*)

Can you git clone and try to build it? I think words are sometimes hard to express ideas.
If you would like to run it in github action, don't remember to add target: riscv64gc-unknown-linux-gnu

The new resolver is the default with edition = "2021": Default Cargo feature resolver - The Rust Edition Guide

The problem is probably that riscv64gc is not a valid target_arch value. The correct target_arch for riscv64gc-unknown-linux-gnu is riscv64. Unfortunately these don't seem to be well documented, you can get them from rustc +nightly -Z unstable-options --print all-target-specs-json or this crate: platforms - Rust

2 Likes

Yeah man, it works.
I change riscv64gc to riscv64, but now it's openssl's problem.I don't know why.

[dependencies]
serde_json = { version = "1.0", features = ["alloc"], default-features = false }

[target.'cfg(not(any(all(target_arch = "aarch64", target_os = "windows"), all(target_arch = "riscv64", target_os = "linux"))))'.dependencies]
reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-features = false }

[target.aarch64-pc-windows-msvc.dependencies]
openssl = { version = "0.10", features = ["vendored"], default-features = false }
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[target.riscv64gc-unknown-linux-gnu.dependencies]
openssl = { version = "0.10"}
reqwest = { version = "0.11", features = ["blocking", "default-tls"], default-features = false }

[profile.release]
codegen-units = 1
lto = true
opt-level = "z"

Here is output.

cargo build --target riscv64gc-unknown-linux-gnu
   Compiling autocfg v1.1.0
   Compiling libc v0.2.147
   Compiling cc v1.0.79
   Compiling proc-macro2 v1.0.65
   Compiling pkg-config v0.3.27
   Compiling cfg-if v1.0.0
   Compiling pin-project-lite v0.2.10
   Compiling once_cell v1.18.0
   Compiling unicode-ident v1.0.11
   Compiling quote v1.0.30
   Compiling bytes v1.4.0
   Compiling futures-core v0.3.28
   Compiling itoa v1.0.9
   Compiling memchr v2.5.0
   Compiling futures-task v0.3.28
   Compiling openssl v0.10.55
   Compiling tracing-core v0.1.31
   Compiling futures-util v0.3.28
   Compiling fnv v1.0.7
   Compiling foreign-types-shared v0.1.1
   Compiling foreign-types v0.3.2
   Compiling http v0.2.9
   Compiling native-tls v0.2.11
   Compiling openssl-src v111.26.0+1.1.1u
   Compiling tokio v1.29.1
   Compiling slab v0.4.8
   Compiling indexmap v1.9.3
   Compiling tracing v0.1.37
   Compiling bitflags v1.3.2
   Compiling httparse v1.8.0
   Compiling tinyvec_macros v0.1.1
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.28
   Compiling futures-sink v0.3.28
   Compiling hashbrown v0.12.3
   Compiling socket2 v0.4.9
   Compiling num_cpus v1.16.0
   Compiling mio v0.8.8
   Compiling syn v2.0.26
   Compiling serde v1.0.171
   Compiling futures-channel v0.3.28
   Compiling tinyvec v1.6.0
   Compiling openssl-probe v0.1.5
   Compiling log v0.4.19
   Compiling percent-encoding v2.3.0
   Compiling try-lock v0.2.4
   Compiling form_urlencoded v1.2.0
   Compiling want v0.3.1
   Compiling openssl-sys v0.9.90
   Compiling http-body v0.4.5
   Compiling unicode-bidi v0.3.13
   Compiling ryu v1.0.15
   Compiling httpdate v1.0.2
   Compiling unicode-normalization v0.1.22
   Compiling tower-service v0.3.2
   Compiling serde_json v1.0.103
   Compiling encoding_rs v0.8.32
   Compiling base64 v0.21.2
   Compiling ipnet v2.8.0
   Compiling mime v0.3.17
   Compiling idna v0.4.0
   Compiling url v2.4.0
error: failed to run custom build command for `openssl-sys v0.9.90`

Caused by:
  process didn't exit successfully: `/home/aaa/Code/rust/Network-Master-Rust/target/debug/build/openssl-sys-4c76c93aefd104d1/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_NO_VENDOR
  RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=CC_riscv64gc-unknown-linux-gnu
  CC_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_riscv64gc_unknown_linux_gnu
  CC_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc-unknown-linux-gnu
  CFLAGS_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc_unknown_linux_gnu
  CFLAGS_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = None
  cargo:rerun-if-env-changed=AR_riscv64gc-unknown-linux-gnu
  AR_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_riscv64gc_unknown_linux_gnu
  AR_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_AR
  TARGET_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_riscv64gc-unknown-linux-gnu
  ARFLAGS_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_riscv64gc_unknown_linux_gnu
  ARFLAGS_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_ARFLAGS
  TARGET_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rerun-if-env-changed=RANLIB_riscv64gc-unknown-linux-gnu
  RANLIB_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=RANLIB_riscv64gc_unknown_linux_gnu
  RANLIB_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_RANLIB
  TARGET_RANLIB = None
  cargo:rerun-if-env-changed=RANLIB
  RANLIB = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_riscv64gc-unknown-linux-gnu
  RANLIBFLAGS_riscv64gc-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_riscv64gc_unknown_linux_gnu
  RANLIBFLAGS_riscv64gc_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_RANLIBFLAGS
  TARGET_RANLIBFLAGS = None
  cargo:rerun-if-env-changed=RANLIBFLAGS
  RANLIBFLAGS = None
  running cd "/home/sana/Code/rust/Campus-Network-Master-Rust/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-cf67956e526a0970/out/openssl-build/build/src" && AR="ar" CC="riscv64-linux-gnu-gcc" RANLIB="ranlib" "perl" "./Configure" "--prefix=/home/sana/Code/rust/Campus-Network-Master-Rust/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-cf67956e526a0970/out/openssl-build/install" "--openssldir=/usr/local/ssl" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "linux-generic64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-march=rv64gc" "-mabi=lp64d" "-mcmodel=medany"
  Configuring OpenSSL version 1.1.1u (0x1010115fL) for linux-generic64
  Using os-specific seed configuration
  Creating configdata.pm
  Creating Makefile

  **********************************************************************
  ***                                                                ***
  ***   OpenSSL has been successfully configured                     ***
  ***                                                                ***
  ***   If you encounter a problem while building, please open an    ***
  ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
  ***   and include the output from the following command:           ***
  ***                                                                ***
  ***       perl configdata.pm --dump                                ***
  ***                                                                ***
  ***   (If you are new to OpenSSL, you might want to consult the    ***
  ***   'Troubleshooting' section in the INSTALL file first)         ***
  ***                                                                ***
  **********************************************************************
  running cd "/home/sana/Code/rust/Campus-Network-Master-Rust/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-cf67956e526a0970/out/openssl-build/build/src" && "make" "depend"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/sana/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-111.26.0+1.1.1u/src/lib.rs:504:39
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

The openssl crate docs say you need a C compiler, perl, perl-core and make to build it with the vendored feature. Do you have all of them installed? openssl - Rust

1 Like

Thank you for your enthusiastic help.
I build with the cross tool,it can help you to cross build program in other architecture, now I finished compile it.
Thank you so much!

1 Like

Thank you help too

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.