tikv / protobuf-build

17 stars 30 forks source link

file name too long #52

Open j619s opened 3 years ago

j619s commented 3 years ago

tikv/client-cpp : I am using WSL2 with distro as Ubuntu and the tiup playground nightly runs fine. But when I am trying to run make run-example it says

failed to run custom build command for tikv-client-proto v0.0.0 (https://github.com/tikv/client-rust.git?rev=3fad149#3fad149f)``.
Caused by:
 process didn't exit successfully: /mnt/c/Users/JATIN/Desktop/Rust/client-cpp/target/debug/build/tikv-client-proto-5d1618a7041c86b4/build-script-build (exit code: 101)
 --- stderr
 thread 'main' panicked at 'Could not create file: Os { code: 36, kind: Other, message: "File name too long" }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-build-0.12.0/src/wrapper.rs:41:58
 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
 warning: build failed, waiting for other jobs to finish...
 Building [===================================================> ] 238/248: grpcio-

I also tried:

[patch.crates-io]
protobuf-build = { git = 'https://github.com/ekexium/protobuf-build', branch = 'debug-path-len', default-features = false, features = ["grpcio-prost-codec"] }

Then run cargo update -p protobuf-build and cargo build.

error: failed to run custom build command for `tikv-client-proto v0.0.0 (https://github.com/tikv/client-rust.git?rev=3fad149#3fad149f)`
Caused by:
  process didn't exit successfully: `/mnt/c/Users/JATIN/Desktop/Rust/client-cpp/target/debug/build/tikv-client-proto-0e0ccd492900eabd/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Could not create file:"/mnt/c/Users/JATIN/Desktop/Rust/client-cpp/target/debug/build/tikv-client-proto-96caf7297581d932/out/protos/wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_wrapper_diagnosticspb.rs", len = 364: Os { code: 36, kind: Other, message: "File name too long" }', /root/.cargo/git/checkouts/protobuf-build-a3d39ba4cabe4fd2/5096ee1/src/wrapper.rs:41:58
  note: run with `RUST_BACKTRACE=1` environment variable to display a
backtrace
ekexium commented 3 years ago

Comment: the patch just prints more info in the panic message. The file name contains 257 bytes which just exceeds the limit of 256 bytes.

j619s commented 3 years ago

Comment: the patch just prints more info in the panic message. The file name contains 257 bytes which just exceeds the limit of 256 bytes.

Is it the problem with wsl ?

ekexium commented 3 years ago

The length of filename is limited by OS. I don't know if it's WSL that causes the recursive wrapping.

kennytm commented 3 years ago

The length of filename is limited by OS.

That's the limit of NTFS file system, not the operating system.

tsinan commented 1 year ago

The length of filename is limited by OS. I don't know if it's WSL that causes the recursive wrapping.

Hi @ekexium , we found the same error because "recursive wrapping". Can you fix it? Maybe filter out files which start with "wrapper_" before WrapperGen?

Thanks~

ekexium commented 1 year ago

Hey @tsinan I don't have an environment to test the behavior. Could it be because of something like "modifying iterator (of files) when iterating over it"?

read_dir is implemented by FindFirstFile and FindNextFile on Windows. Could that be the reason? Are you interested in trying to fix it by first collecting the results of read_dir?

tsinan commented 1 year ago

Hi @ekexium , i have create a pull request about this, please check it. Thansk.