#error: couldn't read `/home/simon/knobapprs/DEVICE_APP/src-tauri/target/debug/build/device_app-0ee33
34 messages · Page 1 of 1 (latest)
there
use std::io::Result;
fn main() -> Result<()> {
prost_build::compile_protos(&["src/logic/messages.proto"], &["src/"])?;
Ok(())
}
messages.proto
syntax = "proto3";
package messages;
message Handshake {
int32 handshake_code = 1;
}
error: couldn't read `/home/simon/knobapprs/DEVICE_APP/src-tauri/target/debug/build/device_app-0ee33abed7c4fa43/out/messages.rs`: No such file or directory (os error 2)
--> src/logic/connection.rs:3:9
|
3 | include!(concat!(env!("OUT_DIR"), "/messages.rs"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `device_app` (lib) due to 1 previous error```
try putting another proto file in src/whatever.proto
or try moving the existing file to src/logic/messages/messages.proto
or remove package messages;
or try everything and see what happens
I think the package messages; in proto files means something slightly different than you expect
dunno exactly what it is used for, but if you have one file, you don't need package
if you want package, you need to have some hierarchy of proto files
do note that I don't really know proto files that well
after that the issue persists
same compiler error
oh
proto complains
"Files must have a package defined."
ill try moving then i guess
"Files with package "protos" must be within a directory "protos" relative to root but were in directory ".". (buf lint PACKAGE_DIRECTORY_MATCH)"
idk
llms fail aswell

are you sure that this is your build.rs right now?
the second argument should be src/ for it to work correctly if I understand the source code of prost correctly
if it's src/protos/ then it won't work
Wait so first tell me what file structure
On the 1st or 2nd img
you do realise that you have 2 build.rs files from which one is ignored?
if you didn't change its location in Cargo.toml the the src/build.rs file is ignored
you should use the one directly next to Cargo.toml
Thank you once im home ill fix it
HELL YEAH