#error: couldn't read `/home/simon/knobapprs/DEVICE_APP/src-tauri/target/debug/build/device_app-0ee33

34 messages · Page 1 of 1 (latest)

naive skiff
#

@untold goblet

#

there

#

build.rs

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```
untold goblet
#

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

naive skiff
#

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

untold goblet
untold goblet
#

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

naive skiff
#

On the 1st or 2nd img

untold goblet
#

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

naive skiff
#

Thank you once im home ill fix it

naive skiff
#

HELL YEAH