Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks vendored build of libusb-sys 0.4.3 release #261

Open
otavio opened this issue Aug 21, 2021 · 6 comments
Open

Breaks vendored build of libusb-sys 0.4.3 release #261

otavio opened this issue Aug 21, 2021 · 6 comments

Comments

@otavio
Copy link

otavio commented Aug 21, 2021

The last working version is 0.4.35. It errors out with:

[Running 'cargo check --features vendored']
    Updating crates.io index
   Compiling libusb1-sys v0.4.3 (/home/otavio/src/libusb1-sys)
error: failed to run custom build command for `libusb1-sys v0.4.3 (/home/otavio/src/libusb1-sys)`

Caused by:
  process didn't exit successfully: `/home/otavio/src/libusb1-sys/target/debug/build/libusb1-sys-6cb08a0c5a424a9f/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: TarError { desc: "failed to create `/home/otavio/src/libusb1-sys/target/debug/build/libusb1-sys-31b806956b2f4034/out/source`", io: Custom { kind: NotFound, error: "No such file or directory (os error 2) while canonicalizing /home/otavio/src/libusb1-sys/target/debug/build/libusb1-sys-31b806956b2f4034/out/source" } } }', build.rs:85:37
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Finished running. Exit status: 101]
@alexcrichton
Copy link
Owner

Thanks for the report, but can you help reduce this down to something to help track it down? As-is I don't know what to do reproduce this.

@otavio
Copy link
Author

otavio commented Aug 23, 2021

Sure. In fact it fails in:

https://github.com/a1ien/libusb1-sys/blob/0.4.3/build.rs#L70

It tries to extract the tarball in PathBuf::from(env::var("OUT_DIR").unwrap()).join("source"). The referred tarball is https://github.com/a1ien/libusb1-sys/blob/0.4.3/libusb/libusb-1.0.23.tar.gz

@alexcrichton
Copy link
Owner

To confirm, does #260 not fix this issue?

@otavio
Copy link
Author

otavio commented Aug 23, 2021

No. I tried with 0.4.37 and it also fails. In fact, the error is triggered here:

tar-rs/src/entry.rs

Lines 789 to 794 in 60c6bd8

let canon_target = dst.canonicalize().map_err(|err| {
Error::new(
err.kind(),
format!("{} while canonicalizing {}", err, dst.display()),
)
})?;

@ericswanson-dfinity
Copy link

I am seeing this error as well, both in 0.4.36 and 0.4.37. To reproduce, pass a path that does not yet exist to unpack_in(). The canonicalize() call fails because dst's parent directory does not exist. It would probably also fail for archives that have files with one or more directory components, rather than just a filename.

@alexcrichton
Copy link
Owner

Sorry I don't think I'll have time to help investigate this. It's almost surely related to #259 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants