I'm compiling a project that uses mongodb driver. Now the program is not compiling because among the package dependencies one needs the reference to two libraries ring_core_0_17_8_fiat_curve25519_adx_mul and the other ring_core_0_17_8_fiat_curve25519_adx_square. This is being compiled on Windows 10 using gcc/x86_64-w64-mingw32/14.2.0 from MSYS2.
task_process.rs
mod queues_mongo;
use queues_mongo::email_queue::search_queue;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let _ = search_queue().await;
Ok(())
}
email_queue.rs
extern crate dotenv;
use dotenv::dotenv;
use std::env;
use mongodb::{
bson::{doc, Document},
error, Client, Collection, Database,
};
#[allow(dead_code)]
pub async fn search_queue() -> error::Result<()> {
dotenv().ok();
let uri: String = env::var("MONGO_URI").expect("MONGO_URI");
let db: String = env::var("MONGO_DATABASE").expect("MONGO_DATABASE");
let client: Client = Client::with_uri_str(uri).await?;
let database: Database = client.database(db.as_str());
let collection: Collection = database.collection("emails");
let email: Option = collection.find_one(doc! { "status": "Sent" }).await?;
println!("Found a email:\n{:#?}", email);
Ok(())
}
according to the source code, these two functions are implemented in assembly:
maybe it's because your build environment has unusual configurations, or maybe the build script wrongly detected the envirnonment. anyway, you should report to the ring issue tracker.
I've been working on it these last few days and found a solution:
Clone the project or copy it to "C:\msys64\home\my_user" in MSYS2, don't do this in the Windows user folder "C:\Users\My User" because the Rust compiler will have problems with the dependencies.
Precompile the libraries "ring_core_0_17_8_fiat_curve25519_adx_mul" and the library "ring_core_0_17_8_fiat_curve25519_adx_square" using the "build.rs".